Math paradoxes

The false positive paradox The test is 99% accurate. What is the chance you're ill?Your chance of being ill is 50%.

One person in 100 has the disease. The test catches 99% of sick people and wrongly flags only 1% of healthy ones. You test positive. What is the chance you're really ill? Lock in your answer, then check it on a crowd of 1,000, with a simulation and with Bayes' theorem.

One person in 100 has the disease. The test catches 99% of sick people and wrongly flags only 1% of healthy ones. You test positive. Most people, many doctors included, conclude: "So I'm 99% likely to be ill." The real chance is 50/50. Check it on a crowd of 1,000, with a simulation and with Bayes' theorem.

Make a guess
99%test accuracy
50%chance you're ill
The puzzle

Picture this: you've had a test

This puzzle is known as the false positive paradox, and the mistake intuition makes here is called the base rate fallacy. We look at how accurate the test is and forget how rare the disease is. Bayes' theorem shows how to work it out correctly.

  1. 1

    The disease

    1% of people have the disease, one person in 100. It has no visible symptoms.

  2. 2

    The test

    If a person is ill, the test says "positive" 99% of the time. That's the sensitivity. If a person is healthy, it says "negative" 99% of the time. That's the specificity. So only 1% of healthy people get a false positive.

  3. 3

    You

    You're tested during a routine check-up, with no complaints. So you're a random member of the population.

  4. 4

    The result

    The test is positive. What is the chance you're really ill?

Intuition says

"The test is 99% accurate, so I'm 99% likely to be ill"

In fact the chance is 50%. For every sick person who tests positive there is one healthy person with a false positive. Healthy people outnumber the sick 99 to 1, so even 1% of them adds up to as many positives as all the sick people together.

Model assumptions

  • The share of sick people, the base rate, is 1%.
  • Sensitivity 99%: the test finds 99 of 100 sick people.
  • Specificity 99%: 99 of 100 healthy people test negative.
  • You were picked at random, not because of symptoms.
  • Repeat tests err independently of each other.

The numbers are illustrative. Real tests vary in accuracy, and doctors also weigh symptoms and other results. Round 5 shows how that changes the answer.

Round 1 · Guess

What's the chance you're ill?

Lock in your answer before reading on. 1% of people have the disease, the test is 99% accurate, and your result is positive.

Hints

Hard to decide? Open the hints one at a time: the easy one first, then stronger ones.

Next: the solution

Next comes the explanation, with spoilers

The next rounds show the chance that you are ill: a thousand people, 100,000 tests and the explanation. Answer round 1 first, or go on?

You chose to always show all rounds.

Round 2 · A crowd of 1,000

Test 1,000 people and see who the positives really are

Each cell is a person. Change the share of sick people and the test's accuracy, then pick random people who tested positive and see who they really are.

Positive results20
Of these, ill10
Ill among positives50%
ill, test + healthy, test + (false positive) ill, test − (false negative) healthy, test −

Test +Test −
Bayes' theorem for these settings 50%

Round 3 · Simulation

100,000 tests and a curve for any prevalence

The computer creates 100,000 people, each ill with the probability you set, and tests them all. The line is Bayes' theorem; the dots are the simulation. The horizontal axis is logarithmic, from 1 person in 10,000 to half the population.

Bayes' theorem simulation, 100,000 people per dot dashed: the sensitivity intuition reaches for
–
Bayes' theorem
–
Round 4 · Five explanations

Why an accurate test gives only 50%

The test answers "how likely is a positive result if a person is ill?". You want the reverse: "how likely am I to be ill if my result is positive?". These are different probabilities, and the base rate connects them.

In plain wordspictures, analogies, small numbers

“In plain words” is hidden on all puzzles.

Natural frequencies

Count people, not percentages

Ill people who test positive99of 100 ill
Healthy people who test positive99of 9,900 healthy

Take 10,000 people. 100 of them are ill, and the test finds 99. 9,900 are healthy, and 1% of them, 99 people, get a false positive. That's 198 positives in total, 99 of them ill. Exactly half.

The base rate

The rarer the disease, the more false alarms

The test is always the same here: 99% sensitivity and specificity.

Rigoroustables, charts, formulas

“Rigorous” is hidden on all puzzles.

Probability tree

Two branches, the same number of positives

1%99% 99%1% 1%99% 10,000 people 100 ill 9,900 healthy 99 + 1 − 99 + 9,801 − Positives: 99 + 99 = 198 ill among them 99 / 198 = 50%

