Visual Tools
Calculators
Tables
Mathematical Keyboard
Converters
Other Tools

How to Use the Law of Total Probability

When the chance of an event depends on which case you are in, find it in each case and take a weighted average. The weights are the probabilities of the cases.

Recognize the task

Several sources, groups or scenarios, each with its own rate: two machines with different defect rates, an urn chosen by a coin toss, a test that behaves differently for sick and healthy people. The question asks for the overall probability. Test: do the cases cover everything without overlapping?

Steps

StepOn two machines: 60% of parts at 2% defective, 40% at 5%
1Split into cases. The cases must not overlap and their probabilities must add to 11.P(M1)=0.6P(M_1) = 0.6, P(M2)=0.4P(M_2) = 0.4; 0.6+0.4=10.6 + 0.4 = 1 ✓
2Write the event probability in each case. These are conditional probabilities.P(D∣M1)=0.02P(D \mid M_1) = 0.02, P(D∣M2)=0.05P(D \mid M_2) = 0.05
3Multiply each case by its weight. Multiplication rule.0.6⋅0.02=0.0120.6 \cdot 0.02 = 0.012, 0.4⋅0.05=0.020.4 \cdot 0.05 = 0.02
4Add the products. Law of total probability.P(D)=0.012+0.02=0.032P(D) = 0.012 + 0.02 = 0.032

Worked examples

Example 1 · an urn chosen by a coin

two cases
urn 1: 33 red, 22 blue; urn 2: 11 red, 44 blue
each urn with chance 12\frac{1}{2}
P(R)=12⋅35+12⋅15P(R) = \frac{1}{2}\cdot\frac{3}{5} + \frac{1}{2}\cdot\frac{1}{5}
weight each urn
=25= \frac{2}{5}

Example 2 · three suppliers

three cases
shares 0.5,0.3,0.20.5, 0.3, 0.2; defect rates 0.01,0.02,0.030.01, 0.02, 0.03
0.005+0.006+0.0060.005 + 0.006 + 0.006
share times rate
P(D)=0.017P(D) = 0.017

Example 3 · the second card is an ace

cases from the first card
first an ace: 452⋅351\frac{4}{52}\cdot\frac{3}{51}
first not an ace: 4852⋅451\frac{48}{52}\cdot\frac{4}{51}
12+1922652=2042652=113\frac{12 + 192}{2652} = \frac{204}{2652} = \frac{1}{13}
same as the first card

See it happen

Cut the sample space into strips, one per case, with widths P(Bi)P(B_i). Inside each strip, shade the fraction P(A∣Bi)P(A \mid B_i). The total shaded area is P(A)P(A): a weighted average of the strip rates. Build your own partition in the total probability visualizer.

Common mistakes

Adding the rates without weights

✗ P(D)=0.02+0.05=0.07P(D) = 0.02 + 0.05 = 0.07
✓ weight each rate by its case: 0.6⋅0.02+0.4⋅0.05=0.0320.6 \cdot 0.02 + 0.4 \cdot 0.05 = 0.032

Cases that do not cover everything

✗ weights 0.50.5 and 0.30.3 only
✓ the weights must add to 11; add the missing case

Reversed conditionals

✗ using P(M1∣D)P(M_1 \mid D) as the weight
✓ the weight is P(M1)P(M_1); the rate is P(D∣M1)P(D \mid M_1)