Generator

Bayes' theorem as two rectangles

A generator in the probability library, called 36 times across 6 essays. Below: what it draws with nothing chosen and at each mode an essay asks for, what it checks while drawing, and everywhere it is used.

bayes is one function. Everything below came out of it during this build, at parameters taken from the essays rather than invented for this page — so a figure here is the same figure a reader meets in an essay, and if the generator changes, this page changes with it.

With nothing chosen

Bayes' theorem as two rectangles. A unit square split by how common the condition is (1.0%) and then by how the test behaves. Of everyone who tests positive, the fraction who have it is 16.7%.

The same test, at every base rate

The same test, at every base rate. A test with 99% sensitivity and 95% specificity, applied to populations in which the condition is more or less common. The chance that a positive result is real is a property of the population as much as of the test.

Evidence as steps on a scale of decibans

Evidence as steps on a scale of decibans. A horizontal decibel scale of odds with a starting dot at the prior and one arrow per piece of evidence, ending at a posterior probability of 44.2%.

What a positive and a negative are each worth

What a positive and a negative are each worth. Horizontal bars for five tests, the weight of a positive result to the right of zero and of a negative to the left, in decibans.

Six orders of the same evidence

Six orders of the same evidence. Six piecewise-linear paths of log-odds against the number of pieces of evidence seen, one for each order of three tests, all ending at the same value.

Two positive tests whose errors are shared

Two positive tests whose errors are shared. Posterior probability after two positive tests against the share of false positives the tests have in common: the naive product stays at 76.6%, the true value falls to 14.1%.

What it checks while it draws

Collected by running the family and recording what it asserted, not written here. The count is how many separate times the claim was put to the test while these drawings were made.

Where it is called

Every figure on this list is drawn by the same rule, so a change to the rule changes all of them at once. That is why the list is published.

Probability

Bayes' theorem is a picture of a square

A test that is 99% accurate returns a positive result. The chance it is right can easily be under one in five, and the reason is visible the moment the population is drawn as a square rather than described as a formula.

Probability

Evidence measured in decibans

Write a probability as odds and take the logarithm, and every piece of evidence becomes a length. A positive result on a good test is thirteen decibans; a negative one is minus twenty. Lay the lengths end to end from the prior and the posterior is where they stop, in any order. The rule fails in exactly one way — when two pieces of evidence share a cause — and Turing built a code-breaking method on the arithmetic.

Probability

One coin, counted by runs and by wakings

Beauty is put to sleep and a fair coin is tossed. Heads, she is woken once; tails, twice, with the first waking erased from her memory. Each time she wakes she is asked how likely heads is. One half, say some; one third, say others; and unlike every earlier puzzle of this kind, stating the protocol exactly does not end the argument.

Probability

The door that was not opened

Three doors, one prize, a host who opens a losing door and offers a swap. Switching wins two times in three, and the reason is not about doors — it is about what the host was allowed to do.

Probability

The envelope that always looks better

Two envelopes, one holding twice as much as the other. Open one, see an amount, and reason that the other holds double or half with equal chance — so switching gains a quarter on average. By symmetry the same argument says switch back. The step that fails is not the arithmetic; it is the claim that double and half are equally likely whatever amount is seen, which no honest prior allows — and there is one prior under which the other envelope really does look better at every amount.

Probability

Two children and the sentence about one of them

A family has two children and at least one is a boy. The chance that both are boys is one in three — or one in two, or anything from one in three to certainty — and every one of those answers is right for some way the sentence could have come to be said. There is no host and no door, and the protocol is still the whole problem.

The whole library · What the figures prove