How Two Sliding Blocks Compute π — The Most Surprising Result in Physics
Two frictionless blocks, a wall, and perfectly elastic collisions. Count the clacks. You get π. This is not a coincidence — it is a deep theorem hiding inside conservation laws, and this article takes you all the way from the first collision to the geometric proof.
The Most Unexpected Result in Classical Mechanics
Imagine two smooth blocks on a frictionless floor. A small block sits quietly between a large one and a wall. You slide the large block toward the small one, step back, and start counting the clacks — the sharp sounds of block hitting block, or block bouncing off the wall. Nothing in this setup suggests any connection to circles, angles, or the number π = 3.14159… And yet:
- Mass ratio 1 : 1 → 3 clacks (first digit of π)
- Mass ratio 100 : 1 → 31 clacks (first two digits of π)
- Mass ratio 10 000 : 1 → 314 clacks (first three digits of π)
- Mass ratio 1 000 000 : 1 → 3141 clacks (first four digits of π)
- Mass ratio $100^N : 1$ → first $N+1$ digits of π, every time.
This result was discovered by mathematician Gregory Galperin in the 1990s and published in 2003 in his paper *Playing Pool with π*. When he first presented it at a seminar, nobody in the audience believed him. The connection between block collisions and π is not approximate, not a coincidence, and not a numerical curiosity — it is an exact, rigorous theorem. This article explains exactly why it is true, building from the physics of elastic collisions through to the geometric argument that makes π inevitable.
The Setup: A Perfectly Idealised Experiment
Like all the best physics problems, this one begins with a ruthless act of idealisation. We strip the real world of everything that would complicate the mathematics, until only the essential mechanism remains.
The Physical Arrangement
We have two rectangular blocks on a perfectly flat, frictionless surface. Call the large block $M$ and the small block $m$. To the left of the small block is a wall — infinitely massive, immovable, and perfectly rigid. The initial positions, from left to right, are: wall — small block — large block. Both blocks are initially at rest. Then, at time $t = 0$, the large block $M$ is given a velocity $V_0$ directed to the left, toward the small block.

