# Bayes' Theorem

**Type:** Theorem  
**Domain:** Probability & Statistics  
**Published:** 1763 (posthumous), Thomas Bayes  
**Codex URL:** /mathematics/probability-statistics/bayes-theorem/  
**Entry status:** Live — v1.0 (2026-05-27)

## Formula
P(A|B) = P(B|A)P(A)/P(B)

## Summary
Rule for updating beliefs given new evidence. Basis of medical diagnosis interpretation, spam filters, Bayesian statistics, Bayesian networks in AI.

## Worked example — medical testing
Disease prior P(D)=0.0001; test P(+|D)=0.99, P(+|not D)=0.01. Result: P(D|+)≈1%, NOT 99% — the base rate fallacy corrected.

## Bayesian vs frequentist statistics
Bayesian: probability = degree of belief, updated via Bayes. Frequentist: probability = long-run frequency. Both legitimate, actively used, ongoing methodological debate.

## Naive Bayes classifiers
ML technique assuming conditional independence of evidence — often works well despite the "naive" assumption being technically false.

## Bayesian networks
Judea Pearl (1980s) — graphical probability models. 2011 Turing Award. Foundation of modern probabilistic AI.

## Prosecutor's fallacy
Confusing P(evidence|innocent) with P(innocent|evidence) — serious real-world legal misapplication.

## Sources
### Tier 1
- Bayes, T. (1763). *Phil. Trans. Royal Society*, 53, 370-418.
- Gelman, A. et al. (2013). *Bayesian Data Analysis*. 3rd ed.
### Tier 2
- McGrayne, S.B. (2011). *The Theory That Would Not Die*.

---
*Mathematics Codex entry v1.0 — added 2026-05-27 — thecodex.expert/mathematics/*
