Bayes' theorem (also known as Bayes' law or Bayes' rule) is a mathematical formula in probability theory that describes how to update the probability of a hypothesis based on new evidence. Named after the Reverend Thomas Bayes (1701–1761), the theorem provides a way to invert conditional probabilities, allowing the probability of a cause to be determined given its observed effect.
Mathematical Statement
The theorem is expressed as:
$$ P(A|B) = \frac{P(B|A) , P(A)}{P(B)} $$
where:
- $P(A|B)$ is the conditional probability of event $A$ occurring given that $B$ is true (the posterior probability).
- $P(B|A)$ is the conditional probability of event $B$ occurring given that $A$ is true (the likelihood).
- $P(A)$ and $P(B)$ are the probabilities of observing $A$ and $B$ independently (the prior probabilities or marginal probabilities).
The denominator $P(B)$ can be expanded using the law of total probability when events $A_i$ are mutually exclusive and exhaustive:
$$ P(A_i|B) = \frac{P(A_i) , P(B|A_i)}{\sum_j P(A_j) , P(B|A_j)} $$
History
Thomas Bayes, an English Presbyterian minister and mathematician, developed the theorem in the 18th century. His work, An Essay Towards Solving a Problem in the Doctrine of Chances, was published posthumously in 1763 by his friend Richard Price, who edited and presented the manuscript to the Royal Society. Independently, the French mathematician Pierre-Simon Laplace formulated the same relationship in 1774 and later generalized it in his Théorie analytique des probabilités (1812). Laplace is largely responsible for developing the Bayesian interpretation of probability.
The theorem was independently rediscovered and formalized by Sir Harold Jeffreys in the 20th century, who described it as "to the theory of probability what the Pythagorean theorem is to geometry."
Interpretations
Bayesian interpretation: Probability is treated as a degree of belief. Bayes' theorem provides a rational rule for updating beliefs in light of new evidence. The prior probability $P(A)$ represents the initial belief, and the posterior probability $P(A|B)$ represents the updated belief after accounting for evidence $B$.
Frequentist interpretation: Probability is treated as a long-run proportion of outcomes. Bayes' theorem describes the relationship between proportions of events in repeated experiments.
Key Applications
- Medical diagnosis: Calculating the probability that a patient has a disease given a positive test result, accounting for the disease prevalence and test accuracy. A classic example shows that even a 99% accurate test can yield a high rate of false positives when the disease is rare.
- Drug testing: Determining the likelihood that a person is a drug user given a positive test result, where the base rate of use is low.
- Bayesian inference: A broad approach to statistical inference where the theorem is used to update the probability distribution over model parameters as new data are observed.
- Machine learning and artificial intelligence: Used in Bayesian networks, spam filtering, and classification algorithms.
- Cryptanalysis: Alan Turing and his team at Bletchley Park applied Bayes' theorem during World War II to break the Enigma cipher and the Japanese naval code JN 25.
- Genetics: Estimating the probability that an individual carries a specific genotype or will develop a genetic disease.
- Evolutionary biology: Deducing phylogenetic trees that best explain observed genetic data.
- Recreational mathematics: Solving puzzles such as the Monty Hall problem, the Three Prisoners problem, and the Boy or Girl paradox.
Odds Form
Bayes' theorem can also be expressed in terms of odds:
$$ O(A|B) = O(A) \times \frac{P(B|A)}{P(B| eg A)} $$
where $O(A)$ is the prior odds of $A$ and the ratio $\frac{P(B|A)}{P(B| eg A)}$ is the Bayes factor (or likelihood ratio). This form states that the posterior odds equal the prior odds multiplied by the Bayes factor.
Generalizations
Bayes' theorem extends to continuous random variables via probability density functions, to three or more events through conditionalization, and to quantum mechanics where probability distributions are generalized to density matrices.