applets.

Blocks Count Pi

← All apps

About Blocks Count Pi

A small glider sits still on a perfectly smooth track, between a buffer at the end and a big glider sliding towards it. Every collision is perfectly elastic: no energy is lost and there is no friction. Count every clack, glider on glider and small glider on buffer. If the big glider has the same mass, there are 3 clacks. 100 times heavier: 31. 10,000 times: 314. A million times: 3,141. Each time the mass goes up a hundredfold, the count gains the next digit of pi, for every case anyone has worked out (WHY PI explains the one way it could fail).

THE CLACKS: pick how heavy the big glider is and press RUN. The page works out the exact moment of every collision in turn (an event-by-event simulation, not small time steps). Near the buffer the clacks come thousands of times faster than anyone could see, so with Slow down when the clacks bunch up ticked the clock slows so the whole bunch takes about 12 seconds, and says by how much. For the lighter big gliders you can follow single clacks; for the heaviest the counter still whirls through thousands a second, and single clacks are only visible near the start and end. The magnifier on the track shows the room the small glider has left between the buffer and the big glider, with the small glider as a red line (its own width left out). The table on the right was counted by the same simulation when the page loaded.

THE CIRCLE: the same run drawn as a picture of the two speeds. Across: the small glider's speed times the square root of its mass; up: the same for the big glider. Energy is then half the squared distance from the centre, so every state sits on one circle. A clack between the gliders keeps the momentum, which moves the point along a sloping line; a clack on the buffer flips the small glider's speed, which moves it straight across. STEP adds one clack at a time.

WHY PI: why the count is pi's digits, and where it could go wrong. Type how many digits you want; the page works it out with whole-number arithmetic to as many places as needed.

LIGHT: the gliders' two positions, scaled the same way, become a single point that moves in straight lines and bounces off two mirrors meeting at a small angle. The number of bounces is the number of clacks. Tick Unfold the mirrors to straighten the path.

THE STORY

The puzzle and its answer are Gregory Galperin's, published in 2003 in the journal Regular and Chaotic Dynamics as "Playing pool with π (the number π from a billiard point of view)". He used two billiard balls and a wall; the gliders here are the same thing. It became famous in January 2019 through Grant Sanderson's 3Blue1Brown videos, which call it the most elegant and the most comically inefficient way to work out pi: to get 10 digits you need a mass ratio of 1018 and 3,141,592,653 clacks.

The circle argument rests on a fact Euclid proved (Elements, Book III, Proposition 20): an angle at the edge of a circle is half the angle at the centre standing on the same arc. The page works out pi itself for WHY PI with John Machin's formula of 1706, π/4 = 4 arctan(1/5) − arctan(1/239), which he used to reach 100 decimal places.

HOW IT WORKS

Call the small glider's mass 1 and the big one's M, and the speeds v1 and v2. Put x = v1 and y = √M · v2. The energy is ½(x² + y²), so every state lies on one circle. Momentum, x + √M · y, is the same before and after a glider clack, so that clack moves the point along a line whose slope is −1/√M; a buffer clack turns x into −x. The angle between the two kinds of line is θ = arctan(1/√M). By Euclid's fact, every two clacks the point moves round the circle by 2θ, and it stops when there is no room left for another step: the small glider is still or moving away from the buffer, and the big glider is moving away at least as fast (with equal masses the small glider ends still). That gives the count: the largest whole number N with N × θ strictly less than π (180°). With equal masses θ is exactly 45°, four of them make exactly 180°, and the count is 3.

For M = 100n, θ = arctan(10−n), which is a hair less than 10−n. For n of 1 or more π ÷ θ is never a whole number (that would make θ an exact fraction of 180° with a tangent that is a fraction, and between 0° and 90° only 0° and 45° are both), so N is the whole part of π ÷ θ, which is just over π × 10n: usually the first n + 1 digits of pi. The difference is about π × 10−n ÷ 3, which only matters if pi has about n nines in a row straight after its nth decimal. That has never been proved impossible, but nobody expects it: the famous run of six 9s in pi starts at the 762nd decimal, and there it would have needed about 761.

The light picture: scale the positions the same way (x1, √M · x2) and the pair moves as one point at a steady speed, in straight lines. The buffer (x1 = 0) and the gliders touching (x1 = x2, the gliders' widths left out) are two straight walls meeting at the angle θ, and an elastic clack is a mirror bounce off one of them. Reflect the wedge instead of the path and the path becomes one straight line crossing copies of the wedge fanned round the corner, as many as fit in 180°.

SIMPLIFICATIONS

The gliders are perfectly rigid and the clacks perfectly elastic and instant; there is no friction, no air and no sound energy. No real pair of blocks could do it: at a mass ratio of 1010 the small glider here reaches 35 kilometres a second, squeezed into a gap of a few thousandths of a millimetre. Real air tracks lose a little energy at every bounce, so a real run gives fewer clacks. The simulation uses ordinary computer numbers (doubles); for the ratios it animates it agrees with the formula exactly. Heavier ratios on WHY PI come only from the formula.

FURTHER WATCHING AND READING

BIG GLIDER'S MASS (THE SMALL ONE IS 1 KG)

Clacks on the buffer
0
Glider on glider
0
Small glider
Big glider
Room for the small one
Clock

CLACKS, COUNTED BY THIS PAGE

Big gliderClacksYou