Loading…

Total Probability Law Calculator

Math Probability • Conditional Probability and Events

View all topics

Total Probability Law Calculator – Weighted Sum over a Partition (Free)

Compute \(P(B)\) using a partition \(\{A_i\}\): \(P(B)=\sum_i P(B\mid A_i)\,P(A_i)\). This is the “law of alternatives” (law of total probability).

Tip: Press Play after calculating to animate how each term contributes to the final \(P(B)\).

Partition \(\{A_i\}\) and conditionals
Rows
Event
\(P(A_i)\)
\(P(B\mid A_i)\)
Action

Inputs accept 1e-3, pi, e, sqrt(2), sin(), cos(), tan(), ln(), log(), abs(). Use * for multiplication.

Checks & output

The bar visualization represents the partition by widths \(P(A_i)\) and fills each segment by \(P(B\mid A_i)\), so the total filled area corresponds to \(P(B)\).

Ready
Interactive partition contribution view

Widths: \(P(A_i)\). Fill heights: \(P(B\mid A_i)\). Total filled area: \(\sum_i P(B\mid A_i)P(A_i)=P(B)\).

Rate this calculator

0.0 /5 (0 ratings)
Be the first to rate.
Your rating
You can update your rating any time.

Frequently Asked Questions

What does it mean that A_i form a partition?

They are mutually exclusive and cover all outcomes, so exactly one A_i occurs and ΣP(A_i)=1.

Why is P(B) a weighted sum?

Because each case A_i contributes P(B|A_i) scaled by how often that case occurs, P(A_i).

What if ΣP(A_i) is not 1?

Strictly, the law assumes ΣP(A_i)=1. If your values are unnormalized weights, you can normalize them or correct the missing/incorrect cases.

Does this apply to continuous variables?

Yes. In university settings, the sum becomes an integral over a density: P(B)=∫ P(B|X=x)f_X(x)dx.