This video is about an interesting math/physics problem that when cranked out churns out digits of $\pi$.

Is there an intuitive reason that $\pi$ is showing up instead of some other funky number like $e$ or $\phi$, and how can one predict without cranking it out that the solution has something to do with the mysterious $\pi$?

Edit to answer jay:

You need not watch all of it, but I'll attempt a quick summary.

Let the mass of two balls be $M$ and $m$ respectively. Assume that $M=16 \times 100^n m$. Now, we will roll the ball with mass $M$ towards the lighter ball which is near a wall. How many times do the balls touch each other before the larger ball changes direction? (The large ball hits the small ball which bounces off the wall)

The solution is the first $n+1$ digits of $\pi$.

  • 3
    $\begingroup$ I have to watch a 13 minute video to understand the problem? Why not summarize it for us? $\endgroup$
    – Joe
    Commented Apr 29, 2012 at 2:49
  • 1
    $\begingroup$ In addition to what picakhu's recent edit adds, one should mention that it is asserted that the shapes of the balls don't matter. $\endgroup$ Commented Apr 29, 2012 at 2:58
  • 6
    $\begingroup$ calculus7.org/2012/03/14/… $\endgroup$ Commented Apr 29, 2012 at 6:59
  • $\begingroup$ @AngelaRichardson, interesting link, still lacking the intuition that I am looking for. i.e. why scale w.r.t the masses to see the hidden angle and then how to realize that pi will come in? $\endgroup$
    – picakhu
    Commented May 1, 2012 at 12:39
  • 2
    $\begingroup$ In any case, I thank you for drawing my attention to this beautiful problem. $\endgroup$
    – Phira
    Commented May 4, 2012 at 15:54

3 Answers 3


What an interesting problem! I will try to explain only the intuition, as much as possible, and leave the discussion of the math to Galperin's original translated paper which, aside from a few typos, is quite accessible. Also, I will not follow the exact method in the video, but rather follow Galperin's original method, as I believe it is easier to understand that way. The main difference is that in Galperin's original method, all bounces in the system are counted, not just those between the two balls. This also results in a different relationship between the mass of the large ball and the mass of the small one, but it's the same basic idea. In particular, $\pi$ shows up for the same reason.

First, let's set up the problem as shown below:

Billiard Ball Step 1

Place the large ball of mass $M$ on the line $\ell$, and place the small ball of mass $m$ between the large ball and the wall. Let the distance of the small ball from the wall at time $t$ be given by the function $x(t)$, and let the distance of the large ball from the wall be given by the function $y(t)$. Now this gives us a way of representing the position of both balls as a point $P(t)=(x(t),y(t))$ in the Cartesian plane, $\mathbb R ^2$.

Play around with this a bit to recognize what various parts of the plane correspond to. First, since the little ball is always between the large ball and the wall, $x(t)\le y(t)$ and so the point $P(t)$ will be between the $y$-axis and the line $y=x$. For instance, when the little ball hits the wall, then $x(t)$ will be zero, and so the point $P(t)$ will be on the $y$-axis. When the large ball hits the little ball, then $y(t)=x(t)$ so the point will be on the line $y=x$. This gives us a good way of visualizing all activity in the system as the movement of a point in the two dimensional plane.

enter image description here

Now let's set up a relative criteria for the masses $M$ and $m$ (and here is where I deviate from the video). Let $M=100^Nm$, roll the large ball toward the small ball with some velocity $V$, and let's count the total number of bounces in the system. If the masses were equal, when $N=0$, we would get three total bounces in the system:

  1. The "large" ball would hit the "small" ball and, similar to Newton's cradle, all the velocity of the moving ball would be transferred to the second with the first bounce.
  2. The "small" ball would bounce against the wall and, conserving kinetic energy, move in the opposite direction with the same speed as going in.
  3. The "small" ball would bounce against the "large" ball, transferring all it's momentum into the "large" ball.

