Bayes' Theorem Calculator: See the Evidence as 10,000 Dots
Why a positive result from a "90% accurate" test can still mean only a 1-in-10 chance – and how much a second, independent test really adds
Quick Answer:Bayes' theorem: P(H | E) = P(E | H) × P(H) ÷ P(E). For a test, the chance you have the condition after a positive result is true positives ÷ all positives. With a 1% base rate, 90% sensitivity and a 9% false-positive rate, 10,000 people give 90 true positives and 891 false alarms, so a positive means about 9%, not 90%. In odds form: posterior odds = prior odds × likelihood ratio (sensitivity ÷ false-positive rate).
--
Chance it's really true, given --
--
--
--
How belief moves
Odds form
--
The evidence
--
Slider is logarithmic: 0.01% → 100%.
Before reading the answer, guess the chance – most people guess far too high.
An educational model of how evidence works. It is not medical, legal or security advice: real tests have published accuracy for specific groups, and a professional interprets them with everything else they know.
Natural frequency tree
The same maths as counts of people – the format that makes Bayes easy.
Base rate decides · same test, different populations
--
Test 1 at a glance
Model assumptions – what this model leaves out
The base rate must fit the person. 1% of the general population is not the base rate for someone who already has symptoms, a family history or a reason to be tested – their prior can be far higher, and so is the answer.
Sensitivity and specificity are fixed and known. Real values come from studies with error bars and change with the group tested, the lab and the cut-off used.
Second tests make independent mistakes. Repeating the same test on the same sample, or a test that reacts to the same thing, tends to repeat its errors. Then a second positive adds much less than shown here.
Yes/no results only. Many tests give a number; a strongly positive value carries more evidence than a borderline one, which this two-outcome model ignores.
The dots are exact natural frequencies. Counts are rounded to whole people so they match the formula; real samples of 10,000 would scatter around these numbers.
Not advice. Scenario numbers are illustrative textbook values, not data for any real test, drug screen or scanner.
How the Bayes' Theorem Calculator – 10,000-Dot Evidence Sandbox works
Start with the base rate: how common the condition (or spam, fraud, threat) is in the group being tested, before any evidence. A test is described by its sensitivity (the share of true cases it flags) and its specificity (the share of non-cases it clears); one minus specificity is the false-positive rate.
Bayes' theorem turns these into the probability that a result is right. The page shows it three ways: as 10,000 dots (one per person, coloured by the truth and by whether their result matches yours), as a natural frequency tree with whole-number counts, and in odds form, where each piece of evidence multiplies the odds by its likelihood ratio.
A second test uses the first answer as its new base rate. That is only valid if the second test makes its own, independent mistakes; the dots model exactly that by giving every person an independent second draw within their true group.
P(H | +) = sens × p ÷ (sens × p + (1 − spec) × (1 − p))
Eddy's classic screening problem: 1% base rate, sensitivity 80%, false-positive rate 9.6% (specificity 90.4%), one positive result.
Of 10,000 people, 100 have the condition and 9,900 do not.
The test flags 80 of the 100 (true positives) and 9.6% of the 9,900 = 950 (false positives).
Chance that a positive is real = 80 ÷ (80 + 950) = 7.8%. In odds: 1 : 99 × LR+ 8.3 = 1 : 11.9.
A second, independent positive: 64 of the 80 and 91 of the 950 test positive again, so 64 ÷ 155 = 41%.
Result: One positive raises the chance from 1% to 7.8%; two independent positives raise it to 41% – most surveyed doctors guessed about 75% for the first step.
Assumptions and limits
The base rate must match the person: symptoms, risk factors or a referral raise it, sometimes a lot.
Sensitivity and specificity are treated as exact; real ones have uncertainty and depend on the group and cut-off.
Repeat tests often share errors (same sample, same cross-reaction), so a second positive usually adds less than the independent model shows.
Checked: Eddy 7.8%, Gigerenzer (1%, 90%, 9%) 9.2%, Casscells (1 in 1,000, 5% false positives) 1.96%; dot counts equal the formula exactly (80 / 950, then 64 / 91).
Educational only – not medical, legal or security advice.
Sources
Eddy DM. Probabilistic reasoning in clinical medicine: problems and opportunities. In: Judgment under Uncertainty. Cambridge University Press 1982
Why is a positive result from an accurate test often wrong?
Because the people who don't have the condition vastly outnumber those who do. With a 1% base rate, 10,000 people include 100 who have it and 9,900 who don't. A test that catches 90% and wrongly flags 9% gives 90 true positives but 891 false alarms, so only 90 of 981 positives (about 9%) actually have it. The rarer the condition, the more the false alarms dominate.
What is Bayes' theorem in simple terms?
It updates a belief with new evidence: the probability of a hypothesis after the evidence equals how well the hypothesis predicts the evidence, times how likely it was beforehand, divided by how likely the evidence is overall. P(H|E) = P(E|H) × P(H) ÷ P(E). In odds form: posterior odds = prior odds × likelihood ratio.
What is a likelihood ratio?
How many times more likely the evidence is if the hypothesis is true than if it is false. For a positive test LR+ = sensitivity ÷ (1 − specificity); for a negative test LR− = (1 − sensitivity) ÷ specificity. Multiply the prior odds by it to get the posterior odds. An LR+ above 10 or an LR− below 0.1 is usually considered strong evidence.
Does a second positive test double-check the first?
Only if the second test can make its own independent mistakes. Then the first result becomes the new prior and two positives multiply the likelihood ratios: with a 1% base rate, an 80%-sensitive test with a 9.6% false-positive rate gives 7.8% after one positive and 41% after two. Repeating the same test on the same sample often repeats the same error, so the real gain is smaller.