How Bayes' theorem works

Why a positive test for something rare usually means you don't have it, shown by counting people.

The key: a positive test puts you in the group of everyone who tested positive. If the condition is rare, most of that group are healthy people the test flagged by mistake, because there are so many more healthy people for it to make mistakes on.

1 · Test 1,000 people

Picture 1,000 people. A condition affects 1% of them. The test catches 90% of people who have it, and it wrongly flags 9% of people who don't. Watch the test sweep across the crowd.

Watchthe dark rings appear. Of the 10 red (sick) people, the test rings 9. Of the 990 grey (healthy) people it also rings 89.

Trydrag How common down to 0.1%, then up to 20%. Watch the balance of red rings against grey rings.

Why9% of a big group (990 healthy people) is far more people than 90% of a tiny group (10 sick people).

2 · Keep only the positives

You took the test and it came back positive. All you know now is that you are one of the ringed people. So forget everyone else and look only at them. First, guess: what share of the ringed people are actually sick?

Watcheveryone who tested negative fades out. The ringed people walk into the box, sick ones first. The answer appears once they've all arrived.

Trypick a guess before the reveal. Most people (doctors too, in studies) guess about 90%, because the test is "90% accurate".

Whythe answer is 9 out of 98, about 9%. "Catches 90% of the sick" answers a different question: it starts from the sick people, while you start from the positives.

3 · The formula is the same counting

Bayes' theorem is that box, written as areas. The square is everyone. The thin left strip is the sick people, the wide right part the healthy. The darker top of each part is the people who test positive.

Watchthe two dark pieces lift out and join into one bar. That bar is "everyone who tested positive", and the red share of it is your answer: 9.2%.

Trydrag the square's edges directly: the divider between sick and healthy, or the top edge of either dark piece. The formula's numbers follow your hand.

WhyP(sick | positive) = sick-and-positive ÷ all-positive. The top of the fraction is the red piece; the bottom is both pieces together. How common the condition is (the strip's width) matters as much as how good the test is.

4 · Run it for real: random patients

Figures 1–3 used exact counts. Real patients arrive at random. Here each one is randomly sick or healthy, then randomly tested. The chart tracks the share of positives who are really sick.

Watchthe black line on the chart wobble at first, then settle onto the dashed line the formula predicts (9.2%).

Trytick Retest the positives. Two positive tests in a row push the share up to 50%: each test moves you on from where the last one left you. Then try the presets.

Whythat is the whole theorem: start from how common something is, then let each piece of evidence update it. A single positive on a rare condition is a reason to retest, not a verdict.

The numbers in the presets are textbook examples chosen to show the effect, not figures for any real test.