← Back to course

Conditional Probability, Trees & the Rare-Disease Trap

You’ll be able to

The order of conditioning changes everything

P(A | B) and P(B | A) are different quantities, and confusing them is among the most consequential errors in applied statistics. P(positive test | disease) is the test's sensitivity — a property of the test. P(disease | positive test) is what a patient actually wants to know, and it depends on how common the disease is. The two can differ by an order of magnitude. The formula P(A | B) = P(A and B)/P(B) makes the asymmetry visible: the denominators are different events.

Conditional probability and independence
P(A | B) = P(A and B)/P(B) independent if P(A | B) = P(A), equivalently P(A and B) = P(A)P(B)
Independence is a claim that conditioning changes nothing. It must be checked, not assumed, and it is a different idea from mutual exclusivity — two mutually exclusive events with nonzero probability are never independent.

Trees make base rates visible

A tree diagram branches first on the underlying condition and then on the test result, and multiplying along a branch gives the probability of that combination. The key move is that the denominator for P(disease | positive) is the total probability of a positive result — the sum of true positives and false positives. When the disease is rare, the false-positive branch starts from a much larger base, and it can easily dominate even when the false-positive rate is small.

Worked example

A disease affects 1% of a population. A test detects it in 99% of those who have it and gives a false positive for 5% of those who do not. A randomly chosen person tests positive. What is the probability they have the disease?

  1. 1.Imagine 10,000 people. About 100 have the disease and 9,900 do not.
  2. 2.Of the 100 with the disease, 99% test positive: about 99 true positives.
  3. 3.Of the 9,900 without it, 5% test positive: about 495 false positives.
  4. 4.Total positives = 99 + 495 = 594, so P(disease | positive) = 99/594 ≈ 0.167.
Answer: About 16.7%. Despite a test that is 99% sensitive, most positive results are false, because the healthy group is a hundred times larger and even a 5% error rate on that group produces five times as many false positives as there are true ones.
Watch out

Mutually exclusive and independent are not the same and are close to opposites. If A and B cannot both happen, then learning that A occurred tells you B did not — that is maximal dependence. Mutually exclusive means P(A and B) = 0; independent means P(A and B) = P(A)P(B), which is nonzero when both events are possible.

Checkpoint

In the rare-disease scenario, the reason most positive tests are false is that —

Checkpoint

Events A and B are mutually exclusive, and both have probability greater than zero. It follows that they are —

Answer the 2 checkpoints as you read.

Sign in to save your progress