Generator

Bayes' theorem as two rectangles

A generator in the probability library, called 12 times across 2 essays. Below: what it draws at its defaults 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.

At its defaults

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%.

show: "sweep"

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.

show: "monty"

Three doors, as areas. Staying wins 33.3% of the time and switching wins 66.7%, because the host's choice is constrained by what the host can see, so opening a door rules a region out without moving any boundary.

show: "monty-scale"

The same game, with more doors. With d doors the host opens all but two, and switching wins (d − 1)/d of the time. Three doors is the smallest game in which the effect exists at all, which is why it is the one that looks like a paradox.

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

Changing this generator changes every figure on this list. That is what makes the list worth publishing rather than keeping in a check script.

The whole library · What the figures prove