Bayes' Theorem
A test is 99% accurate and you test positive. Are you 99% likely to be ill? Almost certainly not — and this grid of 10,000 people shows exactly why.
A test is 99% accurate and you test positive. Are you 99% likely to be ill? Almost certainly not — and this grid of 10,000 people shows exactly why.
How to update a belief when evidence arrives — and why "99% accurate" is not what you think.
Bayes' theorem takes a prior belief and revises it in light of new evidence. It is the mathematics of changing your mind correctly.
The whole difficulty is that P(+ | D) and P(D | +) are different questions:
They can differ enormously. Swapping them is called the base rate fallacy, and studies repeatedly find that most doctors get this exact question wrong.
The grid shows 10,000 people, one square each. With a 1% base rate and a 99% accurate test:
A coin flip — from a test that is genuinely 99% accurate. The reason is simply that there are so many more healthy people that even a tiny error rate applied to them produces as many false alarms as there are true cases. Presenting the problem as counts instead of percentages makes this obvious, which is why this format is called natural frequencies.
Drag the base rate slider from 0.1% upward and watch the answer climb. The test never changed — only how common the condition is. This is why:
Bayes underpins the Naive Bayes classifier, which asks P(class | features) by flipping it into P(features | class) × P(class). The same asymmetry explains why a fraud detector with excellent accuracy still drowns analysts in false alarms — fraud is rare, so the base rate works against you. It is also why accuracy is a poor metric on imbalanced data, and why precision and recall exist.
Evidence updates a prior; it does not replace it. When a condition is rare, even an excellent test produces mostly false positives, because the healthy majority is so much larger. Always ask how common the thing was before the evidence arrived.
A test is 99% accurate and you test positive. Are you 99% likely to be ill? Almost certainly not — and this grid of 10,000 people shows exactly why.