The Lab
Original — built for the Lab

Pi from Chaos

Four ways to find π, all converging on one chart. Needles that cross the gaps between floorboards, darts that land inside a circle and pairs of random whole numbers with no common factor all get there, slowly: each new correct digit costs a hundred times more throws. Two blocks clacking against a wall get there exactly — 314,159 collisions for the first six digits.

ProbabilityMonte CarloNumber theoryPhysicsCanvasSound
After Georges-Louis Leclerc, Comte de Buffon's needle problem (1777), Ernesto Cesàro's coprime probability (1881) and Gregory Galperin's colliding blocks (2003)
Loading demo…

In 1777 the naturalist Georges-Louis Leclerc, Comte de Buffon asked a gambler's question: drop a needle on a floor of parallel boards, what is the chance it lands across a gap? The answer has π in it. For a needle as long as a board is wide, it is 2/π, about 64 per cent. Turn that around and a floor, a box of needles and some patience become an instrument for measuring π. Darts thrown blindly at a square with a circle drawn inside do the same thing: the circle takes up π/4 of the square, so π is four times the share that land inside.

Stranger still, π hides in plain arithmetic. Pick two whole numbers at random. The chance they share no common factor is 6/π², a little under 61 per cent — a result that goes back to Dirichlet and was stated as a probability by Ernesto Cesàro in 1881. The orchard on this page is the picture of it: stand at a corner of a field with a tree on every whole-number point and look out. You can see a tree only if its two coordinates share no factor; every other tree hides exactly behind a nearer one. About 61 per cent of the orchard is in view, wherever you look.

The catch is speed. A random estimate improves with the square root of the number of throws, so ten times as many throws buys only half a digit more. A good day with Buffon's needle gets you 3.14; seven digits would take something like a thousand trillion needles. That is why Mario Lazzarini's 1901 report of 3.1415929 from just 3,408 needles is almost certainly not what it claims to be. His numbers make exactly 355/113, the famous approximation known since fifth-century China, and his throw count is a whole multiple of the 213 needles that fraction needs. Re-run his experiment honestly here and see how a well-chosen moment to stop does all the work.

Then there is the fourth way, which has no chance in it at all. Gregory Galperin noticed in 2003 that if a heavy block slides towards a light one resting by a wall, and every collision is perfectly elastic, the total number of clacks spells out π. Equal masses give 3; a ratio of 100 gives 31; a ratio of 10,000 gives 314; ten billion gives 314,159. The reason is geometry: written in the right coordinates the blocks' energy is a circle, every collision is a reflection, and counting reflections around a circle counts how many small angles fit into π. Grant Sanderson's 3Blue1Brown videos made it famous, and it is the clearest demonstration there is that π is about circles even when nothing in the room is round.

Next in the Lab
MafiaOpen

A parlour game of liars, simulated whole — watch the table argue itself to death, or take a seat at it.