Dynamics

Two blocks and a wall count π

Slide a heavy block towards a light one resting by a wall, and count every collision until they part for good. A heavy block 100 times the mass gives 31; ten thousand times, 314; a million, 3,141. The digits are π because the two blocks are secretly one billiard ball in a wedge, and a ball in a wedge bounces as many times as the wedge's angle fits into half a turn.

Worth reading first: A bounce is a fold of the table · The word a straight line spells.

Put a small block on a frictionless floor, a little way out from a wall. Slide a much heavier block towards it from further out. The heavy block strikes the light one, which flies to the wall, bounces, strikes the heavy block again, flies back, and so on — faster and faster, as the heavy block slows, stops, and is finally pushed back the way it came. Eventually the light block is moving away from the wall more slowly than the heavy block, and nothing more can happen. Count every collision, between the blocks and against the wall.

If the heavy block has the same mass as the light one, the count is 3. If it is 100 times as heavy, the count is 31. At 10,000 times it is 314, and at a million, 3,141. Gregory Galperin published this in 2003, with a proof that the pattern continues: for a mass ratio of 100k100^k the count is the first k+1k + 1 digits of π\pi. The proof is the same trick that unfolds a billiard table, applied to a system that does not look like a billiard at all.

Two blocks and a wall count to 31. Space-time diagram of a heavy block of mass 100 driving a block of mass 1 against a wall: 31 elastic collisions in all.
Fig. 1 Time runs upwards: the heavy block, orange, with 100 times the mass of the light block, blue, drives it against the wall, black; the dots are collisions between the blocks, 31 collisions in all.

The collisions, one at a time

Each collision is elastic, conserving energy, and the blocks move without friction, so between collisions they move at constant speeds. A collision between the blocks conserves momentum as well, and the two conservation laws together fix the speeds after it from the speeds before:

v1′=(m−M)v1+2Mv2m+M,v2′=(M−m)v2+2mv1m+M,v_1' = \frac{(m - M)v_1 + 2Mv_2}{m + M}, \qquad v_2' = \frac{(M - m)v_2 + 2mv_1}{m + M},

with mm and v1v_1 for the light block and MM and v2v_2 for the heavy one. A collision with the wall reverses the light block’s speed. The figures compute the whole sequence event by event: at each step, find whether the light block reaches the wall or the heavy block catches the light block first, move both blocks to that moment, and apply the rule. The process stops when the light block moves away from the wall and the heavy block moves away faster.

In the hero, the light block’s zigzags crowd together near the wall while the heavy block, in the middle of its journey, is nearly stationary. Most of the 31 collisions happen in that crowded stretch. The heavy block carries almost all the momentum and gives it up a little at each collision, while the light block, much faster, shuttles back and forth to fetch it.

Equal masses, by hand

With equal masses the whole story fits in a few lines. The heavy block arrives at speed 1 and strikes the light block at rest. Equal masses in an elastic collision exchange speeds, so the arriving block stops dead and the other leaves at speed 1 towards the wall. That is the first collision. The light block bounces off the wall, the second, and returns at speed 1 to strike the stationary block, the third, and the speeds exchange again: the block that was at rest now leaves at speed 1 away from the wall, and the one that bounced is left at rest. Nothing can collide any more, and the count is 3, the first digit of π\pi.

With a mass ratio of 2 the exchange is incomplete. After the first collision the heavy block keeps a third of its speed and the light one leaves at four thirds; after the wall, the light block catches the heavy one, which is still approaching, and so on for five collisions in all. Following the speeds by hand gets tedious quickly, and the circle picture below is what makes the general count possible without following them.

How fast the light block gets

Energy conservation also bounds the light block’s speed. All the energy starts in the heavy block, 12Mv2\tfrac12 M v^2, and the light block can never have more than that, so its speed is at most M/m\sqrt{M/m} times the heavy block’s initial speed. At mass ratio 100 that is 10 times; at 10810^8, 10,000 times. In the circle picture this is simply the radius of the circle read along the horizontal axis. The fastest moment comes when the point is at the far left or right of the circle, when the heavy block is momentarily stationary and the light block carries everything — the middle of the crowded stretch in the hero, where the zigzags are tightest.

One point on one circle

