Level 0: Foundation
★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.Turning evidence around
A test for a rare illness catches 99% of sick people and wrongly flags only 5% of healthy people. You test positive. Are you probably sick? Most people say yes. But picture 1000 people where only 10 are sick. The test flags about 10 of the sick and about 50 of the 990 healthy. Of 60 positives, only 10 are sick, which is 1 in 6.
Bayes’ theorem is the rule that does this “turning around” correctly. How surprising the evidence is under each explanation, weighed by how common each explanation was to begin with (the base rate), gives the new probabilities.
A Mars rover deciding “is this a rock or a shadow?”, a robot working out where it is from a door it just saw, and a search team deciding which ocean square to search next all run Bayes’ theorem, many times a second.
- 1. 10 sick + 50 false alarms test positive. P(sick | +) ≈ ?
- 2. The 'base rate' is…
- 3. Bayes' theorem updates…
Level 1: Beginner
★★☆☆☆ Basic⏱ 15 minSecondary-school mathematics: arithmetic and elementary algebra.The formula
From :
| Term | Name | Meaning |
|---|---|---|
| prior | belief before the evidence | |
| likelihood | how well predicts | |
| evidence | normalizer (total probability) | |
| posterior | belief after the evidence |
The diagnostic test: .
Odds form: . The test’s likelihood ratio is . Prior odds of 1:99 become 19.8:99, which is about 1:5.
- 1. Prior 0.5, sensitivity = specificity = 0.9. P(D | +) = ?
- 2. Likelihood ratio of a 99%-sensitive, 95%-specific test?
- 3. Prior probability 0.2 as odds?
Level 2: Intermediate
★★★☆☆ Intermediate⏱ 40 minUndergraduate students and practising engineers.Recursive Bayes: today’s posterior is tomorrow’s prior
If pieces of evidence are conditionally independent given , updating one at a time gives the same answer as updating on all at once. The order doesn’t matter (Practice Code 4).
- Two independent positive tests take the disease probability from 1% to about 80%.
- In odds form, each piece of evidence multiplies by its likelihood ratio.
- In log-odds form, evidence adds. That’s why logistic regression’s logits are additive “evidence” (A3.3-4).
Monty Hall, by Bayes
You pick door 1 and the host, who knows where the car is, opens door 3 to show a goat. The likelihoods of “host opens 3” are: ½ if the car is behind 1, 1 if behind 2, and 0 if behind 3. With uniform priors the posterior is ⅓ for door 1 and ⅔ for door 2, so switch. The host’s action is evidence because it depends on where the car is.
The discrete Bayes filter
A robot in a corridor alternates two steps:
- sense: multiply its belief by the measurement likelihood, then normalize (Bayes);
- move: convolve its belief with the motion model (total probability).
From a uniform prior, a few door sightings concentrate the belief on the true position. This is Markov localization (Thrun, Burgard and Fox, 2005; Practice Code 5). Kalman filters (Gaussian beliefs) and particle filters (sampled beliefs) are the same recursion with different representations.
- 1. Prior 0.2 and likelihood ratio 4. Posterior = ?
- 2. In Monty Hall, switching wins with probability…
- 3. A Bayes filter's 'move' step uses…
Level 3: Advanced
★★★★☆ Advanced⏱ 40 minGraduate level, with full derivations and proofs.Derivation and the sequential identity
Bayes. Write both ways with the chain rule, then divide by . Expand by total probability. ∎
Sequential = batch. Suppose for each hypothesis. Then
So updating with from the posterior after gives the batch answer. ∎
Without conditional independence (two tests sharing the same error source), sequential multiplication double counts evidence and produces overconfident posteriors. The same thing happens in sensor fusion with correlated noise (A4.1-2).
What priors do
- A zero prior can never be revived. If , then for any evidence. That’s Cromwell’s rule: don’t assign 0 to anything you can’t rule out.
- With much data, the likelihood dominates and reasonable priors give similar posteriors. Formally, posterior concentration follows from the Bernstein–von Mises theorem (A4.3).
- With little data, priors matter, and that’s when Bayesian reasoning helps most: rare events, few experiments, expensive tests.
Bayes vs the Neyman–Pearson view
“P(evidence | innocent) is tiny, so they’re guilty” confuses with . That’s the prosecutor’s fallacy, which contributed to wrongful convictions such as R v. Clark (1999–2003). A p-value is a probability of data under a hypothesis, not of the hypothesis (C2).
Exercise 3.1: Use the odds form to find the likelihood ratio needed to move a 1% prior to 50%
The prior odds are and the target odds are 1. So the evidence must have . For example, two tests with LR each.
- 1. Sequential updating equals batch updating if the evidence is…
- 2. A prior of exactly 0 gives a posterior of…
- 3. The prosecutor's fallacy confuses…
Level 4: Expert
★★★★★ Expert⏱ 45 minResearchers: original papers and open problems.Bayesian search theory
To find a lost object, split the area into cells with prior probabilities (from drift models, last known position, expert scenarios) and detection probabilities (terrain, depth, sensor). Search the cell that maximizes . After an unsuccessful search of cell , Bayes gives
Failure is evidence. The method (Koopman, 1946; Stone, 1975) located the H-bomb lost off Palomares (1966) and the submarine USS Scorpion (1968). It guided the successful 2011 search for Air France 447’s wreckage after earlier searches failed (Stone et al., 2014). The US Coast Guard’s SAROPS system uses it today.
Bayes throughout robotics and AI
- State estimation. Kalman filters are exact Bayes for linear-Gaussian systems (Kalman, 1960). Particle filters handle anything (Gordon, Salmond and Smith, 1993). FastSLAM and factor-graph SLAM factorize the posterior over map and trajectory (Thrun et al., 2005; Dellaert and Kaess, 2017).
- Bayesian deep learning and active learning. Posterior uncertainty decides which experiment to run or which data to label next (Bayesian optimization, A6; MacKay, 1992). The same holds for which region a planetary rover should sample.
- Classification. Naïve Bayes multiplies per-feature likelihoods (conditional independence). Discriminative classifiers estimate posteriors directly, and calibration asks whether “80% confident” is right 80% of the time (Guo et al., 2017).
References
- T. Bayes (1763). “An essay towards solving a problem in the doctrine of chances.” Philosophical Transactions of the Royal Society, 53.
- P.-S. Laplace (1812). Théorie analytique des probabilités. Paris.
- S. Thrun, W. Burgard, D. Fox (2005). Probabilistic Robotics. MIT Press.
- B. O. Koopman (1946). Search and Screening. OEG Report 56, US Navy.
- L. Stone (1975). Theory of Optimal Search. Academic Press.
- L. Stone, C. Keller, T. Kratzke, J. Strumpfer (2014). “Search for the wreckage of Air France Flight AF 447.” Statistical Science, 29(1).
- N. Gordon, D. Salmond, A. Smith (1993). “Novel approach to nonlinear/non-Gaussian Bayesian state estimation.” IEE Proceedings F, 140(2).
- F. Dellaert, M. Kaess (2017). “Factor graphs for robot perception.” Foundations and Trends in Robotics, 6(1–2).
- G. Gigerenzer, U. Hoffrage (1995). “How to improve Bayesian reasoning without instruction: frequency formats.” Psychological Review, 102(4).
- C. Guo, G. Pleiss, Y. Sun, K. Weinberger (2017). “On calibration of modern neural networks.” ICML.