Throwing $\pi$ at a wall
M. Z. Rafat, D. Dobie

TL;DR
This paper presents a method to approximate pi by counting elastic collisions between two masses and a wall, where the number of collisions encodes the digits of pi, linking physics to mathematical constants.
Contribution
It introduces a novel physical simulation approach to calculate pi using elastic collisions, connecting classical mechanics with number theory.
Findings
Number of collisions equals the first d digits of pi
Method accurately encodes pi in collision counts
Applicable for integer values of d in the collision model
Abstract
We discuss a method for calculating using elastic collision between two masses and , with where is an integer, and a wall. The total number of collisions between , and the wall corresponds to the first digits of .
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsAdvanced Topology and Set Theory · Polynomial and algebraic computation
Throwing at a wall
M. Z. Rafat
Sydney Institute for Astronomy, School of Physics, University of Sydney, NSW 2006, Australia
D. Dobie
Sydney Institute for Astronomy, School of Physics, University of Sydney, NSW 2006, Australia
ATNF, CSIRO Astronomy and Space Science, PO Box 76, Epping, NSW 1710, Australia
Abstract
We discuss a method for calculating using elastic collision between two masses and with where is an integer, and a wall. The total number of collisions between , and the wall corresponds to the first digits of .
Introduction
Obtaining an accurate value of is one of the oldest problems in mathematics. Early approximations of accurate to one decimal place dating back nearly 4000 years have been discovered in Babylon and Egypt (Beckmann, 1971). The oldest known algorithm for calculating is attributable to Archimedes who placed upper and lower bounds on its value by inscribing and circumscribing n-sided regular polygons on a circle in his treatise Measurement of a Circle. The advent of computers has enabled much faster and more accurate calculations of , and the current best algorithm is capable of computing it to 22 trillion decimal places111https://pi2e.ch/blog/2016/10/31/hexadecimal-digits-of-pi/. A recent video published by 3Blue1Brown222https://www.youtube.com/watch?v=HEfHFsfGXjs brought our attention to an unusual method of calculating originally discovered by Galperin (2003). While the efficiency of this method pales in comparison to modern algorithms, it is certainly a novel approach.
An object of mass moves along a frictionless surface towards a second object of mass which is stationary, before colliding perfectly elastically with it (i.e. no energy is lost in the collision), propelling the second object towards an immovable wall. The second object undergoes perfectly elastic collision with the wall and is reflected back off the wall and collides again with the first mass as seen in the diagram in Figure 1. This process repeats until both objects are moving away from the wall and the speed of the first object exceeds the speed of the second. Galperin (2003) found that if the ratio of masses, , is of the form , where is a positive integer, then the number of collisions is an integer consisting of the first digits of .
Galperin (2003) and Aretxabaleta et al. (2017) consider the position and velocity of both objects and treat the problem as a billiard system where particles collide with each other and immovable boundaries. In this paper we take a different approach to achieve the same result and instead consider the evolution of the velocity phase-space of the system.
Mathematical formulation
Our system consists of masses and with velocities and , respectively, with magnitudes and . Collisions between the masses conserve both energy and momentum as we assume perfectly elastic collisions and ignore all external forces. The collision between mass and the wall switches the sign of the velocity of . Therefore each collision with the wall results in change of momentum of the system while leaving the kinetic energy unaffected. The kinetic energy and momentum of the system may be written, respectively, as
[TABLE]
where is the initial speed of . We choose the positive direction to be along the negative horizontal axis (towards the wall). Henceforth we denote and simply as and with the direction indicated by their signs. The velocity of and after they collide is given by
[TABLE]
where and and denote the velocity of and before the collision, respectively. We may express (1) as
[TABLE]
where and . Valid solutions for and are then given by the points of intersection of a straight line arising from the momentum equation with the kinetic energy ellipse. We may express the collision of and using (2) as where
[TABLE]
Similarly the collision with the wall may be expressed as with . Denoting the velocity after collision with a subscript allows us to write for odd and even, respectively, as
[TABLE]
where
[TABLE]
The odd values of corresponds to collision between and while the even values correspond to collision between and the wall. It follows from (5) that for odd and even we have
[TABLE]
respectively. We may write and with
[TABLE]
where
[TABLE]
This allows us to express (5) as
[TABLE]
for odd and even, respectively, where
[TABLE]
The matrices and are rotation matrices which, respectively, rotate a vector anti-clockwise and clockwise along an ellipse of the form for any real . This implies that for odd (even) the velocity is obtained from ( through an anti-clockwise (clockwise) rotation along an ellipse of the form for any real . We can express (10) as
[TABLE]
where for odd values of , and for even values of . This of course denotes the same ellipse as given by (3).
Figure 2 shows the ellipse described by the kinetic energy equation (3) for and . The dots lying on the ellipse denote points as given by (12) with the arrows trace their development in phase space. The process starts at , corresponding to , and continues until the speed of the larger mass, , exceeds the speed of the smaller mass, , and the larger mass is moving away from the wall: and . Geometrically this corresponds to being in the third quadrant of the energy ellipse.
Each solution as given by (12) is of the form so that the angle makes with the horizontal axis satisfies . In particular for the first collision the angle is and the area subtended is given by
[TABLE]
The area subtended by successive solutions and in the upper/lower portion of the ellipse is given by
[TABLE]
where the absolute value ensures that is positive for both positive (odd ) and negative (even ) angles. Now, using (7) we have
[TABLE]
where upper (lower) sign corresponds to odd (even) values of . This then gives
[TABLE]
Substituting into (14) gives
[TABLE]
Therefore the area subtended by all adjacent solutions are equal.
Now, let denote the ratio of area of the energy ellipse and :
[TABLE]
The series is absolutely convergent for . For (equal mass) we have and for , with , we may approximate as
[TABLE]
with maximum error of for . This number approximately corresponds to the number of sectors that the energy ellipse is divided into, , noting that for , as the final velocity vector is not precisely at as shown in Figure 3.
However, since the total number of collisions must be an integer, we can overcome this discrepancy by rounding, which gives
[TABLE]
noting that for , there are 3 collisions but is precisely equal to 4 which precludes us from using the floor function. Substituting (20) into (21) we find that the integer consists of digits corresponding to first digits of .
Discussion and Conclusions
The framework that we have developed is analogous to Kepler’s Second Law, which states “A line joining a planet and the Sun sweeps out equal areas in equal time” (Kepler, 1609). In fact, this problem has ties to Keplerian motion in another way, in that particle collisions may be treated as an approximation to the dynamics of a satellite performing a slingshot maneuver around a massive object.333http://www.physics.usyd.edu.au/teach_res/mp/doc/mec_slingshot.htm
While the mass required to compute consecutive digits of grows exponentially, rendering physical implementation of this method untenable, it is, nevertheless, possible to determine the first few digits of through physical experiments. The most famous example is Buffon’s Needle (de Buffon, 1777) where a needle is dropped onto floorboards. The fraction of needles that lie across two boards is then dependent on the length of the needles, the distance between floorboards (which are both measurable quantities) and . This method has been used to calculate to 5 decimal places using only three thousand needles (Lazzarini, 1901).
We note that while this experiment is entirely non-physical, qualitatively similar phenomena do occur in nature. Explosive astrophysical events such as solar flares (Ellison & Ramaty, 1985), supernovae (Reynolds & Ellison, 1992) produce observable outflows and shock waves. The primary mechanism by which these shock waves are driven is thought to be Fermi acceleration, where charged particles (analogous to the masses in our experiment) are repeatedly reflected by a magnetic mirror (analogous to the wall). This is also thought to be the origin of cosmic rays (Blandford & Eichler, 1987).
We have found a solution to the unusual method of calculating proposed by Galperin (2003). By considering constraints on the velocity phase-space of the system imposed by the conservation of energy and momentum, we take a geometric approach to show that if the ratio of masses of the two objects is of the form then the number of times they collide is given by the first digits of .
Acknowledgements
We thank A. Zic and M. Wheatland for useful discussions. We thank Grant Sanderson of 3Blue1Brown for bringing our attention to the topic.
MZR is supported by the Australian Research Council through grant DP160102932. DD is supported by an Australian Government Research Training Program Scholarship. This research has made use of NASA’s Astrophysics Data System Bibliographic Services.
Software: Matplotlib (Hunter, 2007), Numpy (van der Walt et al., 2011)
The reference list from the paper itself. Each links out to its DOI / PubMed record.
- 1Aretxabaleta et al. (2017) Aretxabaleta et al. 2017, ar Xiv preprint ar Xiv:1712.06698
- 2Beckmann (1971) Beckmann. 1971, Martin’s Press, 197, l
- 3Blandford & Eichler (1987) Blandford & Eichler. 1987, Phys. Rep., 154, 1
- 4de Buffon (1777) de Buffon. 1777, Euvres philosophiques
- 5Ellison & Ramaty (1985) Ellison & Ramaty. 1985, Ap J, 298, 400
- 6Galperin (2003) Galperin. 2003, Regular and Chaotic Dynamics, 8, 375
- 7Hunter (2007) Hunter. 2007, Computing in Science and Engineering, 9, 90
- 8Kepler (1609) Kepler. 1609, Astronomia Nova.
