Visual walkthrough — Bayes' theorem and applications
This page is the visual companion to the parent note. It leans on one idea from 1.3.01-Conditional-probability-and-independence (what "given" means) and one from 1.3.02-Law-of-total-probability (splitting a total into pieces). We rebuild both from zero as we need them.
Step 1 — Draw the whole world as one square
WHAT. We start with everything that could possibly happen. Draw a square. Its total area is exactly , because the probability that something happens is certain, and certain means .
WHY a square of area 1? Probability is just "what fraction of the possibilities is this?" A fraction is an area compared to the whole. If the whole square is , then any region inside is automatically a probability — you never have to divide by anything to read it off. Area = probability. That is the whole trick.
PICTURE. The full cream square is "the world". We will keep slicing it.

Step 2 — Cut the square by : the prior
WHAT. Slice the square with a vertical line. Everything left of the line is (the fact is true); everything right is , read "not " (the fact is false).
WHY vertical, why now? We split by first because is our belief before any evidence — this is the prior. Its width is how much of the world takes up on its own.
- — width of the left strip. The two strips fill the whole square, so their areas must add to .
- — width of the right strip. Nothing is left over: every outcome is either or not.
PICTURE. Teal strip = , plum strip = . In the medical story is thin (disease is rare, ) — remember that thinness, it is the whole reason the final answer surprises people.

Step 3 — Inside each strip, how often does the evidence fire? The likelihood
WHAT. Now bring in the evidence . Inside the strip, shade the fraction where also happens. Do the same inside the strip. These shaded fractions are the likelihoods.
WHY inside each strip separately? Because the evidence behaves differently depending on whether is true. A test fires often on sick people and rarely on healthy people. "How often fires given we are inside strip " is exactly what means — the fraction of the strip that is shaded.
- — the fraction of the strip that is shaded. A ratio, so it lives between and .
- — the width of the strip (from Step 2).
- — " and together", read as the joint. Multiply fraction × width to get the actual area of the shaded block. This is the key move: area of a sub-block = its fraction of the strip, times the strip's size.
PICTURE. The dark teal block (top of the strip) is . The dark plum block (top of the strip) is — the false alarms.

Step 4 — Collect all the evidence: the law of total probability
WHAT. The evidence appears in two places: the shaded block inside , and the shaded block inside . Add them to get the total shaded area — the total chance of seeing at all.
WHY add these two and nothing else? Because and cover the whole square with no overlap. Any point where happens is either in or in — there is no third place. This is the law of total probability: split a total into non-overlapping cases and sum.
- First term — the teal block from Step 3: the times fires and is genuinely true.
- Second term — the plum block: the times fires while is false. These are the false alarms.
- — the two blocks stacked together: the evidence, the total area shaded anywhere.
PICTURE. We slide both shaded blocks side by side into one bar. That bar's length is .

Step 5 — The reversal: from to
WHAT. Here is the question Bayes actually answers. We saw the evidence — we are now standing inside the shaded region only. Of that shaded region, what fraction is the teal part (truly )? That fraction is the posterior, .
WHY is this the reversal? In Steps 3–4 we asked "given the strip, how much is shaded?" Now we ask the opposite: "given the shaded part, how much is the strip?" We flipped what is known and what is asked. Same two blocks — we just divide by the other total.
- Numerator — the teal true-positive block (Step 3).
- Denominator — the full shaded bar (Step 4): teal plus plum.
- The ratio — what fraction of "everyone who saw the evidence" is genuinely in .
This is Bayes' theorem. We never memorised it; we counted areas and divided.
PICTURE. We discard the unshaded square entirely (grey it out) and keep only the shaded bar. Bayes = teal length ÷ total bar length.

Step 6 — Watch the numbers: why a 95%-accurate test still says 16%
WHAT. Plug the medical story into the picture. Disease is rare: . Test fires on of sick people () and of healthy people ().
WHY does this feel wrong? Because the teal strip is tiny to start with. Even at hit-rate, is a sliver. But of the huge healthy population, , is a bigger sliver. The plum false-alarm block out-areas the teal true-positive block.
- — teal block, true positives.
- — plum block, false positives — five times larger.
- — teal share of the total: only about .
PICTURE. Draw the two blocks to scale. The plum false-alarm block visibly dwarfs the teal one — you see why the answer is , not .

Step 7 — Edge case: evidence that can never happen
WHAT. What if — the shaded bar has zero length? Then Bayes divides by zero and is undefined.
WHY is that the right behaviour? means the evidence never occurs. Asking "given something that never happens…" is a question with no meaning — there is nothing to zoom into. The formula refusing to answer is correct, not a bug. This is why the parent's definition demands .
PICTURE. The shaded bar collapses to a line of zero width. There is no region to take a fraction of.

Step 8 — Edge case: certain and impossible priors
WHAT. Two more corners.
- If (we were sure is impossible), the teal strip has zero width, teal block , so . No evidence can revive it.
- If (we were sure is certain), the plum strip vanishes, the shaded bar is all teal, so .
WHY does this matter? Bayes can only rescale a belief, never resurrect a or dethrone a . A prior of exactly or is a locked door — evidence cannot open it. This is a real modelling warning: never assign a hard to something you might later want to reconsider.
PICTURE. Left panel: -strip width → posterior pinned at . Right panel: -strip width → posterior pinned at .

The one-picture summary
Everything above collapses into a single frame: the unit square, sliced vertically by the prior, shaded by the likelihoods, then read sideways to give the posterior.

Recall Feynman retelling — say it in plain words
Draw a square; it's the whole world and its area is one. Cut it left/right: left is "the thing is true" (that width is the prior), right is "the thing is false". Inside each side, shade how often the evidence shows up — often on the true side, rarely on the false side (those shaded fractions are the likelihoods). Now real life happens: you see the evidence, so throw away everything unshaded and stand inside the shaded region only. Ask: of this shaded region, how much is the true side? That fraction is your updated belief, the posterior. That's the whole theorem — it's just "true-shaded ÷ all-shaded". And the famous shock (a 95%-accurate test giving 16%) is simply that the true side started as a sliver, so even a small slip on the enormous false side leaves more false-shading than true-shading. Watch the two edge doors too: if the evidence never happens the shaded bar has zero width and the question is meaningless; and if your prior was a hard 0 or 1, that side has zero or full width forever — no evidence can move it.
Recall
What is the area of the whole square, and why? ::: It is — the probability that something happens is certain, so every event's probability can be read directly as an area with no division. In the square picture, what is the prior ? ::: The width of the left strip (-true) before any evidence. What is the posterior geometrically? ::: The teal (true-and-shaded) block divided by the whole shaded bar. Why is the medical answer only 16%? ::: The disease strip is tiny, so false positives from the huge healthy strip out-area the true positives from the tiny sick strip. What happens to Bayes when ? ::: It is undefined — the shaded bar has zero width, so there is no region to take a fraction of. Can evidence move a prior of exactly or ? ::: No — those strips have zero or full width, so the posterior stays pinned at or .
Connections
- Bayes' theorem and applications — the parent note this page visualises
- 1.3.01-Conditional-probability-and-independence — "given " = zoom into the strip
- 1.3.02-Law-of-total-probability — stacking the teal and plum blocks into
- 2.1.05-Naive-Bayes-classifier — where this reversal becomes a classifier
- 4.2.03-Bayesian-inference — posterior-becomes-next-prior, repeated
- 3.4.01-Maximum-likelihood-estimation — the prior-free alternative
- 1.3.04-Random-variables-and-distributions — the same picture with continuous strips