Colliding blocks compute π
A 1 kg block sits between a wall and a heavier block of mass M, which slides in at 1 m/s. Every collision is perfectly elastic and there is no friction. Count the collisions N: it grows like π√M, so N / √M → π. With M = 100, 10 000, 1 000 000 kg the count is 31, 314, 3141 — the digits of π.
The energy circle
Axes are x = √m·v (1 kg block) and y = √M·V (heavy block). Kinetic energy ½mv² + ½MV² is fixed, so the state always sits on a circle. Each block–block hit moves along a momentum line; each wall hit flips x. Every step turns by the same angle 2θ with θ = arctan√(m/M) — so the number of steps that fit in the half-turn is about π/θ ≈ π√M. Bigger M → smaller steps → the zig-zag traces the circle ever more finely.
N / √M approaches π
Collision count divided by √M for masses from 1 kg to 10⁶ kg (log scale). The dashed line is π; the ring marks the current M. Hover for values.
Why does π appear?
Write the velocities as x = √m·v and y = √M·V. Then energy conservation, ½mv² + ½MV² = E, says x² + y² = 2E — a circle. Momentum conservation, mv + MV = const, is a straight line with slope −√(m/M) in these axes. A block–block collision jumps between the two points where that line meets the circle; a wall bounce reverses v, flipping the point to the other side of the y-axis.
Each such pair of jumps advances the state around the circle by an angle 2θ, where tan θ = √(m/M). The collisions stop once the heavy block moves away faster than the light one can follow, after sweeping out about π radians. So N ≈ π/θ, and for large M, θ ≈ √(m/M), giving N ≈ π√(M/m). With M/m = 100ⁿ, N gives the first n+1 digits of π.
This puzzle was published by Gregory Galperin in 2003 and made famous by 3Blue1Brown.