Mechanics

The collisions that count the digits of π

Slide a heavy block towards a light one resting near a wall. The light block is batted between the heavy one and the wall until the heavy block turns round and leaves. Count the collisions. With equal masses there are 3; with one block a hundred times heavier, 31; ten thousand times, 314; a million, 3141. Nothing in two blocks and a wall mentions a circle, but conservation of energy puts their velocities on one, and each collision steps round it by the same small angle. The count is how many such steps fit in half a turn.

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 number of collisions for heavier and heavier blocks. The number of collisions, simulated one by one, for mass ratios of 1, 10², 10⁴, 10⁶, 10⁸, on a logarithmic axis: 3, 31, 314, 3141, 31415. Each factor of a hundred in the mass ratio adds one digit of π. Nothing in the setup mentions a circle — two blocks, a wall and the conservation of energy and momentum — but energy conservation makes the velocities live on a circle, and the count is how many equal steps of a small angle fit into half of it.
Fig. 1 The number of collisions, simulated one by one, for mass ratios of 1, 10², 10⁴, 10⁶ and 10⁸, on a logarithmic axis: 3, 31, 314, 3141, 31415. Each factor of a hundred in the mass ratio adds one digit of π.

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.

Two blocks and a wall, and the collisions between them. Position against time (upward) for a block 100 times heavier than a second block, sliding towards it at unit speed, with the light block at rest between it and a wall (left edge); every collision is perfectly elastic. The light block (blue) is batted back and forth between the heavy block (red) and the wall, faster and faster, as the heavy block slows; the heavy block gets no closer to the wall than 0.050 of its starting distance, stops, and is pushed away again. In all there are 31 collisions, 16 between the blocks and 15 with the wall, before both blocks are moving away from the wall with the light one slower — and 31 is the start of 3.14159….
Fig. 2 Position against time (upward) for a block 100 times heavier than a second, sliding towards it at unit speed, with the light block at rest between it and a wall (left). The light block is batted back and forth ever faster as the heavy one slows, stops at 5 per cent of its starting distance from the wall, and is pushed out again. 31 collisions: 16 between the blocks and 15 with 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 VV and the light one’s vv, and their masses MM and mm. Every collision conserves the kinetic energy,

12MV2+12mv2=constant.\tfrac12 MV^2 + \tfrac12 mv^2 = \text{constant}.

That is an ellipse in the (V,v)(V, v) plane. Stretch the axes — plot M V\sqrt{M}\,V across and m v\sqrt{m}\,v 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 collisions as a path round a circle. The two blocks' velocities plotted as one point, with the heavy block's velocity scaled by √M across and the light block's by √m up, so that the kinetic energy, which every elastic collision keeps, is the circle. A collision with the wall reverses the light block's velocity: the point jumps vertically. A collision between the blocks keeps their total momentum: the point jumps along a line of slope −√(M/m), here −10. The 31 chords zig-zag round the circle from the starting point at the left until the point lands in the narrow wedge where neither block can catch the other or the wall. Every chord joins two points of the circle, and consecutive chords meet at the same angle — so the path advances round the circle in equal steps.
Fig. 3 The two velocities as one point, scaled by M\sqrt{M} and m\sqrt{m} so that kinetic energy is a circle. A wall collision reverses the light block’s velocity: a vertical jump. A block collision keeps total momentum: a jump along a line of slope −M/m-\sqrt{M/m}, here −10. The 31 chords zig-zag from the start (red) at the left to the end (black), where neither block can catch the other or the wall.

The two kinds of collision move the point in two fixed directions. A wall collision reverses vv and leaves VV alone, so the point jumps straight down or up, to the mirror point across the horizontal axis. A collision between the blocks conserves momentum, MV+mvMV + mv, which in the stretched coordinates is a straight line of slope −M/m-\sqrt{M/m}; 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

θ=arctan⁡m/M\theta = \arctan\sqrt{m/M}

between the momentum line and the vertical.

