Beautiful Math
Path

Probability & information · Lesson 3

Conditional probability and Bayes

New information reshapes probability. Conditional probability and Bayes' rule are the mathematics of updating.

Core ~24 minDeep study ~72 minWhat does conditioned on mean?Why do false positives matter?

Before this: Chance and probability, Random variables and distributions

How this idea was born

New evidence arrives and beliefs should move. Without a disciplined way to update, base rates vanish and headlines lie. Medical tests, spam filters, and diagnostics all need the probability of a cause given a symptom, not only the probability of a symptom given a cause.
Thomas Bayes's essay on inverse probability was published posthumously; Pierre-Simon Laplace and others expanded the program. MacTutor sketches both careers. Steal the ethic: intellectual honesty about prior belief and evidence. Show how you update; do not pretend the data alone spoke with no assumptions.
This chapter is the mathematics of updating for a modern rereader: restrict attention to the world where evidence happened, then reweigh hypotheses. Posterior proportional to likelihood times prior is the heartbeat you will meet again in classifiers and uncertainty estimates.

First principles

Conditional probability of AA given BB (with P(B)>0P(B) > 0):
P(AB)=P(AB)P(B)P(A \mid B) = \frac{P(A \cap B)}{P(B)}
Restrict attention to the world where BB happened, then weigh AA inside that world.
Bayes' rule:
P(HE)=P(EH)P(H)P(E)P(H \mid E) = \frac{P(E \mid H) P(H)}{P(E)}
Posterior from likelihood times prior, normalized by evidence.
prior×likelihoodposterior
Bayes updates belief: start with a prior, multiply by how well the data fit, then renormalize.
Independence means P(AB)=P(A)P(A \mid B) = P(A) when defined: learning BB tells you nothing new about AA.

Worked intuition

P(diseasepositive test)P(\text{disease}\mid\text{positive test}) is not P(positive testdisease)P(\text{positive test}\mid\text{disease}). Clinics, spam filters, and courtroom rhetoric all trip on that swap.
Walk a rare-disease example slowly. Suppose a condition hits 1 in 1,000 people. A test is 99% sensitive and 99% specific in a simplified sketch. Among 100,000 people, about 100 are sick; the test catches about 99 of them. About 99,900 are healthy; about 999 false positives appear. Among positives, most are still healthy. Base rates matter. Intuition fails without Bayes. Always track the prior.
Email: P(spamwords)P(\text{spam}\mid\text{words}). Medicine: P(conditionmarker)P(\text{condition}\mid\text{marker}). Draw prior → likelihood → posterior until it feels inevitable.
Algebrica's Bayes theorem page is the structured companion.

Common confusions

Swapping conditionals. P(AB)P(A\mid B) and P(BA)P(B\mid A) answer different questions. Headlines that swap them manufacture panic or false comfort.
Ignoring base rates. A mostly-accurate test for a rare event can still yield many false alarms. Accuracy slogans without prevalence are incomplete.
"The data speak for themselves." Likelihoods need priors (explicit or smuggled) to become posteriors. Silent priors are still priors.
Independence as "unrelated forever." Independence is a modeling claim about information. Dependence can be weak or strong; zero mutual information is a special case, not the default.
Updating twice on the same evidence. Double-counting EE inflates posteriors. Evidence gets used once unless it is truly new.
Treating P(E)P(E) as optional. The normalizer matters. Proportional reasoning is fine mid-calculation; final probabilities need care.

History & stories

Thomas Bayes's essay on inverse probability was published posthumously, quiet and profound. Laplace and others expanded the program into a working method for updating beliefs with evidence. MacTutor's Bayes biography is the short reliable map.
The modern slogan is Bayesian updating; the human habit is older than the formula: revise when the world talks back. Steal the honesty about priors even when you use frequentist tools elsewhere.

Real world

Medical tests, spam filters, and diagnostics all need P(hypothesisevidence)P(\text{hypothesis}\mid\text{evidence}), not only P(evidencehypothesis)P(\text{evidence}\mid\text{hypothesis}). Legal rhetoric that cites test accuracy without base rates is a conditional-probability failure mode with human costs.
Weather forecasts and sensor fusion systems update continuously: yesterday's posterior becomes today's prior.

Open when you want the machine-learning connection. Skip freely.

Field notes, extra examples, and glossary live here when you want more than the core path.

Carry this forward

  • Conditioning updates the sample space; Bayes inverts likelihoods carefully.
  • Base rates are first-class citizens.
  • Next: averages of random outcomes (expectation) and loss as expected penalty.

Read more

Go deeper when curiosity hits - videos, essays, and primary trails.

Check your understanding

A short learning loop - try a few, learn from misses, mark complete when you have engaged. No timer, no scoreboard.

1.P(A|B) means…
2.P(A|B) vs P(B|A)…
3.Bayes updates…
4.Base rates matter because…
5.Strogatz vibe on conditioning…

Try at least 3 core prompts, or choose I'll return later.