The first step of the proof is to change scale. Multiply each block’s speed by the square root of its mass, so that the state of the system is the point

(m v1,  M v2).(\sqrt{m}\, v_1,\; \sqrt{M}\, v_2).

The kinetic energy is half the squared length of this point, and energy never changes, so the point always lies on one circle.

Every collision is a reflection on one circle. Scaled velocities (√m v₁, √M v₂) for mass ratio 100, normalised to the unit circle, after each of the 31 collisions; θ = arctan(1/10) = 5.711°.
Fig. 2 The scaled velocities after each collision, at mass ratio 100, all on one circle; a collision between the blocks reflects the point in the red line, and the wall reflects it in the vertical axis.

In these coordinates both kinds of collision are reflections. The wall reverses v1v_1, which reflects the point in the vertical axis. A collision between the blocks keeps the energy and keeps the momentum mv1+Mv2m v_1 + M v_2, which in scaled coordinates is a dot product with the fixed vector (m,M)(\sqrt m, \sqrt M); a map that keeps lengths and keeps that dot product, and is not the identity, is the reflection in the line perpendicular to that vector. The angle between the two mirror lines is

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

and two reflections in lines at angle θ\theta make a rotation by 2θ2\theta, as two mirrors make a rotation in any pattern. So every pair of collisions, one between the blocks and one with the wall, turns the point by 2θ2\theta round the circle. It starts at the bottom — the heavy block moving towards the wall, the light block at rest — and turns until it reaches the arc where neither block can catch the other. That arc is reached after about π/θ\pi/\theta collisions, since 2θ2\theta per pair of collisions is θ\theta per collision and the point turns through half a circle.

The billiard hidden in the blocks

The positions tell the same story more vividly. Scale them the same way, (m x1,M x2)(\sqrt m\, x_1, \sqrt M\, x_2). The light block must stay between the wall and the heavy block, 0<x1<x20 < x_1 < x_2, and in scaled coordinates that region is a wedge whose corner has angle θ\theta. Between collisions the state moves in a straight line at constant speed, because each block does. At a collision it reflects off a side of the wedge, angle of incidence equal to angle of reflection, because the reflection of velocities just found is exactly that. The two blocks are one billiard ball in a wedge.

Unfolding the wedge into a straight line. The configuration wedge of angle arctan(1/4) for mass ratio 16, reflected round its corner 13 times; a straight line crosses 12 of the copies' sides, the 12 collisions.
Fig. 3 The wedge for mass ratio 16, with corner angle arctan⁡(1/4)≈14°\arctan(1/4) \approx 14°, tinted, and its mirror images fanned round the corner; the ball’s path unfolds into a straight line that crosses 12 of the copies’ sides, one for each of the 12 collisions.

Now unfold the table. Instead of reflecting the ball at each side, reflect the wedge, and the ball goes straight on into the copy. The copies fan round the corner, each a wedge of angle θ\theta, and the ball’s path becomes a straight line. A straight line not through the corner crosses each ray from the corner at most once, and the rays within a half-plane — the only ones a line can cross — number ⌈π/θ⌉−1\lceil \pi/\theta \rceil - 1 when π/θ\pi/\theta is not a whole number. So the number of collisions is

N=⌈πarctan⁡m/M⌉−1,N = \left\lceil \frac{\pi}{\arctan\sqrt{m/M}} \right\rceil - 1,

a formula with π\pi in it because a straight line turns through exactly half a turn, from one direction to its opposite. For mass ratio 16 the angle is about 14 degrees, π/θ\pi/\theta is about 12.8, and the line crosses 12 rays.

Why the digits come out

The collisions spell π. Collision counts for mass ratios 1 to 10⁸: 1: 3, 100: 31, 10000: 314, 1000000: 3141, 100000000: 31415, against π/θ and the digits of π.
Fig. 4 The collision counts for mass ratios that are powers of 100, found by running every collision, beside π/θ\pi/\theta and the digits of π\pi.