This is 3 bounces, which happens to be the first digit of $\pi$. The point $P(t)$ will follow the dotted path outlined in Figure A. Since the masses were equal, note that we have a very nice reflective property of the path of $P(t)$, that is, the angle of incidence is equal to the angle of reflection when it "bounces" against $y=x$ and the $y$-axis. If the masses are unequal, however, this reflective property does not hold because the "large" ball will keep moving with some velocity toward the wall (see Figure B.).

To explain why this reflective property is desirable, let's "fold-out" the angle between the $y$-axis and the line $y=x$ for the case when the masses are equal, as shown in Figure C. (Think of flipping the angle over on itself in a clockwise manner.)

enter image description here

The dotted line still represents the movement of $P(t)$, but every time it would have bounced off of an object, this time it passes into the next folded-out section of the angle instead. Because the angle of incidence is equal to the angle of refraction, we have that the path of $P(t)$ is just a nice straight line, and it is very easy to see that it bounces three times. If only we could get the reflective property to hold when the masses were different sizes...

Well, as it turns out (and this does require some math to verify), we can get the reflective property to hold when the masses are different sizes by scaling the graph differently in the $y$ and $x$ directions. First, verify yourself that the ball bouncing against the $y$-axis always has the reflective property, and note that it doesn't matter how you scale the graph (stretch it in the $y$ or $x$ direction, and the bounce of $P(t)$ against the $y$-axis will still be reflective). Thus we only have to scale it in a way so that the bounce off the $y=x$ line is reflective. If you think about it, scaling the graph with different scales for the $x$ and $y$ axis will be akin to changing the angle of the $y=x$ line, and so what we want to do is "rotate" the $y=x$ line to a point where the reflective property holds. As it turns out, and again this does require some math to verify, the proper choice of scaling is $Y=\sqrt M y$ and $X=\sqrt m x$.

enter image description here

This scaling changes the angle between the $y$-axis and the line that represents a bounce between the two balls, which is now $Y=\sqrt{\frac M m}X$. Take the point $Y=\sqrt M$ and $X=\sqrt m$ which is on this line, and note that the triangle thus created by the points $(0,0)$, $(0,\sqrt M)$, and $(\sqrt m, \sqrt M)$ yields that $\tan(\theta)=\sqrt {\frac m M}$. Now, let's "fold-out" the angle, which now has the reflective property:

enter image description here

It's no matter that this angle doesn't perfectly divide $\pi$ (Ahah! There it is!), we do note however that the resulting "folding-out" of an angle will make $\left \lceil \frac \pi \theta \right \rceil$ copies of the angle, and therefore the line $P(t)$ will intersect $\left \lfloor \frac \pi \theta \right \rfloor$ lines. This is why the number that comes out is related to $\pi$!

Now the punchline: we have that $\tan \theta = \sqrt \frac m M$, so $\theta = \arctan \sqrt {\frac m M}$. When we set $M = 100^N m$ for some $n\in \mathbb N$, we have that

$$\theta = \arctan \sqrt {\frac m {100^N m}} = \arctan \sqrt {100^{-N}}=\arctan {10^{-N}}$$

And therefore $P(t)$ will intersect $\left \lfloor \frac \pi {\arctan 10^{-N}} \right \rfloor$ lines, which is exactly the same as saying the system will have exactly $\left \lfloor \frac \pi {\arctan 10^{-N}} \right \rfloor$ collisions. Now Galperin argues that

$$\left \lfloor \frac \pi {\arctan 10^{-N}} \right \rfloor \approx \left \lfloor \frac \pi {10^{-N}} \right \rfloor= \left \lfloor \pi 10^N \right \rfloor$$

and proves that it is exactly equal for values of $N<100,000,000$. He conjectures that it also holds more generally, but this is not proven. Clearly, $\left \lfloor \pi 10^N \right \rfloor$ is precisely the first $N+1$ digits of $\pi$!

