Bayes' theorem is the rule for updating a belief when new evidence arrives. Its most famous lesson is deeply counter-intuitive: a positive result from an accurate medical test can still mean you very probably don't have the disease โ if the disease is rare. The trick is to stop thinking in percentages and start counting people. Drag the sliders below and watch a population of 10,000 sort itself into the four outcomes.
Imagine testing 10,000 people. The prevalence sets how many truly have the disease; the sensitivity is how often the test catches a real case; the false-positive rate is how often it cries wolf on a healthy person. Each dot is a person โ coloured by which of the four outcomes they land in.
| Test positive | Test negative | Row total | |
|---|---|---|---|
| Has disease | โ true positive |
โ false negative |
โ |
| Healthy | โ false positive |
โ true negative |
โ |
| Column total | โ | โ | 10,000 |
Probabilities like "1% prevalence, 99% sensitive, 5% false positives" make this hard to feel. The exact same facts told as counts of people make the answer almost obvious โ that's why doctors who hear the story in frequencies get it right far more often.
And here is Bayes' theorem itself, with your current numbers substituted in. The numerator is the true positives; the denominator is everyone who tests positive.
Three ideas are doing all the work:
You start with a prior (the base rate โ how common the disease is before any test). The test supplies a likelihood (how probable this result is if you're sick vs. if you're not). Multiply prior by likelihood, then divide by the total probability of seeing that result. The output is the posterior โ your updated belief.
The intuitive mistake is to read "99% sensitive" as "99% chance I'm sick." But that ignores the prior. When the disease is rare, the healthy majority is so large that even a small false-positive rate produces more false alarms than there are true cases โ so most positives are false. Slide the prevalence toward 0 and watch the posterior collapse, even with a near-perfect test.
A positive result always moves your belief in the right direction โ the posterior is higher than the prior. But a single test rarely confirms a rare disease; it just makes it worth a second, independent test. Feed that second positive back in as a new prior and the probability climbs fast. Evidence accumulates; one data point seldom settles the question.