A belief is not a verdict — it is a number that moves when evidence arrives. Bayes' rule is the exact law of that motion: given how strongly the evidence points, and how rare the thing was before, it returns the only consistent updated probability. Down the center, data flows: the prior and the test go in, the rule updates, the posterior comes out. The blue team builds and defends it; the red team tries to break it.
source T. Bayes, An Essay towards solving a Problem in the Doctrine of Chances (Phil. Trans., 1763), communicated by R. Price — archive.org/details/philtrans09948070. Rendered, not quoted.
One law, no memory of past answers. For a disease D and a positive test +:
P(D|+) = sens·prior / ( sens·prior + (1−spec)·(1−prior) )
The numerator is the true positives; the denominator adds the false positives — everyone who tests positive at all. Live, for the current sliders:
The previous sphere, the Markov chain, runs probability forward: given the state, what is the chance of the evidence — P(+|D). Bayes turns the arrow around.
From the same two numbers he recovers P(D|+): the chance of the cause given the effect. That inversion — inference — is the update rule sitting under every learning system that ever fit a belief to data. Each sphere is the next one's premise.
The blue team's live check: recompute the posterior against the Bayes formula for the worked example and many random triples. If red tampers, this badge is where it shows.
The rule needs exactly three inputs, each a probability in [0,1]:
| symbol | meaning |
|---|---|
| prior · P(D) | how common the disease is before testing (the base rate) |
| sens · P(+|D) | sensitivity — a sick person tests positive |
| spec · P(−|¬D) | specificity — a healthy person tests negative |
Sensitivity and specificity describe the test; the prior describes the world. Miss the prior and the answer is undefined — that is what you feed the panel below.
Drag any slider — the posterior is computed from the rule on the spot, never looked up.
What the machine produces, proven: one consistent posterior for any (prior, sens, spec). The headline case — a 1% disease with a 99%-sensitive, 95%-specific test — returns 16.67%, exactly 1/6, not 99%. That is the base-rate effect: when the disease is rare, most positives are false positives, and an accurate test still leaves the odds long.
The blue team's witness (left) confirms this against the formula live; the red team (right) tries to make it wrong.
It also assumes the test's sens/spec are calibrated and that the case is drawn from the population those numbers were measured on. Screen a low-risk group with a test validated on the sick, and the real specificity — and every posterior — drifts. Bayes converts inputs faithfully; it cannot audit them.
"A 99% accurate test means a positive is 99% likely to be real." Cut. The base-rate fallacy. At a 1% prior the posterior is 16.67% — the engine computes it live.
"Sensitivity and specificity give you the answer." Cut. Without the prior the update is undefined; the panel will not run with two numbers.
"Bayes published his own theorem." Cut. Richard Price found the essay in Bayes' papers and read it to the Royal Society in 1763, two years after Bayes died.
The red team's move: drop the false-positive term (1−spec)·(1−prior) from the denominator, so every positive looks true and the posterior inflates toward 100%. The blue team's witness (window 7) is watching.
Delete the false positives and the worked example jumps from 16.67% to 100% — the witness recomputes, disagrees with the formula, and turns red. Nothing is faked; the attack is real and it is caught.