Thought Toys · Data & inference · Exhibit 09

Bayes' theorem

A disease affects one person in a hundred. There's a test that's 90% accurate, and yours comes back positive. It feels like a 90% verdict — brace yourself. But the honest answer is closer to 9%. The test didn't lie; it's just that when a disease is rare, the few false alarms badly outnumber the real cases. Count it out, one thousand people at a time, and the paradox dissolves.

sick & flagged (real) healthy & flagged (false alarm) sick & missed healthy & cleared

A positive test means a 9% chance you're sick

Everyone the test flags positive
Try a scenario
your turn — press Very rare screen and watch a 90%-accurate test come back mostly wrong

What you're seeing

The thousand dots are a whole town. Up top, in gold, sit the people who are genuinely sick. Most of them — nine in ten with this test — get correctly flagged (bright gold); a few slip through missed (faint gold). Then come the red dots: people who are perfectly healthy but got a positive result anyway. There aren't many per person — the test is right about 9 healthy people in 10 — but there are so many healthy people that even that small slip-up rate produces a big red crowd.

Now the only question that matters after your positive result: among everyone the test flagged — the gold-real plus the red false alarms — what share are actually sick? That's the bar below the grid. When the disease is rare, the red badly outnumbers the gold, so a positive test is mostly a false alarm and your real odds stay low. The test was never wrong about its accuracy; your gut just quietly ignored how rare the thing was to begin with. That blind spot has a name: base-rate neglect — trusting a test's accuracy while forgetting how rare the thing it's testing for actually is.

Slide how common the disease is upward and watch the red shrink against the gold — for a common condition, the same test suddenly becomes trustworthy. That's the whole lesson of Bayes: a piece of evidence doesn't hand you the answer, it updates what you already knew. Start rare, end rare-ish; start likely, end likely. The prior always gets a vote.

The rule, exactly. Write P(sick) for how common the disease is (the prior), P(+|sick) for sensitivity, and P(+|healthy) = 1 − specificity for the false-alarm rate. Bayes' theorem says the chance you're sick given a positive test is P(sick|+) = P(+|sick)·P(sick) ⁄ [ P(+|sick)·P(sick) + P(+|healthy)·P(healthy) ] — true positives over all positives. With 1% prevalence, 90% sensitivity, 91% specificity that's (0.9·0.01) ⁄ (0.9·0.01 + 0.09·0.99) ≈ 9.2%. (Checked offline before shipping: the formula and a head-count over a population agree, and the counts you see on the grid drive the percentage shown, so the picture and the number always match.) Counter-example, verified in node: a 99%-accurate test on a 1%-prevalence disease still leaves a positive result only ~17% likely to be real — the base rate dominates.

Also in Data & inference: You always land in the long gap. →

All 14 in Data & inference
  1. 09Bayes' theorem — you are here
  2. 104You always land in the long gap.
  3. 110Five serial numbers. Now guess how many they built.
  4. 113In enough dimensions, nothing is near anything
  5. 121The faster the rating learns, the less it knows
  6. 28Simpson's paradox
  7. 39Zipf's law
  8. 40Benford's law
  9. 48The wisdom of crowds
  10. 86Nobody got worse. The luck just didn't show up twice.
  11. 87Your friends really do have more friends than you.
  12. 96Plan for the average and you'll be wrong every time
  13. 98The numbers agree. The pictures don't.
  14. 99Unrelated in the crowd. A trade-off inside the gate.

← Back to the cabinet  ·  Thought Toys — Exhibit 09.