March 14. Pi Day! We could hardly let such a day pass without a mention.
People have always been interested in
. Well, of course that isn’t true, but they’ve certainly been interested for a very long time. People love to calculate digits of pi, memorize and recite digits of pi … the mathematical sort tends to get very excited about pi. Possibly because we have so little to get excited about in general. But the actual digits themselves, calculating and memorizing them, aren’t half as interesting as the methods of calculation and the math behind them.
Pi is generally understood to be the ratio of the circumference of a circle to the diameter. This is constant, approximately 3.14159 and a bit. Of course, some people argue that a more ‘natural’ value for a circle is the radius, not the diameter, and as such the ‘more important’ or more natural value to be interested in is
. Whatever floats your mathematical boat.
And it’s certainly the circle interpretation that is at the heart of most methods of calculating pi. For example, taking a purely geometric approach, you can approximate a circle figure and from that, approximate pi. I think the Chinese were the first to use that particular method I use there, a long time ago. The Chinese are good for that sort of thing. Archimedes approximated pi by fitting circles in polygons, and calculating perimeters. Interesting fellow, Archimedes.
The natural extension of the geometric approach is to use trigonometry. The basic trig functions give us easy access to
. For example, consider the following



This gives us the relation

Now, recall the usual geometric series

Manipulating this, we have

Thus,

Power terms are easy to integrate, and the integral of a sum is the sum of the integrals. Applying that, the above yields the formula

Or, more clearly,

This is the Leibniz Series for pi. It’s sort of notorious, in that it converges incredibly slowly. It’s rather useless for actually calculating pi, but I find it to be one of the simplest formulae there is. The simplicity, it would seem, comes at a price.
Other trigonometric approaches are considerably more advanced. For example, Euler considered Machin-Like relations such as the following (which he apparently gave without proof).

To use this for computation, you use an expansion of ArcTan like I just demonstrated, except evaluating it at 1/2 and 1/3.


Notice that the denominators of the terms in these two formulae grow much faster than in the previous formula. Thus, convergence is much faster. Those two series, combined with Euler’s relation, give a much more efficient means for calculating pi. Euler goes on to derive far more impressive formulae for pi which I will not share here, but the techniques are all related.
You can see from the form of the series for ArcTan that the smaller the argument, the faster it converges. Evaluating it 1/3 converges much faster than evaluating it at 1, because of the exponential growth of the denominator. So it make sense then that better formulae could be achieved by using smaller arguments for ArcTan. At some point in time that I forget, someone I don’t remember calculated some large number of digits of pi using


By approximating one formula from above, and the other formula from below, you can compare the common digits that result, and be sure they are correct. This is a nice way of dealing with the fact that we don’t actually know the value of pi, and thus can’t, in a single approximation by itself, tell how good it is.
Most trigonometric approaches are just variants on the same theme, clever approximations of curious trigonometric relations. Of course, some are more interesting than others. the Wallis Formula for Sin(x) yields the interesting formula pi, a product instead of a sum.

I find things like this formula interesting because, for me at least, pi in the denominator seems positively unnatural. A curious preconception, well tested by the efforts of S. Ramanujan, a noted mathematician who, the story goes, would often erase all the work he did leading up to a result, because he just didn’t have the space to save it. And it is with Ramanujan, we start to leave the well tested waters of geometry and trigonometry to what some people might call deeper maths. This is very exciting to me, because it begins to suggest that pi is something more than the fundamental geometric constant most people consider it to be.
From him, we get the incredibly bizarre formula, based in number theory, that

Please don’t ask for a derivation of that. I have no idea. But it is really very good – each new term adds eight correct digits to the result. That is impressive. I’m impressed. Notice, again with the
. Very interesting.
Pi also shows up much more tractably in number theory. consider the following function,

This is the Riemann Zeta function. I don’t want to get into the details of it, but the distribution of prime numbers is related to the location of the zeros of that function. But of interest here is the fact that
, for s = 2n, a positive even integer, evaluates to
for some constant
. For example,

In terms of computing pi, this formula doesn’t really contribute much. Many formula converge much faster. But what’s interesting about the above formula is how it connects to the formula below, tying pi interestingly to prime numbers and factorizations. If
represents the k-th prime number (
),

Roughly translated, the product on the left is the probability of any two integers being relatively prime. That is to say, given two integers, the probability that they share a factor other than 1 is
, or about 0.6079. Pi, out of prime numbers and factorizations. Fascinating. Though I’m sure if I could understand Ramanujan’s formula, I’d find it fascinating as well. As it stands, he just boggles me.
From here, there are several other areas and approaches I could talk about. For example, there are elliptic integrals – a sort of generalization or extension of trigonometric functions, with connections to number theory as well. There are a number of rather inelegant formula for pi using elliptic integral techniques, one of which quadruples the number of correct digits in your approximation with each new iteration, which, I don’t mind saying, is quite impressive.
The last thing I’d like to mention is something near and dear to my heart, the BBP Formula for pi.

As pi formulae go, this is pretty good – you can tell by the
factor that the terms go to zero very vast, and thus it converges relatively quickly. But what makes this formula special is that it allows you to calculate the n-th digit of pi, without calculating all the previous digits. You can effectively jump to any digit you like and start calculating there.
This is a very striking property. Unfortunately, it only allows you to calculate digits in base 16, and in all likelihood there is no related base 10 formula. However, what really makes this formula significant in my book is that it was discovered experimentally. The discoverers considered summations of this form

For k = 0, 1, 2, 3, 4, 5, 6, 7. They calculated each summation to several hundred digits of accuracy, and then ran a computer algorithm on the results that discovered a way to combine the calculated values of each summation into a value that closely resembled pi. And, using that same combination on the full series, they were able to show that the above formula converged to pi exactly. The digit extraction property arose due to the form of the summation, and holds for all summations of the same form. But experimental math! I find that very exciting.
And life continues on. So far as I know, the record computations for pi (upwards of 1.24 trillion digits in 2002) are generally done using Machin-esque formulae like the ones discussed, but BBP-esque formulae are used for calculating various digits of pi, such as the quadrillionth, which happened to be a zero. There are clearly far more steps in the history and math behind pi, but in writing something like this, just as in computing the digits of pi, eventually you just have to say it’s time to stop.
Happy Pi Day!