# Approximating pi

Every 14 March (or 3/14 in US format) for the last few years I’ve noticed an increasing amount of joviality and excitement about the constant $\pi$ ($\approx 3.141592653\ldots$).  I assumed for a while that this was one of those internet-originating fads like Talk Like a Pirate Day (19 September) or the related Talk Like a Pilot Day (19 May): a bit of fun but (the adoption of Talk Like a Pirate Day as a religious holiday by the Church of the Flying Spaghetti Monster notwithstanding) essentially a bit of annual silliness.  But it turns out that Pi Day has a slightly more serious heritage: Wikipedia tells us that it was founded in 1988 by Larry Shaw, a physicist working at the Exploratorium, an amazing interactive science museum in San Francisco.  A ceremony is held at 1:59pm on 14 March, culminating in the participants singing happy birthday to Albert Einstein (born on that day in 1879).  In 2009, the US House of Representatives passed a non-binding resolution recognising the date as National Pi Day.

I’m in two minds over whether this sort of thing has a net positive effect on public understanding of mathematics, or whether (like those tedious corporate PR-driven “magic equation” stories that keep turning up in newspapers, and on which Ben Goldacre has eloquently grumbled several times) it merely serves to trivialise the subject and present mathematicians as just interested in numbers and hard sums.  I suppose it depends on how it’s presented: the situation wasn’t entirely helped by the recent news items about a supposed battle between the mathematical establishment and a small group of mavericks and renegades over whether $\pi$ or $\tau=2\pi$ is the more natural constant to use in most circumstances.  But by and large I think Pi Day is probably a good thing: it gets people thinking about mathematics and helps inspire some children to go and find out more (in particular this is the intention of the people behind the whole thing, and also explicitly stated as such in the resolution passed by the House of Representatives).

But today, 22 July, is Pi Approximation Day: a well-known rational approximation to $\pi$ is given by 22/7 ($=3.\overline{142857}$).  Actually, 22/7 gives a slightly better approximation to the value of $\pi$ than 3.14; an even better one is given by $\frac{355}{113} \approx 3.1415929203\ldots$ but that hasn’t easily translated into a date since the reign of the Roman Emperor Constantius II.

In my EC119 Mathematical Analysis exam this year I set a question requiring the students to calculate the Taylor-MacLaurin series for the function $\arcsin x$ near $x=0$ up to fifth order and use this (together with the fact that $\sin\frac{\pi}{6}=\frac{1}{2}$) to obtain a rational approximation to the value of $\pi$.

I thought this was an interesting bit of a question, but relatively few of them attempted it (which, I guess, goes to show that examiners and students have different ideas about what constitutes an “interesting” exam question).  Anyway, the fifth-order Taylor-MacLaurin expansion for $\arcsin x$ is $x = x + \frac12\cdot\frac{x^3}{3} + \frac12\cdot\frac34\cdot\frac{x^5}{5}$ and so by setting $x=\frac12$ and multiplying the result by 6 we should get a rational approximation to $\pi$.  As it happens, we get $\frac{2009}{640} = 3.1390625$, which is clearly getting there but isn’t as good as 3.14, 22/7 or 355/133.  And although we can get a much better approximation by calculating more terms of the Taylor-MacLaurin series, it’s clear that this isn’t a particularly efficient way of doing things.

Fortunately, there are many better ways of calculating rational or decimal approximations to $\pi$.  In 1706, the English mathematician John Machin (c.1686-1751) published the identity $\frac{\pi}{4} = 4\arctan\frac{1}{5} - \arctan\frac{1}{239}$ and used it (together with the MacLaurin series for $\arctan x$) to calculate the first hundred decimal places of $\pi$.

The Indian mathematician Srinivasa Ramanujan (1887-1920) discovered the formula $\frac{1}{\pi} = \frac{2\sqrt{2}}{9801} \sum^\infty_{k=0} \frac{(4k)!(1103+26390k)}{(k!)^4 396^{4k}}$ which converges extremely rapidly.  The best currently known formula (which I thank Arthur Clune for alerting me to) was discovered by the Ukrainian/American mathematicians Gregory and David Chudnovsky in 1989, based on Ramanujan’s work.  This formula $\frac{1}{\pi} = 12 \sum^\infty_{k=0} \frac{(-1)^k (6k)! (13591409 + 545140134k)}{(3k)!(k!)^3 640320^{3k + 3/2}}$, converges extremely quickly, with each additional term adding another fourteen or fifteen decimal places of accuracy.  They used it in August 2010 to calculate $\pi$ to $5\times 10^{12}$ decimal places. ($5\times 10^{12}$ is 5 billion or 5 trillion depending on whether you’re using the long or short scales; being English I tend to use the former, and experience a faint sense of guilt on the increasingly common occasions I find myself using the latter.)

An apparently much less accurate approximation to $\pi$ turns up in the Bible.  1 Kings 7:23 says:

And he made a molten sea, ten cubits from the one brim to the other: it was round all about, and his height was five cubits: and a line of thirty cubits did compass it round about.

This verse, repeated almost verbatim in 2 Chronicles 4:2, implies the approximation $\pi\approx3$.  The other famous approximation to $\pi$ turns up in an infamous 1897 bill considered (but ultimately not passed) by the state legislature of Indiana.  This includes various mathematical observations by the physician and amateur mathematician Edwin J Goodwin (c.1825-1902), such as

Furthermore, it has revealed the ratio of the chord and arc of ninety degrees, which is as seven to eight, and also the ratio of the diagonal and one side of a square which is as ten to seven, disclosing the fourth important fact, that the ratio of the diameter and circumference is as five-fourths to four

This indicates not only a value of 3.2 ($=\frac{4}{1.25}$) for $\pi$ but also a value of $1.\overline{428571}$ for $\sqrt2$.  The bill also includes Goodwin’s “solutions” to the problems of squaring the circle, trisecting an angle and doubling the cube (three ancient unsolved problems known since the middle of the 19th century to be formally unsolvable).  The bill was passed unanimously by the House but due to the efforts of Clarence Waldo, a Professor of Mathematics at Purdue University, enough members of the Senate were persuaded of the errors in Goodwin’s work that the bill was stalled indefinitely in committee and never made it onto the statute book.

### One response to “Approximating pi”

1. What an interesting exposition!

I remarked earlier today that I think there are only two fixed approximations to \pi that are worth using in practice: 3, and whatever is instantly available in the environment you’re doing sums in – so, for instance, the \pi button on your calculator, or the pre-defined constant you get for ‘pi’ in a more sophisticated calculation environment.

(I note without surprise and with only a touch of sadness that \tau, the manifestly superior circle constant, is not available natively in any calculation environment I am familiar with.)

The joy of following the Biblical approximation is that it is trivial to do sums involving \pi in one’s own head, facilitating estimation. The built-in constant is extremely easy to invoke, almost certain to be free of typographical errors, and likely to have considerably more precision than is required.

There are plenty of situations where neither of those will suffice: but in those situations, you need to think about what is required and make a conscious, informed choice from the wide range of methods available.