March 14, 3/14, or 3.14 is Pi Day. Those who live in countries that write the date backward may disagree and claim that Pi Day is 22 July (22 divided by 7). When I was young, I found the history of pi interesting, and I have never forgotten the anecdote of William Shanks.
A Brief History Of Pi
Pi, one of the most well-known mathematical constants (often represented by the lower-case Greek letter π), is the ratio of the circumference of a circle to its diameter. For any circle, the distance around the edge is slightly more than three times the distance across. Pi is an irrational number (a decimal number with no end and no repeating pattern). In fact, pi is the most widely studied number in all of mathematics. The number pi is essential to understanding geometry and has applications in physics, astronomy, mathematics, and space exploration. Used in architecture and construction, pi is an integral part of building everything from arches and bridges to the Pyramids of Giza.
The ancients knew about pi, but since they had no method to calculate a curve, they approximated pi to 3. Around 250 BC, Archimedes, a Greek mathematician, was the first to use an algorithmic approach to calculate pi. Archimedes drew a polygon inside a circle, drew a second polygon outside of the circle, and calculated their perimeters. For example, the perimeters of four-sided polygons would result in pi being between 2.8 and 4. Archimedes continued adding more and more sides to both polygons, getting closer and closer to the shape of the circle. Stopping when he reached 96-sided polygons, Archimedes proved that pi is between 3.1408 and 3.1429. In other words, Archimedes calculated pi to two decimal places (almost three) with at least a 99.97% accuracy. For most real-world problems, this was more than enough.
Over the next two millennia, others continued to use Archimedes’ method to calculate pi. By 1610, Ludolph Van Ceulen had spent most of his 70-year life calculating pi to 35 decimal places. He used polygons with 4,611,686,018,427,387,904 sides! After his death, 3.14159265358979323846264338327950288 was engraved on his tombstone. In Germany, pi is still sometimes called the “Ludolphine number”.
In 1665-1666, Sir Isaac Newton was quarantined at home due to the Great Plague of London. During this time, Newton generalized the binomial theorem leading to his method of fluxions. What we now call calculus. After this, no one calculated pi using Archimedes’ method. What took Ludolph Van Ceulen decades to calculate could now be done in weeks.
Which brings us to William Shanks. Shanks spent many years using the Manchin formula to calculate pi to 530 decimal places. He published a book about it in 1853. In April 1873, twenty years later, Shanks published another book in which he expanded his calculation of pi to 707 decimal places. This calculation remained unchallenged until 1944 when D. F. Ferguson, working with a mechanical desk calculator, found that Shanks had mistakenly calculated the 528th digit. In other words, his calculation of pi was correct only for the first 527 digits. TWENTY YEARS DOWN THE DRAIN!
In 1949, John von Neumann was the first to use a computer (ENIAC-Electronic Numerical Integrator and Computer) to calculate pi. It took him 70 hours to calculate pi to 2,037 digits.
In 2022, Emma Haruka Iwao, taking approximately 158 days using Google Cloud, calculated pi to 100 trillion digits. This is the current world record.
My Pi History
After buying my first computer, I remembered the story of William Shanks and I wanted to see how fast I could calculate pi. I found a pi-calculation program, inserted the floppy drive, revved up the 8.0 MHz CPU, typed in the command lines, and watched as all 640 KB of memory came to life. After fifteen minutes, I had correctly calculated pi to 707 decimal places. TAKE THAT WILLIAM SHANKS! Later, I plugged in the program’s maximum capacity and calculated pi to about 35,000 decimal places in just 4 and ½ days!
Curious about how fast my current computer is, I looked for a modern pi-calculating program.
Calc Pi is a multi-platform program for calculating pi to arbitrary precision (the digits of precision are limited only by the available computer memory). Calc Pi also calculates Euler’s number (the base of the natural logarithm) also known as the mathematical constant e. Calc Pi has a simple GUI and can take advantage of multi-threaded CPUs. Calc Pi displays the result in the bottom half of the window when the calculation is complete. You can scroll down to see the calculated digits. The digits are grouped in tens, and 50 digits are displayed per line. The offset of the first digit is displayed on the right. To save the result to a file, use the menu item File -> Save Result.
My AMD Ryzen 7 5700U laptop with 16 GB of RAM can compute pi to 35,000 digits in 0.01 seconds and to 100 million digits in 61 seconds. William Shanks must be sobbing in his grave!
If you run the Calc Pi program, let me know in the comments how fast your computer is able to compute pi.