At mass ratio 100k100^k, m/M=10−k\sqrt{m/M} = 10^{-k}, and arctan⁡\arctan of a small number is just below it: arctan⁡x=x−x3/3+⋯\arctan x = x - x^3/3 + \cdots. So π/θ\pi/\theta is just above π⋅10k\pi \cdot 10^k, by about π⋅10−k/3\pi \cdot 10^{-k}/3, and the count is the whole number just below it, which is π⋅10k\pi \cdot 10^k with its fractional part removed — the first k+1k+1 digits of π\pi. The simulation confirms it to ratio 10810^8: 3, 31, 314, 3,141 and 31,415 collisions, against values of π/θ\pi/\theta of 4.0000, 31.5204, 314.1697, 3141.5937 and 31415.9266.

There is a catch that Galperin pointed out. The argument needs the small excess π⋅10−k/3\pi \cdot 10^{-k}/3 not to carry π⋅10k\pi \cdot 10^k past a whole number. That would happen only if the digits of π\pi after position kk began with a long run of 9s — roughly kk of them. Nobody expects this, since a run of kk nines starting exactly at position kk would be an extraordinary coincidence, but nobody has proved it cannot happen either, because almost nothing is proved about the digits of π\pi. So the blocks are proved to count π\pi’s digits for every power of 100 for which this coincidence does not occur, which includes every case anyone could ever simulate.

As a way of computing π\pi, the blocks are spectacularly inefficient. Each new digit multiplies the number of collisions by ten, so dd digits cost about 3×10d−13 \times 10^{d-1} collisions, while the series that compute π\pi in practice add a fixed number of digits per term. The interest is entirely in the fact that it works at all: that a mechanical system with two masses and a wall, governed by nothing but the conservation of energy and momentum, carries the ratio of a circle’s circumference to its diameter in its collision count.

Every ratio, not only powers of 100

Every mass ratio, not only powers of 100. Collision count against mass ratio from 1 to 1,000 on a logarithmic scale: 61 simulated ratios on the step function ⌈π/arctan √(m/M)⌉ − 1, close to π√(M/m).
Fig. 5 The collision count against the mass ratio from 1 to 1,000 on a logarithmic scale: the step function from the wedge angle, with 61 simulated ratios as dots, and πM/m\pi\sqrt{M/m} dashed.

The formula applies to any masses, and the simulation agrees with it at all 61 ratios tested. The count grows like πM/m\pi\sqrt{M/m} because the wedge angle shrinks like the square root of the mass ratio’s reciprocal. With equal masses it is 3: the heavy block stops dead, the light block bounces off the wall, returns, and the blocks swap speeds again. With M/m=2M/m = 2 it is 5 and with 4 it is 6, numbers with nothing visibly to do with π\pi. The powers of 100 are special only because their square roots are powers of 10, which turn πM/m\pi\sqrt{M/m} into a decimal shift of π\pi. In base 2, mass ratios that are powers of 4 would count the binary digits of π\pi.

A quantum search with the same rotation

The deepest surprise came in 2019, when the physicist Adam Brown noticed that the blocks are doing exactly what a quantum computer does in Grover’s search algorithm.

The same rotation in a quantum search. Grover's search among 64 items: the state starts at angle θ = arcsin(1/8) from the unmarked direction and turns by 2θ per step; after 6 steps the chance of the marked item is 0.99659.
Fig. 6 Grover’s search for one marked item among 64: the quantum state turns by 2θ2\theta at each step, θ=arcsin⁡(1/8)\theta = \arcsin(1/8), from near the direction of the unmarked items towards the marked one, and after 6 steps the chance of the marked item is 0.9966.

Lov Grover’s algorithm of 1996 searches NN unsorted items for a marked one. Its state stays in a plane spanned by two directions, the marked item and the uniform mixture of the rest, starting at angle θ=arcsin⁡(1/N)\theta = \arcsin(1/\sqrt N) from the second. Each step applies two reflections, one in each of two lines at angle θ\theta, so each step turns the state by 2θ2\theta, and after about (π/4)N(\pi/4)\sqrt N steps it points almost exactly at the marked item. For 64 items, 6 steps give probability 0.9966. A classical search needs about N/2N/2 looks on average; the quantum one needs about N\sqrt N.

The blocks’ velocity point does the same thing on its own circle: two reflections in lines at angle θ\theta, a rotation by 2θ2\theta, repeated until the point has turned through the available arc. In both, the square root comes from the same place — an angle whose sine or tangent is one over a square root — and in both the count is π\pi divided by an angle. The quantum speed-up and the digits of π\pi from colliding blocks are one calculation.

