## Monday, January 14, 2019 ... / / ### An unexpected encounter of digits of $\pi$ in the counting of collisions

Peter F. and John A. simultaneously sent me a nice video on the 3Blue1Brown YouTube channel that wonderfully popularizes various mathematical curiosities and gets well-deserved hundreds of thousands of views for that:

The most unexpected answer to a counting puzzle (a 5-minute video)
Imagine two boxes on a line, a big one and a small one. The big one is $M$ times heavier than the smaller one. The small box starts at zero speed, the big one approaches from the right, collides with the small one. And the small box elastically oscillates between the big box and a static wall.

You count all the "clacks". When the boxes are equally heavy and $M=1$, you will get $3$ clacks. When $M=10^{10}$, you will get... $314,\!159$ clacks. It's almost like digits of $\pi$. And indeed. The rule continues. Why do you get digits of $\pi$ in a counting problem? And why are they multiplied by powers of ten?

OK, let us start with the last question. Why do the base-ten multiples seem to play a special role here? Many people are asking this question over there. Well, they don't.

The universal rule is that if the mass ratio is $M$, then the number of clacks will be an integer close to $N \approx \pi \sqrt M.$ That's it. Note that nothing involving the number ten appears in the formula above or the previous sentence. But if $M=100^p$, then $\sqrt{M}=10^p$. So if the mass ratio is an even power of ten, the number of clacks will scale like a power of ten, too.

But if you preferred to see the digits of $\pi$ in the hexadecimal form, you could do it equally well. You would choose the mass ratio to be $M=256^{K}$ (which you could write as $M=100^p$ if you took the hexadecimal notation seriously) and the number of clacks would be $N \approx \pi \cdot 16^p$ where the power of sixteen would simply shift the hexadecimal digits (again, $16^p$ could be written as $10^p$ hexadecimally). So indeed, there is absolutely nothing special about the base-10 digits here. The only fact is that if you care about digits of $\pi$ in the base-10 system, you must choose the mass ratio that is also simple in the base-10 system, and the calculation will guarantee that the number of clacks will preserve the base-10 values simply because$\sqrt{100^p} = 10^p.$ It's that simple.

OK, why does $\pi$ appear there? The channel will probably record a video where the proof is presented, it could be a nice one. The derivation was given by Gregory Galperin in a 2003 paper (he already figured it out in 1995):
Playing pool with $\pi$ (the number $\pi$ from a billiard point of view) (PDF)
See also the Google Scholar entry. The paper has just 13 citations but it's amusing enough so that the YouTube popularization of the paper collects 350,000 views within a day! ;-)

Galperin's proof is funny – and relying on some witty tricks from this book by Arnold. You may map the elastically colliding boxes to a billiard. And in a certain transformed space, there will be a fixed calculable number of "clacks", basically $\sqrt M = 10^p$, per unit angle. And because the angles of the initial and final state differ by $\pi$, you will get $\pi\cdot \sqrt M$ "clacks".

It's not really hard to see why the number of clacks scales like $\sqrt{M}$, either. And the explanation below is mine. But I believe that any person with physics intuition can produce it, too.

For a large mass ratio, the small box in between the wall and the big box behaves as the molecule of some gas. Because the total kinetic energy is preserved, the original kinetic energy $MV^2/2$ of the big box is converted to $v^2/2$ of the small box (whose mass is $m=1$) in the middle of the process when the big box is approximately at rest. You can see that $v_{\rm max} = V_{\rm max}\sqrt{M}$ So if the initial speed of the big box is "one", the maximum speed of the small box will be $\sqrt{M}$. The time needed to oscillate between the wall and the big box will therefore scale like $1/\sqrt{M}$, and the maximum number of clacks per unit time will go like $\sqrt{M}$ again. Well, we were cheating because we neglected the fact that for a higher $M$, the big box gets closer to the wall, before it's repelled, and when it's closer, the rate of clacks is higher. It's true but this extra power of $M$ is canceled by the fact that almost all the clacks only appear during a shorter "core" of the episode.

I guess the dear reader as well as the blogger would be bored to prove all these powers. But it's not hard to see that there is some power law.

Billiards play a role in the proof. So here's an amazing shot by Mr Blomdahl – thanks to Olda K. who loves billiard. I have serious doubts whether skills play much role beyond the brute force and luck – when collisions amplifying the uncertainties are involved. But maybe I just miscalculate the odds.

It's too bad that only problems whose "basic rules" are really trivial to understand may be turned into these yummy popular videos where things nicely clack and millions of people watch and listen (although I guess that only thousands will be patient enough to try to understand the proof at a technical level). There are so many things in higher mathematics and theoretical physics that are even more exciting – but one needs a more refined background to understand the beauty.

P.S.: Here is a helpful comment explaining the origin of the $\pi$ factor from the commenter Bidoni Bidona:
Describe the system in terms of the velocities $V$ and $v$ only.

As it turns out, accounting for conservation of momentum and energy when the two masses collide, and perfect reflection when the lightest one bounces off the wall, the vector in the $(v,V)$ plane describe an ellipse. If you scale the axis so that you're now in the $(v,\sqrt{M} V)$ plane, where $M$ is the mass ratio $m_{\rm big}/m_{\rm small}$, you're now describing a circle.

The process ends when the vector ceases to be in the $v\gt V$ half plane. Putting it all together, you find that the number of collisions is precisely the largest integer smaller than or equal to $\pi/{\rm arctan}(1/\sqrt{M})$. So you're not exactly proportional to the floor of $\pi\sqrt{M}$ but ${\rm arctan}(1/\sqrt{M})$ is reasonably close to $1/\sqrt{M}$ even when $\sqrt{M}$ is just above $1$. As a matter of fact, there exists a viable conjecture that the floor of $\pi/{\rm arctan}(1/\sqrt{M})$ is equal to the floor of $\sqrt{M}\pi$ for all values of $M=100^p$, but it works at least for the first billions of values of $p$... (anyway the offset, if any, would be just $1$; so this might only be a problem if at some point, the $p$ starting digits of $\pi$ end with $p/2$ nines.
It's more concise than Galperin's paper, indeed.

Let me return to the question: Why does $\pi$ appear in a counting problem? The answer is that the number of clacks is so large that it is effectively continuous (that's why I could discuss the small box as "gas" in the thermodynamic limit) and in this continuous limit, the counting of the number of clacks $N$ may be converted to an integral – and many integrals are proportional to $\pi$, you know. No extra conspiracy is needed to understand the presence of $\pi$.    