Conditional Probability: Diagram-Based Questions (5)

medium 2 min read

Question

A test for a disease is 95% accurate (both for positives and negatives). The disease affects 1% of the population. A random person tests positive. What is the probability they actually have the disease?

Solution — Step by Step

Let DD = “has disease”, TT = “tests positive”.

P(D)=0.01P(D) = 0.01, P(Dc)=0.99P(D^c) = 0.99.

P(TD)=0.95P(T \mid D) = 0.95 (true positive). P(TDc)=0.05P(T \mid D^c) = 0.05 (false positive).

We want P(DT)P(D \mid T).

P(DT)=P(TD)P(D)P(T)P(D \mid T) = \frac{P(T \mid D) P(D)}{P(T)}

P(T)=P(TD)P(D)+P(TDc)P(Dc)P(T) = P(T \mid D)P(D) + P(T \mid D^c)P(D^c)

=0.95×0.01+0.05×0.99= 0.95 \times 0.01 + 0.05 \times 0.99

=0.0095+0.0495=0.059= 0.0095 + 0.0495 = 0.059.

P(DT)=0.00950.0590.161P(D \mid T) = \dfrac{0.0095}{0.059} \approx 0.161.

Final answer: P(DT)16.1%P(D \mid T) \approx \mathbf{16.1\%}.

Why This Works

The result is counter-intuitive — only 16% chance of actually having the disease despite a “95% accurate” test! This is the classic base-rate fallacy. When the disease is rare, false positives outnumber true positives even with a high test accuracy.

Imagine a population of 10,00010{,}000. About 100100 have the disease (95 test positive, 5 miss). 9,9009{,}900 are healthy (495495 false positive, 9,4059{,}405 correctly negative). Of the 590590 positive tests total, only 9595 are real — 16%\approx 16\%.

Alternative Method

Build a 2×22 \times 2 tree diagram or contingency table with 10,00010{,}000 people:

Test +Test −Total
Disease955100
Healthy49594059900
Total590941010000

P(DT)=95/5900.161P(D \mid T) = 95/590 \approx 0.161. Identical answer, no formulas.

Common Mistake

Students often confuse P(DT)P(D \mid T) with P(TD)P(T \mid D). They are different quantities! “Test accuracy” is P(TD)P(T \mid D) — given disease, probability of positive test. “Predictive value of a positive test” is P(DT)P(D \mid T) — given positive test, probability of disease. These differ wildly when the disease is rare. Always write down which conditional you’re computing.

Want to master this topic?

Read the complete guide with more examples and exam tips.

Go to full topic guide →

Try These Next