Where else π comes from a count

π\pi arising as a count of discrete events is unusual but not unique. Dropped needles estimate π\pi from the fraction that cross lines on a floor, but that is a probability, measured approximately, with an error that shrinks only like one over the square root of the number of throws. The blocks give π\pi’s digits exactly, by a deterministic count, and the price is in the masses rather than in the throws: each extra digit needs a block a hundred times heavier, and a collision count ten times longer.

The other connection is to straight lines spelling words. There, a line across a grid of squares records which sides it crosses, and the count of crossings of each kind is determined by the line’s slope. Here, a line across a fan of wedges records how many rays it crosses, and the count is determined by the fan’s angle. Both are the same principle, that unfolding turns a bouncing path into a straight one whose crossings can be counted from its direction alone — the principle that turns a square table into a torus and a wedge into a fan.

What a billiard in a wedge always does

The wedge billiard is the simplest polygonal billiard, and its unfolding is exact: every path is a straight line in the fan, so the number of bounces is known for every starting direction. That is in sharp contrast to most of the billiards on this shelf — triangles, whose periodic paths are not even known to exist in general, or tables with a round obstacle, which are chaotic. A wedge of angle π/k\pi/k tiles a half-plane by its reflections, which is why the count is so clean, and the blocks happen to produce wedges of angle arbitrarily close to π/k\pi/k for large kk.

The wedge also explains why the system always stops. A straight line in a fan of finitely many copies leaves the fan after finitely many crossings. In the blocks, that means the heavy block always turns round and both blocks leave, however lopsided the masses — which is not obvious from the mechanics, where the light block might seem able to trap the heavy one in an endless series of bounces.

Floating point near the wall

The simulation uses floating-point numbers and point masses. At mass ratio 10810^8 the light block moves 10,000 times faster than the heavy one and the collisions crowd together within very short times near the wall; the count of 31,415 agrees with the formula, but a simulation at much higher ratios would need care with rounding, and the formula, not the simulation, is the trustworthy count there. Real blocks have size, but size only shifts positions and does not change the count, since the count depends only on the velocities.

No figure can settle the caveat about runs of 9s in π\pi. The statement that the blocks count the digits of π\pi for every power of 100 rests on an unproved property of π\pi’s decimal expansion, which in all likelihood holds.

Collisions counted, Galperin’s argument quoted

Computed here: every collision for mass ratios 100k100^k up to k=4k = 4 and for 61 ratios between 1 and 1,000, with the counts checked against ⌈π/arctan⁡m/M⌉−1\lceil \pi/\arctan\sqrt{m/M}\rceil - 1; the scaled velocities, checked to lie on the energy circle; the unfolded wedge at ratio 16 with its 12 crossings checked against the collision count; and Grover’s rotation for 64 items.

Quoted: Galperin’s paper of 2003 and its caveat about the digits; Grover’s algorithm of 1996; Brown’s observation of 2019.

Still open: whether π hides a run of nines

The question that keeps the blocks’ theorem conditional is a question about π\pi. Does the decimal expansion of π\pi contain, at position kk for some kk, a run of about kk consecutive 9s? If π\pi is normal — every block of digits appearing with the frequency chance would give it — then runs of kk nines starting near position kk happen only finitely often, and probably never; but π\pi has not been proved normal in any base, and it is not even known whether the digit 7 occurs infinitely often. The block-counting theorem is therefore one of many statements that are certainly true in practice, verified to every precision anyone can reach, and unproved for the same reason that the statistics of π\pi’s digits are unproved.

A ball in a wedge

Two blocks and a wall, with elastic collisions, are one billiard ball in a wedge of angle arctan⁡m/M\arctan\sqrt{m/M}: energy turns velocities into points on a circle, momentum makes each collision a reflection, and unfolding turns the path into a straight line. A straight line crosses ⌈π/θ⌉−1\lceil \pi/\theta\rceil - 1 copies of the wedge, so at mass ratio 100k100^k the collisions number the first k+1k+1 digits of π\pi — 31, 314, 3,141, 31,415, all confirmed by running every collision. The same rotation by two reflections is Grover’s quantum search, and the same square root is its speed-up.