It follows immediately from the definition
Both P(A|B)P(B) and P(B|A)P(A) equal P(A ∩ B), so they are equal to each other. Dividing gives the theorem.
P(A|B) = P(B|A)P(A)/P(B) converts one conditional into the other. Applied to a medical test with a rare disease, it produces an answer most people — including most doctors — get badly wrong.
Core ideas
The theorem is one line of algebra. Its consequences are the reason this lesson exists.
Both P(A|B)P(B) and P(B|A)P(A) equal P(A ∩ B), so they are equal to each other. Dividing gives the theorem.
P(B) is usually computed by splitting on A and Ā, which is where the base rate enters the calculation.
A 99%-accurate test for a disease affecting 1 in 10 000 produces about 100 false positives for every true one.
The material
The statement, the total-probability denominator, and the medical-test calculation.
If A₁, …, A_n partition S with each P(Aᵢ) > 0, then P(B) = Σᵢ P(B|Aᵢ)P(Aᵢ). The two-case form is P(B) = P(B|A)P(A) + P(B|Ā)P(Ā).
The sets B ∩ Aᵢ are disjoint with union B, so by additivity P(B) = Σ P(B ∩ Aᵢ), and each term is P(B|Aᵢ)P(Aᵢ) by the multiplication rule.
□
For events with P(A), P(B) > 0, P(A|B) = P(B|A)P(A) / P(B), where P(B) is normally expanded by the law of total probability.
P(A ∩ B) = P(A|B)P(B) and P(A ∩ B) = P(B|A)P(A). Setting the two equal and dividing by P(B) gives the result.
□
A disease affects 1 in 1000 people. A test detects it in 99% of those who have it, and gives a false positive in 5% of those who do not. You test positive. What is the probability you have the disease?
About 2%. A positive result on a 99%-sensitive test leaves you 98% likely not to have the disease, because the test is applied to a population in which almost nobody does.
The frequency version is the same arithmetic and is far easier to believe. It is worth doing both ways every time: the formula gives the number and the frequencies explain it.
The error the calculation prevents is base-rate neglect: reading P(+ | D) = 0.99 as though it were P(D | +). The two differ by the factor P(D)/P(+), and when the disease is rare that factor is enormous.
Interactive
A million people, four whole-number cells
Method
Write the prior down first; it is the number people forget.
"Sensitivity" is P(+|D); "false positive rate" is P(+|D̄). Neither is the number you were asked for.
The base rate P(A). Omitting it is the error the whole lesson is about.
P(B) = P(B|A)P(A) + P(B|Ā)P(Ā). Both branches contribute, and for rare conditions the second dominates.
Take a population of 100 000 and count. If the two methods disagree, the arithmetic is wrong; if they agree, the surprising answer is right.
Identical test, but the condition affects 30% of those tested.
This is why screening a whole population and testing a symptomatic patient are different acts with the same instrument. The test did not change; the population it was applied to did, and the posterior depends on both.
Take a test with 95% sensitivity and 10% false positives for a condition affecting 2% of the population. Compute P(D|+) by the formula, then by counting a population of 10 000: you should find 190 true positives against 980 false ones, so about 16%. The agreement is the point.
Something to change about this lesson? Write it down, tick it off when it is handled, and export the list when you want to act on it. Kept in this browser only: nothing is sent anywhere, and nobody is notified.
No recommendations yet for this lesson.