The left branch is thin, since only 1% are ill, but the test almost always fires on it. The right branch is thick, since 99% are healthy, and even a rare error there yields as many positives.

Bayes' theorem

The formula behind it all

: the probability of disease given a positive test. The denominator is the share of all positive results.

P(S|+)=P(+|S)·P(S)P(+|S)·P(S)+P(+|H)·P(H)

Sensitivity and specificity 99%, 1% are ill.

=0.99·0.010.99·0.01+0.01·0.99 =0.00990.0198=50%

A second positive test: the previous answer, 50%, becomes the new base rate.

2 positive tests:0.99·0.50.99·0.5+0.01·0.5=99%

A rare disease: 1 ill person in 10,000.

1 ill in 10,000: 0.99·0.00010.99·0.0001+0.01·0.9999≈0.98%

S means sick, H means healthy. P(+ | S) is the test's sensitivity, P(+ | H) is 1 minus the specificity, and P(S) is the base rate. The denominator is the share of all positive results. When the disease is rare, the second term, the false positives, dominates it. For a second test, the previous answer, 50%, becomes the new base rate.

Deepergeneralisations, theory, history

“Deeper” is hidden on all puzzles.

Odds and the likelihood ratio

A positive test multiplies the odds by 99

The odds of disease before the test: 1 ill person for every 99 healthy ones.

prior odds=1:99

How many times more likely a positive result is in an ill person than in a healthy one.

likelihood ratio=99%1%=99

A positive test multiplies the odds by 99.

posterior odds=1·99:99 =1:1→50%

A second positive test multiplies the odds by 99 once more.

after a second test=1·99:1 =99:1→99%

A positive result is 99 times more likely in an ill person than in a healthy one. So it multiplies the odds of disease by 99. But the starting odds were 1 to 99, and multiplying by 99 gives just 1 to 1. If 1 person in 10,000 has the disease, odds of 1 : 9,999 become 99 : 9,999, roughly 1 : 101.

Round 5 · Going further

Retests, rare diseases, spam and fraud

The answer depends on the probability you start from. A second test, symptoms or a very rare disease change it many times over. The same maths applies to spam filters and to systems that flag fraudulent payments.

Pick a scenario

Base rate
After 1 positive
After 2 positives

The scenario numbers are illustrative. They show the shape of the problem, not the accuracy of any real test.

Each positive result multiplies the odds

The bars show the probability after 0 to 4 positive results in a row, assuming the tests err independently. Repeating the same kind of test often breaks that assumption, which is why confirmation usually uses a different method.

Check it with a simulation

A test with 99% sensitivity and specificity. Press "Check": a simulation of 2,000,000 people counts the share who are ill among those with the given results.

SituationChance of illness

The accuracy paradox: a model that does nothing

The same rarity breaks the very measure called "accuracy". Take 10,000 transactions, 100 of them fraudulent. A model that never blocks anyone is right in 9,900 cases out of 10,000. A real filter that catches 90% of fraud and wrongly blocks 5% of honest customers errs more often.

ModelAccuracyCaughtFalse alarms
"Always no"99.0%00
A real filter95.0%90495

Accuracy merges two different errors into one number: the false alarm (a type I error) and the miss (a type II error). For rare events you need to see them separately and pick the model's threshold by the cost of each. How a threshold trades one error for the other is shown in the chapter "The model is 99% accurate" of the course How not to fool yourself with data.

Real data

Real tests: can you trust a positive result?

The 1% and 99% in the puzzle are illustrative. Here is the accuracy of real tests from published studies. Pick a test and the share who are ill among people like you, and see what your result means.

Try it on yourself

Test "+": you are really ill
Test "−": yet you are ill

How accurate real tests are

TestSensitivitySpecificity

In 2007, 160 gynaecologists were given the mammography problem with these numbers: 1% ill, 90% sensitivity, 9% false positives. Most answered that a woman with a positive result had a 90% or 81% chance of cancer. Only 21% chose the best answer, "about 1 in 10". After training in natural frequencies, 87% chose it.

Sources: Gigerenzer et al., «Helping Doctors and Patients Make Sense of Health Statistics», Psychological Science in the Public Interest, 2007; Dinnes et al., Cochrane Review «Rapid, point-of-care antigen tests for diagnosis of SARS-CoV-2 infection», 2022.

Bonus · At work

Where this shows up at work

