A medical test is "90% accurate," and you test positive. How likely is it that you have the condition? Most people guess about 90%. The right answer is often far lower. Bayes' rule reverses a conditional probability, using the multiplication rule and the table idea together.
🔑 Key idea
To reverse a conditional probability, imagine a large group (say 10,000 people) and count. In symbols,
$$P(D \mid +) = \dfrac{P(D)\,P(+ \mid D)}{P(D)\,P(+ \mid D) + P(D^{\prime})\,P(+ \mid D^{\prime})}.$$
The answer depends heavily on the base rate $P(D)$.
💡 Why it works
By definition, $P(D \mid +) = P(D \cap +)/P(+)$. The multiplication rule gives the numerator: $P(D \cap +) = P(D)P(+ \mid D)$. A positive test happens in two ways, a true positive or a false positive, so $P(+)$ is the sum of the two paths in the tree (the law of total probability). When the condition is rare, the healthy group is huge, and even a small false-positive rate applied to it produces more positives than the small sick group does.
Each square is one person. Red: has the condition. Gold: a false alarm. Slide the base rate up and watch the share of real positives grow.
✏️ Worked example: Natural frequencies
A condition affects 1% of people. A test is positive for 90% of people who have it and for 9% of people who do not. You test positive. Find $P(\text{condition} \mid +)$.
Imagine 10,000 people: 100 have the condition, 9,900 do not.
True positives: 90% of 100 = 90.
False positives: 9% of 9,900 = 891.
Positives in all: $90 + 891 = 981$. Of these, 90 have the condition.
Answer: About 50%: each positive test raises the probability, starting from the base rate.
The condition is "Positive" on either path. P(condition | positive) = the selected path divided by both positive paths.
⚠️ Common mistake
Ignoring how rare the condition is and trusting a positive result too much: treating $P(+ \mid D) = 90\%$ as if it were $P(D \mid +)$. Check by imagining 10,000 people and counting both kinds of positives. If the healthy group is huge, false positives can outnumber true ones.
Practice
Pass with 3 right answers, the last 2 in a row. Each right answer earns 3 XP.