Thought Toys · Chance · 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

your turn — press Rain and watch π assemble itself out of falling matchsticks

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.) Counter-example, verified in node: the crossing chance is 2L/(πD), not the tempting L/D — at L=1, D=2 it is 0.318 (measured 0.315 over 2M throws), not 0.5.

Also in Chance: The walk that always comes home →

All 16 in Chance
  1. 05The Galton board
  2. 06The Monty Hall problem
  3. 115Play the best machine and you never find the best machine
  4. 119A bet worth infinity that nobody will pay $20 for
  5. 124Shuffle seven times and stop
  6. 13Buffon's needle — you are here
  7. 130The walk that always comes home
  8. 14The central limit theorem
  9. 30Markov chains
  10. 31Averages that never settle
  11. 35The birthday paradox
  12. 38The drunkard's walk
  13. 42The coupon collector's problem
  14. 52Genetic drift
  15. 63The gaps are chaos. The count is law.
  16. 76Every bet here has an edge. Some sizes still go broke.

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