A slow rotation hidden in the collisions. The heavy block's velocity (red) and the light block's scaled by √(m/M) (blue), after each of the 314 collisions for a mass ratio of 10 000, against the collision number. After each pair of collisions the velocity point has turned through 2θ round the energy circle, with θ = arctan √(m/M) = 0.01000 rad, so the heavy block's velocity falls as a cosine, through zero at about collision 157, and rises again to the other side. The process ends when another full step would carry the point past half a turn — after ⌊π/θ⌋ steps, 314.
Fig. 4 The heavy block’s velocity (red) and the light block’s scaled by m/M\sqrt{m/M} (blue) after each of the 314 collisions for a mass ratio of 10 000. Each pair of collisions turns the velocity point through 2θ, θ = 0.01000 rad, so the heavy block’s velocity falls as a cosine, through zero at collision 157, and rises again; it ends after ⌊π/θ⌋ = 314.

So the collisions are a rotation in disguise, advancing in equal steps of 2θ2\theta. 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 θ\theta, counting both kinds of collision, that fit into a half-turn is

N=⌈πθ⌉−1.N = \left\lceil \frac{\pi}{\theta} \right\rceil - 1.

For a mass ratio of 100k100^k, m/M=10−k\sqrt{m/M} = 10^{-k}, and θ\theta is very nearly 10−k10^{-k} — the arctangent of a small number is almost the number itself. So NN is very nearly π×10k\pi\times10^k, rounded down: 31, 314, 3141. The rounding is right as long as the small difference between θ\theta and arctan⁡θ\arctan\theta never pushes π/θ\pi/\theta across an integer, which for the first many digits it does not.

The equal masses give three: θ=45°\theta = 45°, 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.

The same count as a ball bouncing in a wedge. The two blocks are equivalent to a single ball bouncing inside a wedge whose angle is θ = arctan √(m/M); here the mass ratio is 15.2, so θ = 14.39°. Reflecting the wedge in its own sides over and over lays its copies out as a fan, and in that fan the ball's zig-zag path straightens into a single line. A straight line can cross at most the mirror lines that lie within half a turn of each other, and there are ⌊π/θ⌋ of them: 12 crossings here, the same 12 collisions the blocks make. The digits of π come from counting how many copies of a thin wedge fit into a straight angle.
Fig. 5 The same problem as a ball bouncing inside a wedge of angle θ=arctan⁡m/M\theta = \arctan\sqrt{m/M}, here 14.39° for a mass ratio of 15.2. Reflecting the wedge in its sides lays copies of it out as a fan; the ball’s zig-zag becomes a straight line, which crosses the mirror lines ⌊π/θ⌋ times — 12, the same as the blocks’ collisions.

Plot the two blocks’ positions, stretched by M\sqrt{M} and m\sqrt{m}, 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 θ\theta. 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 θ\theta, and a straight line can cross only those fan lines that lie within a half-turn of one another — there are ⌊π/θ⌋\lfloor\pi/\theta\rfloor 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 θ\theta always make a rotation by 2θ2\theta.

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 πM/m\pi\sqrt{M/m}, the square root of the mass ratio, and the square root has a physical reason. The heavy block has momentum MVMV to lose and then regain in the other direction, and the light block can carry at most about 2mv2mv 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 M/m V\sqrt{M/m}\,V, 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 mM/m V=Mm Vm\sqrt{M/m}\,V = \sqrt{Mm}\,V, and reversing MVMV takes about M/m\sqrt{M/m} 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 103810^{38}, and the light block must at its fastest move 101910^{19} times faster than the heavy one. If the heavy block moves at a millimetre a second, the light one would need to move at 101610^{16} 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 NN entries for a marked one, and does it in about (π/4)N(\pi/4)\sqrt{N} steps rather than the N/2N/2 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, 2arcsin⁡(1/N)2\arcsin(1/\sqrt{N}), 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 M/m\sqrt{M/m} 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 101210^{12}, the small velocity changes at each collision are lost in rounding, and a simulation can miscount; the counts drawn here stop at 10810^8, where the arithmetic is safe. The count formula has a subtlety too: it counts correctly only if π/θ\pi/\theta 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 θ\theta and arctan⁡θ\arctan\theta — 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