Real situations from marketing, analytics, product and business where the same maths applies. Only known data, research and plain calculations you can check.

Product analytics

How many A/B test "wins" are false

The situation
A significant test result is a positive test, and the "base rate" is the share of ideas that really work. Ronny Kohavi, who ran experimentation at Microsoft and Airbnb, gives these shares of successful ideas: about a third at Microsoft, about 15% at Bing, 8% at Airbnb.
The trap
With typical settings (5% significance, 80% power) one "win" in seventeen is false when a third of ideas work, one in seven at 15%, and one in four at 8%. The more mature the product and the rarer working ideas are, the larger the share of false wins, even with the same significance threshold.
How to plan for it
Estimate your team's share of successful ideas and compute the share of false wins from it. For big decisions and surprisingly large lifts, run a repeat test or use a stricter threshold.

Source: Kohavi, Deng, Vermeer, "A/B Testing Intuition Busters", KDD 2022; Kohavi, Tang, Xu, "Trustworthy Online Controlled Experiments", 2020.

Analytics

Alerts nobody trusts any more

The situation
A system checks 200 metrics for anomalies every day. The threshold fires on normal data only 1% of the time and catches a real problem 90% of the time. There are about two real incidents a month.
The trap
In a month that's 60 false alarms and 1.8 real ones: only 3% of alerts are real. The team learns to ignore alerts, and the real incident drowns among false ones. "99% accurate" says nothing until you know how rare problems are.
How to plan for it
Measure not the detector's accuracy but the share of real ones among its alarms. Fewer alerted metrics, a stricter threshold for minor ones and requiring an anomaly to persist over several checks all raise that share.
Bonus · Fun facts

Things to tell your friends

95%

The Harvard question for doctors

In 1978 Casscells, Schoenberger and Graboys put this question to 60 students and doctors at Harvard Medical School: a disease affects 1 person in 1,000, and the test has a 5% false positive rate. What is the chance that a person who tests positive is ill? The most common answer was 95%. Fewer than one in five gave the right answer, about 2%.

99 of 100

Natural frequencies help

The psychologist Gerd Gigerenzer showed that people, doctors included, get the answer right far more often when the same problem is stated in counts of people ("99 of 100 ill people") instead of percentages and conditional probabilities. That's why round 2 shows a crowd, not a formula.

1 : 73 m

The Sally Clark case

In 1999 in the UK, Sally Clark was convicted over the deaths of her two baby sons. A paediatrician told the court that the chance of two sudden infant deaths in one family was 1 in 73 million. The figure came from squaring the chance of one such death, as if the two deaths were independent. On top of that, the rarity of the event was confused with the probability of innocence. This is the prosecutor's fallacy, a close relative of the base rate fallacy. The conviction was overturned in 2003.

1763

An essay published after his death

The English minister and mathematician Thomas Bayes died in 1761. His friend Richard Price found his work on inverse probability among his papers and presented it to the Royal Society. The essay was published in 1763. Pierre-Simon Laplace later gave the formula its familiar form.

2002

Bayesian spam filters

In 2002 the programmer Paul Graham published the essay "A Plan for Spam", proposing to filter mail with Bayes' theorem: every word in a message shifts the chance that it's spam. The idea caught on quickly. A filter faces the same problem as a medical test: the result depends on what share of all mail is spam in the first place.

41%

The taxicab problem

Daniel Kahneman and Amos Tversky gave people this problem. In a city, 85% of cabs are green and 15% are blue. A witness to a night-time accident says the cab was blue, and he identifies colours correctly 80% of the time. The most common answer is that the cab is blue with probability 80%. The truth is about 41%: green cabs are so much more common that the witness mistakes a green cab more often than he correctly sees a blue one.

Thinking, Fast and Slow

Daniel Kahneman

2011 · chapter 16

How Not to Be Wrong

Jordan Ellenberg

2014 · chapter 10

The Drunkard's Walk

Leonard Mlodinow

2008 · chapter 6

All books →
Discussion

What do you think?

Share your own explanation, an objection or a variant of the puzzle. You need a GitHub account to comment.

Is “School maths” the right level for this puzzle?

Thank you! This helps set the levels right.

Newsletter

New puzzles, explanations and discussions

I keep adding new puzzles, new ways to explain them and write-ups of the discussions they start. Leave your email and I'll write when something new is out. No spam, one-click unsubscribe.

The sign-up form will appear here soon.