The Rules of the Game
- All collisions are perfectly elastic. Kinetic energy is conserved in every collision — block-block and block-wall alike. No energy is lost to heat, sound, or deformation.
- The floor is frictionless. Between collisions, blocks slide freely at constant velocity.
- The wall has infinite mass. When the small block hits the wall, its speed is unchanged but its direction reverses. This is the block-wall collision rule: $v_m \to -v_m$.
- Motion is one-dimensional. Everything happens along a single line. No spinning, no bouncing sideways.
- The large block starts moving left; the small block starts at rest. The large block approaches from the right.
We count every clack: every block-block collision and every block-wall collision. The experiment ends when the large block can no longer catch the small block — specifically, when both blocks are moving to the right and the large block is slower than or equal to the small block, so no further collision is possible. The total count of clacks in this experiment is what yields the digits of π.
Watching the First Few Collisions
Let us start with the simplest possible case: $M = m$ — equal masses. The large block slides left at speed $V_0$, the small block is at rest. What happens at the first collision? In a perfectly elastic collision between equal masses, the moving object stops dead and the stationary object moves away with the exact same velocity. This is a familiar result from billiards.
- Clack 1 (block-block): Large block stops. Small block moves left at $V_0$.
- Clack 2 (block-wall): Small block hits wall, bounces right at $V_0$. Large block still at rest.
- Clack 3 (block-block): Small block (moving right at $V_0$) hits the stationary large block. Small block stops. Large block moves right at $V_0$.
Now the large block moves to the right and the small block is at rest. Both blocks are either at rest or moving away from the wall. No further collision is possible. Total clacks: 3. The first digit of π.
That is perhaps not impressive for equal masses. Now consider $M = 100m$. Working through the elastic collision equations (which we will derive carefully in the next section), the blocks bounce back and forth many more times before the large block finally moves rightward and escapes — 31 clacks in total. $3$ and $1$ — the first two digits of π. The pattern is no longer deniable.
The Physics Engine: Elastic Collision Equations
To understand why the count yields π, we first need the exact equations governing what happens to the velocities at each collision. These come entirely from two conservation laws that hold for every perfectly elastic collision.
Conservation of Kinetic Energy
In a perfectly elastic collision, the total kinetic energy before and after is identical. No energy is transformed into heat or deformation:
where $V, v$ are the velocities before the collision and $V', v'$ are the velocities after. We can always adopt sign conventions so that rightward is positive and leftward is negative.
Conservation of Momentum
In any collision between two objects with no external horizontal forces, the total momentum is conserved:
Solving the System: Post-Collision Velocities
We have two unknowns ($V'$ and $v'$) and two equations. Solving simultaneously — subtracting and factoring the energy equation — yields the general elastic collision formulas:
These formulas describe the outcome of every block-block collision. Let us verify the equal-mass special case: set $M = m$. Then $V' = v$ and $v' = V$ — the blocks swap velocities. This confirms our earlier observation: equal-mass elastic collisions result in a perfect velocity swap, which is why the large block stops dead on the first hit.
The Wall Collision Rule
When the small block hits the wall, the wall has effectively infinite mass. Setting $M_{wall} \to \infty$ in the formula for $v'$ gives $v' = -v$: the small block simply reverses direction with the same speed. The wall does not move. Momentum is not conserved for the small-block-wall subsystem — the wall (attached to the Earth) absorbs an impulse — but total kinetic energy is unchanged since the wall's velocity remains zero.
Termination Condition
The process terminates when no further collision is possible. After any collision, if the large block is moving to the right (positive velocity) and the small block is also moving to the right with a speed greater than or equal to the large block, then the small block is pulling away from $M$ and no further block-block collision can occur. With the wall to the left and $M$ already heading right, no more wall collisions are possible either. The termination condition is therefore:
Phase Space: Where the Circle Comes From
We now have a perfectly working mechanical recipe — apply the collision formulas, count the clacks, get π. But *why*? What is the connection between block velocities and the number that describes the circumference of a circle? The answer appears the moment we change our perspective from watching the blocks to watching a single point move in an abstract space.
State Space: Encoding Both Velocities as One Point
At any moment, the entire state of the velocity system is captured by two numbers: the velocity of the large block $V$ and the velocity of the small block $v$. We can represent this pair as a point $(V, v)$ in a two-dimensional plane — the velocity state space, or phase space. When the blocks' velocities change due to a collision, the point jumps to a new location. The whole experiment becomes the story of a point hopping around a plane.
Our starting state is $(V_0, 0)$ — large block moving, small block at rest. The termination condition $V' \geq 0$, $v' \geq V'$ defines a triangular region in this plane (the upper-right region where both velocities are non-negative and $v \geq V$). We are counting how many hops it takes to land inside that region.
Energy Conservation = A Circle (After Rescaling)
Conservation of kinetic energy says the total $\frac{1}{2}MV^2 + \frac{1}{2}mv^2$ is constant throughout every block-block collision. In the $(V, v)$ plane, this is the equation of an ellipse centered at the origin:
An ellipse is close to a circle but not quite. We can turn it into a circle by rescaling the axes. Define new coordinates:
In these rescaled coordinates, the energy conservation equation becomes:
This is the equation of a circle of radius $R = \sqrt{2E_0}$ centered at the origin. The key insight: every block-block collision keeps the state point on this circle. The circle is the geometric encoding of energy conservation. The state point is forever trapped on its circumference — it can only move along the circle, never jump off it.

