You test positive for a rare disease. How likely is it that you have it?

Probability
Easy
A conditional probability puzzle that Bayes’ theorem solves.
Published

November 16, 2026

NoteQuestion

One person in 100 has a certain disease, and the other 99 are healthy. A test for the disease is positive for 80% of sick people and for 10% of healthy people. Your test is positive. What is the probability that you are sick?

Try it first, then open the solution.

The answer is 8/107, about 7.5%.

Let \(A\) be “you are sick” and \(B\) be “your test is positive”. The question asks for \(P(A \mid B)\), the probability that you are sick given that your test is positive. A conditional probability keeps only the cases in which \(B\) happens, and takes the share of them in which \(A\) also happens:

\[P(A \mid B) = \frac{P(A \cap B)}{P(B)}. \tag{1}\]

The question gives neither the numerator, the probability of being sick and testing positive, nor the denominator, the probability of testing positive. It gives three other probabilities:

Symbol Meaning Value
\(P(A)\) share of people who are sick 0.01
\(P(B \mid A)\) share of sick people who test positive 0.80
\(P(B \mid \text{not } A)\) share of healthy people who test positive 0.10

Bayes’ theorem rewrites (1) with these three. For the numerator, write (1) with \(A\) and \(B\) swapped, \(P(B \mid A) = P(A \cap B)/P(A)\), and multiply both sides by \(P(A)\):

\[\begin{aligned} P(A \cap B) &= P(B \mid A)\, P(A) \\ &= 0.80 \times 0.01 = 0.008. \end{aligned} \tag{2}\]

For the denominator, add the two ways to test positive, sick or healthy, each from (2), with \(P(\text{not } A) = 1 - 0.01 = 0.99\):

\[\begin{aligned} P(B) &= P(B \mid A)\, P(A) \\ &\quad + P(B \mid \text{not } A)\, P(\text{not } A) \\ &= 0.008 + 0.10 \times 0.99 = 0.107. \end{aligned} \tag{3}\]

Putting (2) and (3) into (1) gives Bayes’ theorem and the answer:

\[\begin{aligned} P(A \mid B) &= \frac{P(B \mid A)\, P(A)}{P(B)} \\ &= \frac{P(A \cap B)}{P(A \cap B) + P(\text{not } A \cap B)} \\ &= \frac{0.008}{0.008 + 0.099} = 0.0748. \end{aligned} \tag{4}\]

The numerator is one of the two terms in the denominator, so the theorem computes a share. Of everyone who tests positive, it gives the share who are sick.

The animation draws the same steps as a tree for 1,000 people, where each probability becomes an expected number of people.

Why a positive test for a rare disease means only a 7.5% chance of being sick: a probability tree for 1,000 people, with 8 sick and 99 healthy people testing positive

Healthy people are 99 times as common as sick people, so the test’s 10% false positives produce 99 false alarms for every 8 true positives. The same steps work for any evidence and explanation, such as a spam filter’s flag or a trading signal that passes a backtest.

The common wrong answers each use the wrong piece of the tree:

Answer The slip
80% gives \(P(B \mid A)\), the reverse of what the question asks
0.8/(0.8 + 0.1) ≈ 89% uses the two test rates alone, as if sick and healthy people were equally common
0.8% gives \(P(A \cap B)\) and forgets to divide by \(P(B) = 0.107\)
1% ignores the test result
p_sick = 0.01
p_positive_if_sick = 0.80
p_positive_if_healthy = 0.10

p_sick_and_positive = p_positive_if_sick * p_sick
p_positive = p_sick_and_positive + p_positive_if_healthy * (1 - p_sick)
answer = p_sick_and_positive / p_positive

print(round(p_sick_and_positive, 3), round(p_positive, 3), round(answer, 4))
0.008 0.107 0.0748