Thought Toys · Exhibit 13

Buffon's needle

Here is the strangest way to measure π ever devised. Rule a floor with evenly spaced lines. Toss matchsticks onto it at random. Count what fraction land touching a line. Flip that fraction, scale it, and out falls 3.14159… — the circle constant, conjured from scattered sticks, with not a single circle anywhere in sight.

Sticks crossing a line glow amber; the rest stay grey

π ≈

Drop some needles to begin.

The running estimate closing in on π as the sticks pile up

What you're seeing

Each stick lands at a random spot and a random tilt. Whether it crosses a line depends only on two things: how far its centre sits from the nearest line, and how steeply it's angled. A stick lying flat between two lines almost never reaches one; a stick standing more upright easily bridges the gap. Average over every possible position and angle and the chance of a crossing works out to a clean formula — and the only odd ingredient in it is π, which sneaks in because we averaged over all those angles (and angles live on circles).

So you can run the formula backwards. You don't know π, but you can count: drop a pile of sticks, tally the crossings, and the crossing fraction is your measured stand-in for that probability. Rearranged, it spits out an estimate of π. Press Rain and watch the number below twitch wildly at first — a handful of sticks is noisy — then steady and crawl toward 3.14159 as the count climbs into the thousands. The lower chart is that convergence: jittery on the left, hugging the π line on the right.

It's a perfect little parable of Monte Carlo estimation: when a quantity is hard to calculate but easy to sample, you can just take random draws and let the law of large numbers grind out the answer. People estimated π this way by hand, throwing needles for hours, long before computers. Slide the needle length and the crossing rate changes — but the formula corrects for it, and π comes out all the same.

The rule, exactly. Lines spaced D apart; needles of length L ≤ D. A needle crosses a line exactly when the distance from its centre to the nearest line is at most (L/2)·|sin θ| for its angle θ. Averaging over a uniform centre and a uniform angle gives crossing probability P = 2L ⁄ (πD). Measure that probability as crossings ⁄ throws and solve for π: π ≈ 2 · L · (throws) ⁄ (D · crossings). Error shrinks like 1/√(throws). (Checked offline before shipping: two-million-throw simulations land on 3.141–3.142 across several L/D ratios.)

← Back to the cabinet  ·  Thought Toys — Exhibit 13.