The collisions that count the digits of π
Assumes: Collisions are easier than forces, and momentum is the reason · The right angle a fast collision closes
In 2003 the Russian mathematician Gregory Galperin published a paper with the playful title Playing pool with π. It describes an experiment anyone could set up with two blocks on a frictionless floor and a wall. A light block rests between the wall and a heavy block; the heavy block slides towards it. Every collision is perfectly elastic — no energy is lost to heat or sound. The heavy block strikes the light one, which flies towards the wall, bounces back, strikes the heavy one again, and so on, until the heavy block has been turned round and both blocks are moving away from the wall, never to collide again.
Count the collisions. If the blocks have equal mass, there are three. If the heavy block is a hundred times heavier, there are 31. Ten thousand times, 314. A million times, 3141. A hundred million times, 31415. The number of collisions spells out π, one more digit for every factor of a hundred in the mass ratio. The figures below were made by simulating the collisions one at a time, with nothing but the elastic-collision formulas; π is not put in anywhere.
The bars are not fitted to π and π was not typed into the program that drew them. Each count is the number of times the program applied one of two rules — a block hits a block, or a block hits the wall — before the blocks parted for good. The rest of this essay is about why those two rules, applied tens of thousands of times, count out a number that every schoolchild meets as the ratio of a circle’s circumference to its diameter.
Thirty-one collisions, one by one
Collisions are easier than forces found that an elastic collision between two bodies is decided entirely by conservation of momentum and of kinetic energy, whatever the forces during the contact: two equations, two unknown final velocities, and a unique answer. A collision with an immovable wall is simpler still: the block’s velocity reverses. So the whole experiment is a sequence of two kinds of exact step, applied until neither block can reach the other or the wall.
The picture is a spacetime diagram, positions across and time upward. The heavy block, red, comes in from the right at a steady slant. Its first collision sends the light block, blue, off at nearly twice its speed — the result the kick a fast particle can give an electron worked out for a heavy body striking a light one at rest. The light block reaches the wall, reverses, and meets the heavy block again a little nearer the wall, taking a little more of its momentum. The collisions crowd together as the heavy block slows and the gap narrows, the light block shuttling faster and faster across a shrinking space. The heavy block stops a twentieth of the way from the wall and begins to move away; the light block, now moving fastest of all, keeps catching it and pushing it, and the pace slackens again. After thirty-one collisions the light block is moving away from the wall more slowly than the heavy one, and can never catch it.
Thirty-one is not π. But it is π times ten, rounded down, and the next case is π times a hundred.
Energy puts the velocities on a circle
The way in is to look at velocities rather than positions. Call the heavy block’s velocity and the light one’s , and their masses and . Every collision conserves the kinetic energy,
That is an ellipse in the plane. Stretch the axes — plot across and up — and it becomes a circle. Every state the system can ever reach lies on that circle; each collision moves the point from one place on it to another.
The two kinds of collision move the point in two fixed directions. A wall collision reverses and leaves alone, so the point jumps straight down or up, to the mirror point across the horizontal axis. A collision between the blocks conserves momentum, , which in the stretched coordinates is a straight line of slope ; the point jumps along that line to the other point where it meets the circle. So the history of the collisions is a zig-zag of chords across the circle, alternately vertical and steeply slanted, starting at the left of the circle — the heavy block moving towards the wall, the light one at rest — and working round to the right.
It ends when the point reaches a region from which no further collision is possible: both blocks moving away from the wall, with the light one slower than the heavy one, so that it cannot catch up. In the stretched coordinates that region is a thin wedge on the right of the circle, between the horizontal axis and the line along which the blocks would move at equal speeds.
Equal steps round the circle
The chords have a property that turns the counting into geometry. Every one of them has one of two fixed directions, so the angle between each chord and the next is the same throughout — the angle between the vertical and the slanted line. And an elementary theorem of circles says that an angle with its vertex on the circle subtends an arc of twice its size. Every pair of consecutive chords therefore carries the point round the circle by the same arc, twice the angle
between the momentum line and the vertical.
So the collisions are a rotation in disguise, advancing in equal steps of . Watched collision by collision, the heavy block’s velocity follows a cosine, falling smoothly through zero at the halfway point and rising again, and the light block’s scaled velocity follows the matching sine. The process stops when another step would carry the point past the end wedge — when the point has turned through a little less than half a circle. The number of steps of size , counting both kinds of collision, that fit into a half-turn is
For a mass ratio of , , and is very nearly — the arctangent of a small number is almost the number itself. So is very nearly , rounded down: 31, 314, 3141. The rounding is right as long as the small difference between and never pushes across an integer, which for the first many digits it does not.
The equal masses give three: , and three steps of 45° fit into 180° with room for no fourth. The heavy block strikes the light one and stops, handing over all its velocity as five balls and the law that does not choose found equal masses do; the light block bounces off the wall and strikes the now-stationary heavy block, handing all of it back; and the heavy block leaves.
A ball in a wedge
There is a second way to see the count, which turns the problem into optics.
Plot the two blocks’ positions, stretched by and , as a single point. The light block must stay between the wall and the heavy block, so the point is confined to a wedge, and in the stretched coordinates the wedge’s angle is exactly . Between collisions both blocks move steadily, so the point moves in a straight line; at a collision it bounces off a side of the wedge, and the stretching makes every bounce a mirror reflection, angle in equal to angle out. The two blocks are a single billiard ball in a wedge-shaped table.
A billiard path in a polygon can be straightened by reflecting the table instead of the ball, as the corner that sends light home does with two mirrors at right angles: each reflection of the path is replaced by a reflected copy of the table, and the ball goes on in a straight line through the copies. For a wedge, the copies fan out round the vertex, each of angle , and a straight line can cross only those fan lines that lie within a half-turn of one another — there are of them. The count is the same, from mirrors instead of a circle, and the two pictures are the same fact: the reflections in the velocity circle and the reflections in the wedge are the same pair of reflections, and two reflections in lines at an angle always make a rotation by .
Which conservation laws hold, and where
The argument used energy at every collision and momentum only at the collisions between the blocks, and the asymmetry matters. The conservation law a symmetry hands over traced each conservation law to a symmetry: energy is conserved because the laws do not change with time, momentum because they do not change from place to place. The wall breaks the second symmetry — it is at a definite place — so when a block strikes it, momentum is not conserved; the wall, anchored to the Earth, absorbs whatever momentum is needed to reverse the block. But the wall does not move, so it does no work, and energy is still conserved. That is why the wall collisions are pure reflections of the light block’s velocity: they flip the momentum and keep the energy.
The blocks between themselves keep both, because nothing outside them acts during their contact. Their centre of mass, which the point that keeps moving found gliding on unchanged through any internal collision, is untouched by the block-on-block collisions and kicked only by the wall. Over the whole sequence the wall hands the system a total momentum of twice the heavy block’s original momentum, very nearly — enough to reverse it — in fifteen kicks for a ratio of a hundred and over fifteen hundred for a million, while doing no work at all.
The collisions also speed up and slow down in a pattern worth noticing. Near the moment the heavy block stops, the light block crosses an ever-shorter gap at its greatest speed, and the time between collisions shrinks almost to nothing, as in the bounces that add up to a stop, where a ball losing a fixed fraction of its speed at each bounce makes infinitely many bounces in a finite time. Here the bounces do not lose energy, so they do not run on for ever: the heavy block turns, the gap widens again, and the collisions thin out and stop after a finite count.
Why the count grows as a square root
The number of collisions grows as , the square root of the mass ratio, and the square root has a physical reason. The heavy block has momentum to lose and then regain in the other direction, and the light block can carry at most about of momentum per round trip. But the light block’s speed is not limited to the heavy block’s: near the wall it shuttles back and forth at a speed of order , because by energy conservation it can hold a share of the kinetic energy comparable with the heavy block’s, which needs a speed larger by the square root of the mass ratio. So each round trip removes momentum , and reversing takes about of them.
That speed is also the reason the experiment cannot be done to many digits. To get twenty digits of π the mass ratio must be , and the light block must at its fastest move times faster than the heavy one. If the heavy block moves at a millimetre a second, the light one would need to move at metres a second — tens of millions of times the speed of light. Relativity, which the space that speeds live in found bending velocity space itself, caps the count long before. And no real collision is perfectly elastic: even the best steel balls lose a fraction of a per cent of their energy at each impact, as the bounce an elastic plate cannot give back found when some energy goes into vibrations that never return, and over thousands of collisions that loss would change the count completely.
So the blocks are not a way to compute π. They are a way to see that π is lurking in a problem that seems to have nothing circular in it, put there by the two conservation laws: the energy law makes a circle and the momentum law fixes the angle of the steps round it.
A search algorithm in disguise
In 2019 the physicist Adam Brown pointed out that the colliding blocks are mathematically identical to one of the best-known algorithms in quantum computing. Grover’s algorithm searches an unsorted list of entries for a marked one, and does it in about steps rather than the a classical search needs on average. Each step of the algorithm is a pair of reflections of the quantum state — one about the state representing the whole list, one about the state orthogonal to the marked entry — and the pair is a rotation by a small angle, , in a two-dimensional plane. The algorithm stops when the state has rotated through a quarter-turn onto the marked entry.
Two reflections making a small rotation, a square root of a large ratio setting the angle, and a count of steps fixed by how many fit into a fraction of a circle: it is the same mathematics as the blocks, with the mass ratio replaced by the size of the list and the half-turn by a quarter-turn. The quadratic speed-up of Grover’s search and the growth of the collision count are the same square root. Nothing quantum is needed to see it; two blocks and a wall do it with classical mechanics.
Perfect collisions in sixteen-figure arithmetic
The figures assume perfectly elastic collisions, a perfectly frictionless floor, an immovable wall, and blocks that are rigid and of negligible size, so that the collisions are instantaneous and never overlap. Any real version fails on every count. Friction slows both blocks between collisions and can stop the light one before it returns; inelastic collisions shrink the energy circle at every step, so the point spirals inward instead of stepping round; and blocks of finite size meet before their centres coincide, which shifts the timing without changing the velocities, so the count is unaffected but the spacetime diagram is not.
The simulations run in ordinary double-precision arithmetic, which holds sixteen significant figures. For mass ratios beyond about , the small velocity changes at each collision are lost in rounding, and a simulation can miscount; the counts drawn here stop at , where the arithmetic is safe. The count formula has a subtlety too: it counts correctly only if is not within rounding of an integer, which is true for the cases shown but has not been proved for every power of a hundred. Whether the rounding ever goes wrong — whether π’s digits ever conspire with the small difference between and — depends on how well π can be approximated by rational numbers, and is not known for all digits.
Still open: whether the digits always come out right
Galperin’s result holds for each mass ratio for which the arithmetic can be checked, and it is known to give the right digits as long as π does not have an unusually long run of nines in its decimal expansion at the wrong place: a run of nines would let the small correction tip the count across a digit boundary. Since nobody has proved that π’s digits never contain such a run at any particular place, nobody can prove that the blocks spell π correctly for every power of a hundred. The question is a statement about the statistics of the digits of π, which are believed to be normal — every string of digits appearing equally often — but which have never been proved so.
What the blocks show does not depend on that. Two conservation laws turn a collision into a reflection: energy makes the velocities live on a circle, momentum fixes the directions of the jumps, and successive reflections in two fixed lines make a rotation by twice the angle between them. Count the steps of that rotation that fit in half a turn and π comes out, one digit for every factor of a hundred in the mass of the heavy block.
Part 9 of 9
This essay is one argument about Momentum. The others:
The objects named here
The third axis, after the field and the reading path: the things themselves, and every essay that touches each one.
BilliardsConservation of energyConservation of momentumElastic collisionGrover searchInscribed anglePhase space
- The wall that moves while the ball is in flight conservation of energy, phase space