Between a block and a hard place
Early this year, I saw a popular video on TikTok demonstrating a very unusual way of computing the digits of \(\pi\) using basic physics. At the time, I rederived the solution in a couple hours and then moved on. However, I was reminded of the problem recently and realized it might make for interesting blog material. Although I'm sure it's been written about countless times by now due to its popularity, I still felt the urge to redo the problem with extra rigor and write about it.
@3blue1brown I’m still astounded this is true. #math #physics ♬ original sound - Grant Sanderson
The setup is as follows: two blocks of masses \(m\) and \(M\), \(m < M\), lie on a frictionless plane. There is a wall behind the smaller block, and the larger block slides towards it with velocity \(V_0\). The larger block collides with the smaller block, which rebounds off the wall like a squash ball, over and over, until the larger block is completely turned around towards the direction it came from.
The interesting part comes when you count the total number of collisions before the two blocks stop colliding. When the ratio of the masses is \(M = 10^{2k} m\), \(k = 0, 1, 2, ...\), then the digits of the number of collisions are \textit{exactly} the first \(k + 1\) digits of \(\pi\). In this blog post, I will prove this unusual fact, and explore the problem a bit more along the way.
The solution
Using conservation of momentum and kinetic energy, we can solve for the velocity of the larger block after the \(n\)th collision between the two blocks: \begin{align} V_{n+1} &= \frac{M - m}{M + m} V_n + \frac{2 m}{M + m} v_n \label{eqn:Vnplus1} \end{align} Note that \(n\) is the number of collisions between the two blocks, \textit{not} the total number of collisions in the system, which also includes collisions between the smaller black and the wall. We will add in a factor of 2 at the end to adjust.
The initial kinetic energy of the system is \(M V_0^2 / 2\), so, by conservation of energy, we can write the velocity of the smaller block \(v_n\) as \begin{align} v_n = -\sqrt{\frac{2}{m} \left(\frac{1}{2} M V_0^2 - \frac{1}{2} M V_n^2\right)} = -\sqrt{\frac{M}{m} (V_0^2 - V_n^2)} \label{eqn:vn} \end{align} Introducing the parameter \(\mu = \sqrt{m / M}\) and combining (\ref{eqn:Vnplus1}) with (\ref{eqn:vn}), we get the following recurrence relation for \(V_n\): \begin{align} V_{n+1} = \frac{1 - \mu^2}{1 + \mu^2} V_n - \frac{2 \mu}{1 + \mu^2} \sqrt{V_0^2 - V_n^2} \label{eqn:Vnplus1_} \end{align} An exact solution to this recurrence relation is not practical, but we can find a simple \textit{approximate} answer. Instead of a sequence, we interpret \(V_n\) as a differentiable function \(V(n)\). Assuming the higher derivatives of \(V(n)\) are not too large, we can approximate \begin{align*} V(n+1) \approx V(n) + \frac{\mathrm{d} V}{\mathrm{d} n} \Delta n, \end{align*} with \(\Delta n = 1\). Inserting this into (\ref{eqn:Vnplus1_}) gives a separable differential equation for \(V(n)\): \begin{align*} \frac{\mathrm{d} V}{\mathrm{d} n} = -\frac{2 \mu^2}{1 + \mu^2} V - \frac{2 \mu}{1 + \mu^2} \sqrt{V_0^2 - V^2} \end{align*} However, since we are interested in finding \(n(V)\) rather than \(V(n)\), we invert the equation: \begin{align} \frac{\mathrm{d} n}{\mathrm{d} V} = -\frac{1 + \mu^2}{2 \mu} \frac{1}{\mu V + \sqrt{V_0^2 - V^2}} \label{eqn:diffeq} \end{align}
Before moving on, we have to make another approximation, which ultimately won't affect the answer, in order to put off certain technical difficulties. Assuming \(\mu\) is small, we can drop the linear term from the denominator, as well as the \(\mu^2\) in the coefficient: \begin{align} \frac{\mathrm{d} n}{\mathrm{d} V} \approx \frac{1}{2 \mu} \frac{1}{\sqrt{V_0^2 - V^2}}. \label{eqn:diffeqapprox} \end{align} This corresponds to the non-momentum-conserving approximation, valid when \(M >> m\), that the smaller block causes an impulse equal to \(\Delta p = 2 m \Delta v\) when colliding with the bigger block, which is equivalent to the recurrence relation \begin{align*} V_{n+1}' \approx V_n' - 2 \mu \sqrt{V_0^2 - V_n'^2}. \end{align*} We get the same solution either way, but we will circle back to this later when we address it and other technical questions.
![]() |
| The solution n(V) |
Continuing, equation (\ref{eqn:diffeqapprox}) is an elementary integral, yielding the solution \begin{align*} n(V) &= -\frac{1}{2 \mu} \int_{V_0}^V \frac{1}{\sqrt{V_0^2 - v^2}} \mathrm{d} v \\ &= \frac{1}{2\mu} \left[\frac{\pi}{2} - \sin^{-1} \frac{V}{V_0}\right]. \end{align*} Plugging in the final velocity \(V = -V_0\), our answer is \begin{align*} N_\mathrm{max} = n(-V_0) = \frac{\pi}{2 \mu}. \end{align*} We just need to account for three things. First, \(n\) only counts collisions between the two blocks, not collisions between the smaller block and the wall, so we must double the solution. Second, we plug in \(\mu = 10^{-2k}\), \(k \in \mathbb{N}\), as in the original problem set up. Last, our answer cannot include fractional bounces; the final velocity will not necessarily be exactly equal to \(-V_0\), so we have to round down to the nearest integer. This gets us the answer we expected, \begin{align*} N_\mathrm{tot} = \left\lfloor10^k \pi\right\rfloor. \end{align*}
Error analysis
Because we solved an ODE instead of the original recurrence relation, we have to do a simple error analysis to show that our answer is actually correct down to the final digit as the ratio \(M / m\) gets large. We express the error \(\epsilon_N\) in calculating the \(N\)th term in the sequence as \[ n(V_N) = N + \epsilon_N. \] By plugging in our expression (\ref{eqn:Vnplus1_}) for \(V_{N+1}\), we obtain a recurrence relation for \(\epsilon_N\): \begin{align*} n(V_{N+1}) &= N + 1 + \epsilon_{N+1} \\ &= \frac{1}{2 \mu} \left[\frac{\pi}{2} - \sin^{-1} \frac{V_{N+1}}{V_0}\right] \\ &= \frac{1}{2 \mu} \left[\frac{\pi}{2} - \sin^{-1} \frac{V_N}{V_0} + 2 \mu + O\left(\mu^3\right)\right] \\ &= N + 1 + \epsilon_N + O\left(\mu^2\right). \end{align*} Since \(\epsilon_0 = 0\), we have \(\epsilon_N = \sum_{k=0}^N O\left(\mu^2\right) = O(N \mu^2)\). Plugging in \(N_\mathrm{max} = \pi / 2 \mu\), the total error is \(\epsilon = O\left(N_\mathrm{max} \mu^2\right) = O(\mu)\), Or, equivalently, \[ N_\mathrm{tot} = \frac{\pi}{\mu} + O(\mu). \] When \(\mu = 10^{-k}\), the error falls off very quickly. From the TikTok video, we can see that the solution is already exact for the first few values of \(k\), so we conclude that the error is negligible for any \(k\).
Periodic behavior
![]() | |
| If allowed to go past the stopping point, the system will eventually return to where it started. |
One of the most startling features of this solution is that, if \(V_n \leq -V_0 / \sqrt{1 + \mu^2}\), then \(V_{n+1} > V_n\). If, after this turning point, we flip the sign of \(v_n\) as well, then this system oscillates back and forth between \(-V_0\) and \(V_0\) forever. Indeed, we can solve for \(V\) in terms of \(n\) to get \[ V(n) = V_0 \sin\left(\frac{\pi}{2} - 2 \mu n\right). \] At first, this seems like it must be some kind of fluke, but this phenomenon has a simple explanation. When \(|v_n|\leq |V_n|\), the smaller block is moving more slowly than the larger block, so a solution where the smaller block collides with the larger block from behind is not physical. However, the very same equation for \(V_{n+1}\) \textit{does} represent a valid solution where the larger block hits the smaller block from behind with the same velocities. We can think of this as a mirror-image boundary condition for the behavior of the system past the stopping point. There is, however, another choice of boundary condition, which we will explore next.
Non-periodic solution and stopping point
In the final section of this post, we will return to our ODE (\ref{eqn:diffeq}) and solve it exactly, showing that we obtain the same value of \(N_\mathrm{tot}\), as well as answering a final technicality regarding the stopping point of our sequence \((V_n)\).
The solution to our full ODE can be obtained with only modest difficulty with aid of a computer algebra system: \begin{align*} n(V) &= -\frac{1 + \mu^2}{2 \mu} \int_{V_0}^V \frac{1}{\mu v + \sqrt{V_0^2 - v^2}} \mathrm{d} v \\ &= \frac{1}{2\mu} \left[\sin^{-1} \frac{V}{V_0} + \mu \log\left(\mu V + \sqrt{V_0^2 - V^2}\right)\right]_V^{V_0} \\ &= \frac{1}{2\mu} \left[\frac{\pi}{2} - \sin^{-1} \frac{V}{V_0} - \mu \log\left(\frac{V}{V_0} + \frac{1}{\mu}\sqrt{1 - \frac{V^2}{V_0^2}}\right)\right]. \end{align*} Again employing the assistance of a CAS, we determine that \begin{align*} \mu \log\left(\frac{V_{N+1}}{V_0} + \frac{1}{\mu}\sqrt{1 - \frac{V_{N+1}^2}{V_0^2}}\right) - \mu \log\left(\frac{V_N}{V_0} + \frac{1}{\mu}\sqrt{1 - \frac{V_N^2}{V_0^2}}\right) = O\left(\mu^3\right), \end{align*} so the new term in this solution contributes no appreciable additional error.
![]() |
| The asymptotic solution to the singular ODE, μ = 0.1. |
However, this new solution behaves significantly different from recurrence relation, and the first solution we explored, in that, rather than being periodic, \(n(V)\) tends to infinity as \(V \rightarrow V^* = -V_0 / \sqrt{1 + \mu^2}\) due to the singularity in the ODE at \(V^*\). As \(|V_n|\) gets larger, \(|v_n|\) gets smaller, transferring less and less momentum with each collision, asymptotically approaching 0 but never reaching it, not unlike a plug being pushed down a long tube by an expanding gas. This is an alternative, equally physically plausible interpretation of the discrete sequence \((V_n)\) as a continuous function. Based on the error analysis, though, we \textit{should} still be able to get the same answer as before.
This is the perfect segue into our next fussy technical point: the stopping condition. Previously, we assumed that \(V_n = -V_0\) was our stopping point and took \(N_\mathrm{max} = \lfloor n(-V_0)\rfloor\), but that won't work with this solution, nor will plugging in \(n(V^*)\). In fact, we were never fully justified in taking the floor of \(n\) as our solution in the first place, because we didn't demonstrate that the system doesn't actually stop at some smaller \(n\) than that. We can now kill two birds with one stone by taking the stopping point into account while including the extra term in our solution.
![]() |
| Visualization of the stopping point threshold and our bounds on \(V_{N_\mathrm{max}-1}\). |
The collision process ends at the first \(n\) where \(|v_n| \leq |V_n|\), at which point the smaller block is moving slower than the larger block and cannot catch up to it. (Cool aside: the sign of \(v_n\) is determined by the \(k\)th digit of \(\pi\). If the \(k\)th digit is odd, then \(v_n\) is positive. If it is even, then \(v_n\) is negative.) By solving \(|v_n| = |V_n|\), we see that the exact final value of \(V_n\) may vary between \(-V_0\) and \(V^* = -V_0 / \sqrt{1 + \mu^2}\); however, it will always be the first value \(V_n < V^*\). We can't simply plug in \(N_\mathrm{max} = n(V^*)\) because it explodes, but we \textit{can} solve for \(N_\mathrm{max} - 1\). The stopping point is between \(-V_0\) and \(V^*\); by setting \(-V_0 \leq V_{N_\mathrm{max}} \leq V^*\) and inserting into (\ref{eqn:Vnplus1}), we get \begin{align*} -\frac{1 - \mu^2}{1 + \mu^2} V_0 \leq V_{N_\mathrm{max} - 1} \leq -\frac{1 - 3\mu^2}{1+\mu^2} V_0. \end{align*} From this, we get \begin{align*} N_\mathrm{max} > n\left(-\frac{1 - \mu^2}{1 + \mu^2} V_0\right) \geq N_\mathrm{max} - 1 + O(\mu) \geq n\left(-\frac{1 - 3\mu^2}{1+\mu^2} V_0\right) > N_\mathrm{max} - 2. \end{align*} If we take the floor of all this stuff, we see that \begin{align*} N_\mathrm{max} = \left\lfloor n\left(-\frac{1 - \mu^2}{1 + \mu^2} V_0\right)\right\rfloor + 1 + O(\mu). \end{align*} Taking Taylor series, \begin{align*} n\left(-\frac{1 - \mu^2}{1 + \mu^2} V_0\right) = \frac{1}{2 \mu} \left(\frac{\pi}{2} - \sin^{-1} 1 - 2 \mu + O(\mu) - \mu \log(2 + O(\mu))\right) = \frac{\pi}{2 \mu} - 1 + O(\mu). \end{align*} This finally proves, once and for all, the correctness of our solution, whichever solution we choose. I've already spent way more time than I should have on this blog post, so here is where I will finally end it!




Comments
Post a Comment