Bayes’ theorem

Bayes’ theorem tells you how to update a belief when new evidence arrives. You start with a prior probability that some hypothesis H is true. You observe evidence E. The posterior is:

The denominator is the total probability of seeing the evidence at all:

P(H) = 0.30P(¬H) = 0.70P(H∩E)P(¬H∩E)← E
Posterior P(H|E)
63.2%
was 30% prior
P(E) — base rate
38.0%
P(¬H|E)
36.8%
Area diagram: blue = P(H), red = P(¬H). Shaded = evidence E present. Posterior = .

Reading the area diagram

The rectangle represents the entire sample space. Width encodes the prior split: left = P(H), right = P(¬H). Height encodes the likelihoods: shaded top fraction of each column = probability of evidence E given that column’s hypothesis.

The posterior P(H|E) is the proportion of the total shaded area that falls in the left (H) column. Drag the sliders and watch the ratio shift.

What to notice

  • Strong evidence isn’t enough. Set P(H) very low (rare hypothesis) and P(E|¬H) only a little lower than P(E|H). Even 95% sensitivity gives a low posterior when prevalence is 1%. This is base rate neglect.
  • High specificity matters most for rare hypotheses. Reducing P(E|¬H) — the false positive rate — has the largest impact when P(H) is small, because most “positives” come from the large ¬H population.
  • The prior can be overwhelmed. With strong enough evidence (high P(E|H), low P(E|¬H)), the posterior approaches 1 regardless of the prior. Accumulate enough data and beliefs converge.