Mathematics & statistics

Bayes' theorem

Thomas Bayes (c. 1701–1761) First published 1763

How much evidence should change your mind depends on how likely the idea was to begin with.

The idea

Bayes' theorem is the maths of updating beliefs. It tells you how likely something is after you see new evidence, combining what you believed before (the prior) with how strongly the evidence points one way (the likelihood). In symbols: P(A | B) = P(B | A) × P(A) / P(B).

It is named after Thomas Bayes, an English minister and amateur mathematician. His essay on the idea was found after his death and published in 1763 by his friend Richard Price. The French mathematician Pierre-Simon Laplace independently developed it into the general tool used today.

The classic example is a medical test. Suppose 1% of people have a disease, the test catches 90% of real cases, and it wrongly flags 9% of healthy people. If you test positive, what are the chances you're sick? Many people, doctors included, mistake it for the 90%. The answer is about 9%. Out of 1,000 people, 10 are sick and 9 of them test positive, but about 89 of the 990 healthy people test positive too. So only 9 of roughly 98 positives are real.

Bayes' theorem runs spam filters and helps doctors read test results. Search teams have used it to find lost ships and aircraft. Its main limit is the prior: if your starting belief is badly off, even correct maths can give a misleading answer.

Try it yourself

Try this: Set prevalence to 1%. How worried should a positive result make you? Now set it to 30%.