This approach seems to make $\pi$ naturally come out, but (unless I'm mistaken, which is certainly possible) you can make the number of bounces line up with any number you'd like. For instance, let $M=\frac {\pi^2} {e^2} 100^N m$. Then we would end up with the number of bounces equal to $\left \lfloor e 10^N \right \rfloor$, that is, the first $N+1$ digits of $e$. Of course the interesting thing about the "natural" choice of $M=100^N m$ is that it does not depend on already knowing the value of $\pi$ in order to calculate it. On the other hand, if you had a need to create a physical system which bounced a particular number of times, you now can do it.

In fact, if you're willing to accept an uglier mass relation between the two balls, you can get it exact without resorting to Galperin's approximation. Just let $M=\cot^2(10^{-N})m$.

  • 2
    $\begingroup$ Where'd the 16 go? $\endgroup$ Commented May 7, 2012 at 16:19
  • 2
    $\begingroup$ Very nice. But, as per my earlier comment, your balls should be sliding rather than rolling. $\endgroup$ Commented May 7, 2012 at 17:06
  • 1
    $\begingroup$ @RobertIsrael True, the model is actually treating the balls as point masses. There's some trouble just from the fact that the spheres could never hit one another truly "head-on" if they were different sizes as well, but the idea of it helps the intuition. $\endgroup$
    – mboratko
    Commented May 7, 2012 at 17:10
  • 1
    $\begingroup$ @nbubis Thanks! $\endgroup$
    – mboratko
    Commented May 7, 2012 at 18:04
  • 3
    $\begingroup$ @picakhu Careful in calling that "Angela's method". The blog belongs to Leonid Kovalev, so you should really refer to it as Leonid's method... or Angela's link's method if you must. $\endgroup$ Commented May 9, 2012 at 22:20

Given two objects (sphericity is irrelevant) of masses $M$ and $m$ such that $\frac{M}{m} = 16 \cdot 100^{N}$, where $N$ is a non-negative integer, one computes the number of elastic collisions to stop $M$ (initially moving at a velocity $u_0$) is equal to the integer part of $10^N \pi$. The $\pi$ comes from determining the zeros of the cosine function appearing in the velocity formula $u_{n} = (1 + \frac{m}{M}) \sqrt{\frac{m}{M}} \cos(n \theta) \ u_0$ after $n$ collisions, where $\theta = \frac{M - m}{M + m}$.

See http://www.flickr.com/photos/numberphile/6976718861/in/photostream/lightbox/

enter image description here

  • 2
    $\begingroup$ Thanks a lot for your answer, although being straight from the video it is not very helpful. $\endgroup$
    – picakhu
    Commented May 7, 2012 at 12:16
  • $\begingroup$ Well, the "intuitive reason" for the appearance of $\pi$ is pretty obvious if you understand the problem and highly non-trivial without its solution. $\endgroup$
    – user02138
    Commented May 8, 2012 at 15:06
  • $\begingroup$ The trick I was looking for (and this is clear in Michaels post) is that an appropriate scaling causes the "bounces" to become a straight line. $\endgroup$
    – picakhu
    Commented May 8, 2012 at 21:10

An easier way to see this is as follows.

Conservation of energy implies that the point (u, v) where u and v are the velocities of the balls, lies on an ellipse at all times. Rescaling u and/or v results in a circle (hence the connection to pi). More explicitly, conservation of momentum shows that the point on this circle, after each collision between the balls, moves by equal increments. The number of increments before u changes sign (or equivalently, the point on the circle has rotated through an angle of pi/2), allows the calculation of pi. I won't do the calculation here, but it is quite straightforward.

I have just discovered that my proof was already known--I might have guessed as it is the obvious approach.

Note that, by replacing 10 by b, it is clear that this phenomenon is true in base b.

A minor point, that probably IS original, is that the Nth digit after the decimal point of pi is not guaranteed correct--it could be too small by 1. This is because the approximation is based on replacing the arctangent with the angle itself. However the digit will be incorrect only if the next 2N + log_10(48) digits are zero. I doubt if the such a sequence occurs in the decimal expansion of pi. If pi behaves like a random sequnce of digits, the conditional probability that this ever happens, given that it has not occurred in the first billion digits is extremely small (of the order of 10^-2billion).

There could be some base, other than 10, for which the Nth digit after the point is incorrect. If it does happen, it would almost certainly only happen when N is small.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .