P(A) = P(A|B) · P(B) + P(A|B̄) · P(B̄)
Holds when 0 < P(B) < 1, so that both conditional probabilities are defined.
B̄ (not-B, also written Bᶜ or B′) is the complement of B, and P(B̄) = 1 − P(B). The card writes it that way,
because the two branches have to cover everything that can happen: B and B̄ cannot both occur, and one of
them does.
Each term is one branch of a tree diagram: the probability of getting onto the branch times the probability
of A along it.
It rains on three mornings in ten — P(rain) = 0.3. When it rains the bus is late with probability 0.8,
otherwise with probability 0.15. What is the probability the bus is late?
P(late) = 0.8 · 0.3 + 0.15 · 0.7 = 0.24 + 0.105 = 0.345.
The same thing counted over 1,000 mornings: 300 rainy, 240 of them with a late bus; 700 dry, 105 of them
with a late bus. 345 in 1,000.
Two usual slips
|
Working |
Answer |
| Wrong: the conditionals added |
0.8 + 0.15 |
0.95 |
| Wrong: second branch times P(B) |
0.8 · 0.3 + 0.15 · 0.3 |
0.285 |
| Right |
0.8 · 0.3 + 0.15 · 0.7 |
0.345 |
The first ignores that the branches carry different weights; the second weights the dry branch by the
probability of rain. The check is that P(A) lands between P(A|B) and P(A|B̄) — it is a weighted average of
the two — and 0.345 lies between 0.15 and 0.8.
When the branches agree
If the bus is late with probability 0.2 whatever the weather, P(late) = 0.2 · 0.3 + 0.2 · 0.7 = 0.2. Then
P(B) makes no difference, which is what it means for A and B to be
independent. The card refuses to
solve for P(B) when the two conditionals are equal: P(A) then says nothing about P(B).
More than two branches
The law holds for any split, as long as the branches exclude each other and together cover every outcome.
Three machines make 50%, 30% and 20% of a product, with defect rates of 2%, 4% and 5%:
| Machine |
Share |
Defect rate |
Product |
| 1 |
0.5 |
0.02 |
0.010 |
| 2 |
0.3 |
0.04 |
0.012 |
| 3 |
0.2 |
0.05 |
0.010 |
| Total |
1 |
|
0.032 |
The next step is often to turn the question round: given that the bus was late, how likely is it that it
rained? That is Bayes’ theorem, with 0.345 as the
denominator: 0.24 / 0.345 ≈ 0.70.
Common mistakes
- Adding the conditional probabilities. They are weighted by the branch probabilities first.
- Forgetting that P(B̄) = 1 − P(B). The second branch has its own weight.
- Branches that overlap. An outcome that belongs to two branches is counted twice.
- Swapping P(A|B) and P(B|A). The probability of a late bus when it rains is not the probability of rain
when the bus is late.
Questions people ask
Why is the formula true?
A happens either together with B or together with B̄, never both. So P(A) = P(A∩B) + P(A∩B̄), and each of
those is a conditional probability times
its condition: P(A∩B) = P(A|B) · P(B).
Do I need the formula if I draw a tree diagram?
No, it is the same calculation. Multiplying along the branches and adding the branches that end in A is
exactly what the formula says.
Can I work backwards?
Yes. Knowing P(A) and the two conditionals, the formula gives P(B) = (P(A) − P(A|B̄)) / (P(A|B) − P(A|B̄)).
The card solves for any of the four.