Momentum Conservation = A Straight Line
Conservation of momentum during a block-block collision says $MV + mv = \text{const}$. In the rescaled coordinates $(x, y) = (\sqrt{M}\,V,\, \sqrt{m}\,v)$, we have $V = x/\sqrt{M}$ and $v = y/\sqrt{m}$, so momentum conservation becomes:
This is the equation of a straight line with slope $-\sqrt{M/m}$. Momentum conservation constrains the hop from one collision to the next: after a block-block collision, the new state must lie on the intersection of the energy circle and the momentum line through the previous point. For two lines to intersect a circle, there are at most two intersection points — and one of them is the current state itself. The other intersection is the new state after the collision. So each block-block collision hops the state point to the other intersection of the circle with the appropriate momentum line.
The Wall Collision = A Vertical Reflection
What does the wall collision look like in phase space? The wall bounces the small block: $v \to -v$. In the rescaled coordinates, $y = \sqrt{m}\,v \to -\sqrt{m}\,v = -y$. This is a reflection across the x-axis. The state point jumps to its mirror image through the horizontal axis. Because $x^2 + (-y)^2 = x^2 + y^2 = R^2$, this reflection also stays on the circle. So both types of collision keep the point on the circle — they just move it around by different geometric operations.
Why π: The Angle That Everything Reduces To
We are nearly at the heart of the proof. The circle is on the table. The state point hops around it. But why does the hop count give the digits of π? The answer is that each hop advances the state point by a fixed angular step, and counting how many steps fit into a specific arc length is precisely a way of measuring π.
The Fixed Angular Step of Each Block-Block Collision
Consider a block-block collision in the rescaled phase space. The state point sits at some angle $\alpha$ on the circle. Momentum conservation says the hop takes the point to another location on the circle, connected to the original by a chord whose slope is $-\sqrt{M/m}$. The crucial observation is that this chord always subtends the same angle at the centre of the circle, regardless of where on the circle the current state is.
This is a consequence of the Inscribed Angle Theorem: any chord of a circle subtends the same angle at the center for any position of the chord (as long as the chord direction — its slope — is fixed). Since every block-block momentum line has the same fixed slope $-\sqrt{M/m}$, every block-block hop advances the angle by the same amount $\Delta\phi$.
What is this fixed angle? The momentum conservation line has slope $-\sqrt{M/m}$ in the $(x,y)$ plane. This line is perpendicular to the vector $\left(\sqrt{M},\, \sqrt{m}\right)$. In polar coordinates on the circle, the angle this perpendicular vector makes with the positive $x$-axis is $\theta = \arctan\!\left(\sqrt{m/M}\right)$. Each block-block collision advances the state's polar angle by:
This is the central formula of the entire argument. Every block-block hop is a rotation on the circle by angle $2\arctan(\sqrt{m/M})$. The wall-collision reflection across the x-axis is equivalent to negating the angular position — reflecting the point as if the x-axis were a mirror.
Counting Steps = Measuring an Arc
The experiment starts at the leftmost point of the circle (angle $\pi$ from the positive x-axis, using standard polar convention). It ends when the state point enters the upper-right region where $V \geq 0$ and $v \geq V$. In the rescaled space, this termination region corresponds to the state point reaching an angle close to the positive x-axis — specifically, the angle $\arctan(\sqrt{m/M})$ measured from the positive x-axis.
The total angular distance the state point must travel from start to finish is essentially $\pi$ radians (a half-turn of the circle from the leftmost point to the right side). Each step covers an angle of $\Delta\phi = 2\arctan(\sqrt{m/M})$. The number of steps needed is therefore:
where $\lfloor \cdot \rfloor$ is the floor function (rounding down to the nearest integer). Now set $M = 100^N m$. Then $\sqrt{m/M} = 1/10^N$, and for small $\varepsilon$, $\arctan(\varepsilon) \approx \varepsilon$. Therefore:
And $\lfloor \pi \times 10^N \rfloor$ is exactly the integer formed by the first $N+1$ digits of π. For $N = 1$: $\lfloor 31.415… \rfloor = 31$. For $N = 2$: $\lfloor 314.159… \rfloor = 314$. For $N = 3$: $\lfloor 3141.59… \rfloor = 3141$. QED.
The Numbers: Verified Results and the General Formula
The formula $N = \lfloor \pi / \arctan(\sqrt{m/M}) \rfloor$ is exact and works for any mass ratio, not just powers of 100. The mass ratio 100 is special because it is the square of 10 — this makes $\sqrt{m/M} = 1/10^N$ for $M = 100^N m$, a power of ten whose arctangent closely approximates $1/10^N$, placing the result precisely at the $N$-th decimal digit boundary of π.
| Mass Ratio M/m | √(m/M) | arctan(√m/M) (rad) | N = floor(π / arctan(√m/M)) | Leading Digits of π |
|---|---|---|---|---|
| 1 | 1.0000 | 0.7854 (= π/4) | 3 | 3 |
| 4 | 0.5000 | 0.4636 | 6 | — |
| 100 | 0.1000 | 0.09967 | 31 | 3, 1 |
| 10 000 | 0.0100 | 0.009999 | 314 | 3, 1, 4 |
| 1 000 000 | 0.0010 | 0.001000 | 3 141 | 3, 1, 4, 1 |
| 10⁸ | 0.0001 | 0.0001000 | 31 415 | 3, 1, 4, 1, 5 |
| 10¹⁰ | 10⁻⁵ | ≈ 10⁻⁵ | 314 159 | 3, 1, 4, 1, 5, 9 |
The table makes clear that as the mass ratio increases (more precisely, as it increases in powers of 100), the approximation $\arctan(\varepsilon) \approx \varepsilon$ becomes more and more accurate, and the collision count tracks π to more and more digits. The approximation is never exact — $\arctan(\varepsilon) < \varepsilon$ always — but the error is so small that it only affects digits beyond the current precision level.
Why Not Every Mass Ratio Gives Clean Digits
The formula $N = \lfloor \pi / \arctan(\sqrt{m/M}) \rfloor$ gives a well-defined collision count for any positive mass ratio. But for a generic ratio like $M = 7m$, the count is $\lfloor \pi / \arctan(1/\sqrt{7}) \rfloor = \lfloor \pi / 0.3605 \rfloor = \lfloor 8.71 \rfloor = 8$ — a perfectly valid answer, but not one that obviously encodes a decimal digit of π. The mass ratio $100^N$ is the specific choice that aligns the step angle $\arctan(1/10^N)$ with the decimal digit structure of π. Other bases are possible: a mass ratio of $10^N$ gives the digits of π in base 3.16… — more exotic, but equally exact.
Deep Connections: Billiards, Optics, and Quantum Computing
The Galperin billiard is not merely a clever trick. It sits at the intersection of several deep areas of physics and mathematics, and its structure reappears in contexts ranging from geometric optics to quantum algorithms.
Unfolding: The Billiard Table Perspective
Galperin's original 2003 paper used a different but equivalent geometric approach: instead of phase space, he used a configuration space of block positions $(X, x)$ where $X$ is the position of the large block and $x$ the position of the small block. After the same rescaling $(\xi = \sqrt{M}\,X,\ \chi = \sqrt{m}\,x)$, the accessible region for the blocks (subject to $\chi < \xi$ since the small block is always to the left of the large block, and $\chi > 0$ since the small block cannot go through the wall) becomes a wedge-shaped region with angle $\theta = \arctan(\sqrt{m/M})$ at the origin.
The motion of the system in this configuration space is a point moving in a straight line (when no collision occurs), bouncing off the walls of the wedge like a light ray in a mirror. The total number of bounces inside a wedge of angle $\theta$ before the ray escapes is exactly $\lfloor \pi / \theta \rfloor$ — a standard result in geometric optics and billiard theory. Since $\theta = \arctan(\sqrt{m/M})$, we recover our formula. The block collision problem is literally a billiard ball bouncing inside a triangular room.

