History of Math

Bayes’ Billiard Table

Thomas Bayes’ 1763 Essay analyzed an unknown position on a table from the observed left/right outcomes of later throws. This demo throws colored balls, counts the outcomes, and shows prior, likelihood, and posterior on a discrete grid, with a live histogram and the posterior mean.

7 minLevel 3/3The interactive stage stays ad-free.
Throws6Left6Right0Posterior mean0.875MAP0.992True p0.62
true positionposterior mean 0.87500.250.50.751density of belief about the white ball’s positionpriorlikelihood p^k (1−p)^mposteriorposition p of the white ball

posterior(p) ∝ prior(p) · p^6 (1−p)^0 · 95% interval [0.59, 0.99] · mean 0.875

Prioruniform on [0, 1]
Data6 left, 0 right of the white ball
Posteriormean 0.875, MAP 0.992
Bayes’ Essay, 1763Thomas Bayes studied how to infer an unknown probability from repeated successes and failures. His essay, published by Richard Price two years after Bayes died, analyzed a tabletop experiment: a white ball is thrown on a table, then other balls are thrown, and their positions relative to the white one are recorded. The unknown position of the white ball is the quantity to be inferred. Bayes derived how the observations should update belief about it. This is often called Bayes’ billiard, though Bayes framed it geometrically rather than as a literal billiard table.
From a table to a formulaBayes did not write the modern shorthand posterior ∝ likelihood × prior. That compact form, and its wide use for arbitrary parameters, came later, especially through Pierre-Simon Laplace. What Bayes supplied was the core reasoning: a prior distribution over an unknown quantity, combined with the probability of the observed data under each possible value, yields an updated distribution. Here the math is exact on a discrete grid: with a uniform prior, the posterior after k lefts and m rights is a Beta(k+1, m+1) distribution, and the numbers shown are computed directly from the grid.

Throw colored balls, then drag the white ball’s true position. Each throw is either to the left of the white ball (probability p) or to the right (probability 1 − p). The likelihood curve shows how well each possible p explains the counts; multiplying it by the prior gives the posterior. With more throws the posterior tightens around the truth, and the MAP estimate sits about 0.37 away from the real position here.

What you are seeing

1

A white ball sits at an unknown position p between 0 and 1. Each later ball lands left of it with probability p and right with probability 1 − p.

2

After k lefts and m rights, the likelihood of the data at position p is p^k (1 − p)^m. Multiplying by the prior gives a posterior proportional to prior × likelihood.

3

With a uniform prior the posterior is a Beta(k+1, m+1) distribution. The histogram, mean, and 95% interval all come from a discrete grid, so the numbers stay exact for the model shown.

Why it matters

Bayes’ reasoning became the foundation of Bayesian statistics. The same prior–likelihood–posterior pattern drives spam filters, medical testing, machine learning, and decision-making under uncertainty.

Complexity & details

On a grid of B positions, each update costs O(B). With k lefts and m rights the direct computation is O(B) per position, and drawing the histogram is O(B).

Frequently asked questions

Did Bayes write the modern formula?+

No. Bayes worked through a geometric tabletop example and did not use the compact posterior ∝ likelihood × prior notation. That shorthand and its general use came later, especially through Laplace.

Why use a discrete grid instead of a formula?+

A grid makes each number directly checkable and avoids hiding the assumptions inside closed-form algebra. Here it also reproduces the exact Beta(k+1, m+1) posterior, so correctness can be verified both ways.