Connection to Grover's Algorithm in Quantum Computing
One of the most surprising connections in the Galperin billiard story is its relationship to Grover's algorithm — the celebrated quantum search algorithm discovered in 1996. Grover's algorithm searches an unsorted database of $N$ items in $O(\sqrt{N})$ steps, compared to the classical $O(N)$ steps. The algorithm works by repeatedly applying two reflections in a high-dimensional Hilbert space — a Grover iterate. Sound familiar? Two alternating reflections on a circle, counting steps until a target is reached.
The mathematical structure is identical. In Grover's algorithm, each step rotates the quantum state by a fixed angle $2\arcsin(1/\sqrt{N})$ in the two-dimensional subspace spanned by the initial state and the target state. The number of steps to reach the target is $\approx \pi\sqrt{N}/4$ — again, a formula involving π divided by an arcsin (closely related to arctan for small arguments). This is not a superficial analogy: the phase space of the Galperin billiard and the Hilbert space of Grover's algorithm are governed by the same geometric theorem about arcs and reflections on a circle.
The Calogero Model: An Exactly Solvable Quantum System
The 2017 paper by Bolsinov, Borisov, and collaborators showed that the Galperin billiard can be mapped exactly onto the two-particle Calogero model — an exactly solvable quantum mechanical system describing two particles interacting via an inverse-square potential $V(x) = g/x^2$. The Calogero model is one of the few multi-particle quantum systems with known exact energy eigenvalues, and its connection to the counting of billiard bounces provides a bridge between classical and quantum exactly-solvable physics. The Galperin billiard is, in this sense, an analog computer for a quantum system.
Physical Intuition: Putting It All Together
By now we have seen the result from several angles — directly from collision equations, through the phase space circle, via the wedge-shaped billiard table, and through the lens of quantum computing. Let us build one clean, unified intuition that captures all of it.
The Circle Is Always There
π appears everywhere a circle does. And a circle appears here because of energy conservation — the total kinetic energy $\frac{1}{2}MV^2 + \frac{1}{2}mv^2 = E_0$ is a constraint that, in the right coordinate system, is the equation of a circle. This is a profound and general observation: any system with a conserved quadratic quantity has a circular structure in the appropriate space. The block collision problem has such a conserved quantity — kinetic energy — and that is ultimately why π shows up.
Momentum Provides the Stepping Rule
Momentum conservation at each block-block collision provides the rule for how the state point moves on the circle: it hops by a fixed arc equal to $2\arctan(\sqrt{m/M})$. The wall reflection is a mirror operation that allows the point to 'fold back' and continue its angular journey. Without the wall, the point would hop once and stop; the wall is what allows the sequence of collisions to accumulate into an angular measure of π.
The Mass Ratio Tunes the Step Size
Choosing the mass ratio $M/m = 100^N$ tunes the step size to $2\arctan(10^{-N}) \approx 2 \times 10^{-N}$ radians — an extremely small step for large $N$. A half-circle is $\pi$ radians, so the number of steps to traverse a half-circle is $\pi / (2 \times 10^{-N} / 2) = \pi \times 10^N$. Rounding down gives the integer whose decimal digits are the first $N+1$ digits of π. The mass ratio is a dial that tunes the angular ruler to read off π in decimal.
Why Does π Keep Appearing in Physics?
The block collision result invites a broader question: why does the number π — defined as the ratio of a circle's circumference to its diameter — appear so relentlessly in physics? The blocks have no circles in them. The floor has no circles. There is no geometry of circles anywhere in the physical setup. And yet π emerges, exact and inevitable.
The answer is that π is not fundamentally a geometric object. It is an analytic constant — the half-period of the sine and cosine functions, which are the natural solutions to any differential equation of the form $\ddot{x} = -\omega^2 x$, the equation of the harmonic oscillator. This equation governs springs, pendulums, sound waves, electromagnetic waves, quantum wavefunctions, and electrical circuits. Wherever a restoring force appears, sine and cosine appear, and with them π.
The block problem involves no oscillator directly — but energy conservation creates a circular constraint in phase space, and circles are the level curves of $x^2 + y^2 = R^2$, which is exactly the quadratic form that appears in the harmonic oscillator's conserved energy. The arc length of a circle is proportional to π. Counting arc steps of fixed size is equivalent to measuring that arc length — so π appears, not because circles are physically present, but because the algebra of conservation laws is isomorphic to the geometry of circles.
| Physical Context | Why π Appears |
|---|---|
| Pendulum period $T = 2\pi\sqrt{L/g}$ | The phase of SHM runs through 2π per cycle |
| Wave on a string: $\lambda f = v$ | Wavelength = one full cycle = $2\pi$ in phase |
| Hydrogen atom energy $E_n = -13.6/n^2$ eV | Quantisation of angular momentum: $L = n\hbar = nh/2\pi$ |
| Coulomb's law: $F = kq_1q_2/r^2$ | Gauss's law integrates over a sphere; surface area $= 4\pi r^2$ |
| Stefan–Boltzmann law: $P = \sigma T^4$ | $\sigma = 2\pi^5 k_B^4 / (15 c^2 h^3)$; π enters through the Riemann ζ(4) integral |
| Block collision count | Energy conservation creates a circular phase space; steps count a semicircular arc |
In every case, π appears because the underlying mathematics — whether in the solution of a differential equation, the surface area of a sphere, or the geometry of phase space — ultimately involves the circle, the exponential function $e^{i\theta}$, or both. The block problem is one of the most elementary and striking demonstrations that this is so.
The Deeper Lesson: Conservation Laws Are Geometry
The block collision problem is, at its deepest level, a lesson about what conservation laws actually are. When we say 'energy is conserved,' we are not just saying that a number stays the same — we are saying that the state of the system is constrained to a surface in phase space. When that surface is a circle (as it is here, after the right coordinate change), and when the dynamics moves the state along that circle by fixed angular steps, counting steps becomes the measurement of an angle — and angles, by their nature, involve π.
This is what makes the Galperin result so beautiful and so important as a teaching tool. It is not a trick. It is not a coincidence. It is a completely transparent demonstration, visible to anyone who draws the phase space diagram, that π lives inside Newton's laws — inside the most elementary statements of classical mechanics about energy and momentum. The two sliding blocks are, in the most literal sense, a physical incarnation of the circle.