Pi vs. Pie

Courtesy Bedtime Math:

Thanksgiving warning

Source: https://www.facebook.com/MathAwesomeness/photos/a.342252885964433.1073741828.342251349297920/574659579390428/?type=3&theater

Thanksgiving recipe

Source: http://shirt.woot.com/offers/easiest-thanksgiving-recipe

Halloween math humor

Pi Day of the Century

In case you have nothing better to read, here’s the first million digits of pi: http://www.piday.org/million/

And, as a reminder, I’ll be at the Pi Day of the Century event at the North Branch of the Denton library:

Local Pi Day Event

As has been well publicized, tomorrow is the Pi Day of the Century (3/14/15). I actually know someone who intentionally planned her wedding for tomorrow morning at 9:26 am.

The North Branch of the Denton library will be holding a Pi Day event from 9:26 am until 5:35 pm, and I’ll be making four presentations (two for grade school children and two for teens/adults). You’re welcome to bring the family and enjoy as your schedule permits.

Was There a Pi Day on 3/14/1592?

March 14, 2015 has been labeled the Pi Day of the Century because of the way this day is abbreviated, at least in America: 3/14/15.

I was recently asked an interesting question: did any of our ancestors observe Pi Day about 400 years ago on 3/14/1592? The answer is, I highly doubt it.

My first thought was that \pi may not have been known to that many decimal places in 1592. However, a quick check on Wikipedia (see also here), as well as the book “\pi Unleashed,” verifies that my initial thought was wrong. In China, 7 places of accuracy were obtained by the 5th century. By the 14th century, \pi was known to 13 decimal places in India. In the 15th century, \pi was calculated to 16 decimal places in Persia.

It’s highly doubtful that the mathematicians in these ancient cultures actually talked to each other, given the state of global communications at the time. Furthermore, I don’t think any of these cultures used either the Julian calendar or the Gregorian calendar (which is in near universal use today) in 1592. (An historical sidebar: the Gregorian calendar was first introduced in 1582, but different countries adopted it in different years or even centuries. America and England, for example, did not make the switch until the 18th century.) So in China, India, and Persia, there would have been nothing particularly special about the day that Europeans called March 14, 1592.

However, in Europe (specifically, France), Francois Viete derived an infinite product for \pi and obtained the first 10 digits of \pi. According to Wikipedia, Viete obtained the first 9 digits in 1579, and so Pi Day hypothetically could have been observed in 1592. (Although \pi Unleashed says this happened in 1593, or one year too late).

There’s a second problem: the way that dates are numerically abbreviated. For example, in England, this Saturday is abbreviated as 14/3/15, which doesn’t lend itself to Pi Day. (Unfortunately, since April has only 30 days, there’s no 31/4/15 for England to mark Pi Day.) See also xkcd’s take on this. So numerologically minded people of the 16th century may not have considered anything special about March 14, 1592.

The biggest obstacle, however, may be the historical fact that the ratio of a circle’s circumference and diameter wasn’t called \pi until the 18th century. Therefore, both serious and recreational mathematicians would not have called any day Pi Day in 1592.

Approximating pi

I was recently interviewed by my city’s local newspaper about \pi Day and the general fascination with memorizing the digits of \pi. I was asked by the reporter if the only constraint in our knowledge of the digits of \pi was the ability of computers to calculate the digits, and I answered in the affirmative.

Here’s the current state-of-the-art for calculating the digits of \pi. Amazingly, this expression was discovered¬† 1995… in other words, very recently.

\pi = \displaystyle \sum_{n=0}^\infty \frac{1}{16^n} \left( \frac{4}{8n+1} - \frac{2}{8n+4} - \frac{1}{8n+5} - \frac{1}{8n+6} \right)

Because of the term 16^n in the denominator, this infinite series converges very quickly.

Proof: If k < 8, then we calculate the integral I_k, defined below:

I_k = \displaystyle \int_0^{1/\sqrt{2}} \frac{x^{k-1}}{1-x^8} dx

= \displaystyle \int_0^{1/\sqrt{2}} x^{k-1} \sum_{n=0}^\infty x^{8n} dx

= \displaystyle \int_0^{1/\sqrt{2}} \sum_{n=0}^\infty x^{8n+k-1} dx

= \displaystyle \sum_{n=0}^\infty \int_0^{1/\sqrt{2}} x^{8n+k-1} dx

= \displaystyle \sum_{n=0}^\infty \left[ \frac{x^{8n+k}}{8n+k} \right]^{1/\sqrt{2}}_0

= \displaystyle \sum_{n=0}^\infty \frac{1}{8n+k} \left[ \left( \frac{1}{\sqrt{2}} \right)^{8n+k} - 0 \right]

= \displaystyle \sum_{n=0}^\infty \frac{1}{2^{k/2}} \frac{1}{16^n (8n+k)}

We now form the linear combination P = 4\sqrt{2} I_1 - 8 I_4 - 4\sqrt{2} I_5 - 8 I_6:

P = \displaystyle \sum_{n=0}^\infty \left( \frac{4\sqrt{2}}{2^{1/2}} \frac{1}{16^n (8n+1)} - \frac{8}{2^{4/2}} \frac{1}{16^n (8n+4)} - \frac{4\sqrt{2}}{2^{5/2}} \frac{1}{16^n (8n+5)} - \frac{8}{2^{6/2}} \frac{1}{16^n (8n+6)} \right)

P = \displaystyle \sum_{n=0}^\infty \frac{1}{16^n} \left( \frac{4}{8n+1} - \frac{2}{8n+4} - \frac{1}{8n+5} - \frac{1}{8n+6} \right)

Also, from the original definition of the I_k,

P = \displaystyle \int_0^{1/\sqrt{2}} \frac{4\sqrt{2} - 8x^3 -4\sqrt{2} x^4 - 8x^5}{1-x^8} dx.

Employ the substitution x = y/\sqrt{2}:

P = \displaystyle \int_ 0^1 \frac{4\sqrt {2} - 2\sqrt {2} y^3 - \sqrt {2} y^4 - \sqrt {2} y^5}{1 - y^8/16}\frac {dy} {\sqrt {2}}

P = \displaystyle \int_ 0^1 \frac{16 (4 - 2 y^3 - y^4 - y^5)}{16 - y^8} dy

P = \displaystyle \int_0^1 \frac{16(y-1)(y^2+2)(y^2+2y+2)}{(y^2-2)(y^2+2)(y^2+2y+2)(y^2-2y+2)} dy

P = \displaystyle \int_0^1 \frac{16y-16}{(y^2-2)(y^2-2y+2)} dy

Using partial fractions, we find

P = \displaystyle \int_ 0^1\frac{4 y}{y^2 - 2} dy - \int_ 0^1 \frac{4 y - 8}{y^2 - 2 y + 2} dy

The expression on the right-hand side can be simplified using standard techniques from Calculus II and is equal to \pi.

green line

So that’s the proof… totally accessible to a student who has mastered concepts in Calculus II. But this begs the question: how in the world did anyone come up with the idea of starting with the integrals $I_k$ to develop an infinite series that leads to \pi? Let me quote from page 118 of J. Arndt and C. Haenel, \pi - Unleashed (Springer, New York, 2000):

Certainly not by chance, even if luck played some part in the discovery. All three parties [David Bailey, Peter Borwein and Simon Plouffe] are established mathematicians who have been working with the number \pi for a considerable time… Yet the series was not discovered through mathematical deduction or inference. Instead, the researchers used a tool called Computer Algebra System and a particular procedure called the “PSQL algorithm” to generate their series. They themselves write that they found their formula “through a combination of inspired testing and extensive searching.”

The original paper that announced the discovery of this series can be found at http://www.cecm.sfu.ca/personal/pborwein/PAPERS/P123.pdf.

Continued fractions and pi

I suggest the following activity for bright middle-school students who think that they know everything that there is to know about fractions.

The approximation to \pi that is most commonly taught to students is \displaystyle \frac{22}{7}. As I’ll discuss, this is the closest rational number to \pi using a denominator less than 100. However, it is possible to obtain closer rational approximations to \pi using larger numbers. Indeed, the ancient Chinese mathematicians were superior to the ancient Greeks in this regard, as they developed the approximation

\pi \approx \displaystyle \frac{355}{133}

It turns out that this is the best rational approximation to \pi using a denominator less than 16,000. In other words, \displaystyle \frac{355}{133} is the best approximation to \pi using a reasonably simple rational number.

Step 1. To begin, let’s find \pi with a calculator. Then let’s now subtract 3 and then find the inverse.

TIpi1

This calculation has shown that

\pi = \displaystyle 3 + \frac{1}{7.0625133\dots}

If we ignore the 0.0625133, we obtain the usual approximation

\pi \approx \displaystyle 3 + \frac{1}{7} = \frac{22}{7}

Step 2. However, there’s no reason to stop with one reciprocal, and this might give us some even better approximations. Let’s subtract 7 from the current denominator and find the reciprocal of the difference.

TIpi2

At this point, we have shown that

\pi = \displaystyle 3 + \frac{1}{7 + \displaystyle\frac{1}{15.9965944\dots}}

If we round the final denominator down to 15, we obtain the approximation

\pi \approx \displaystyle 3 + \frac{1}{7 + \displaystyle\frac{1}{15}}

\pi \approx \displaystyle 3 + \frac{1}{~~~\displaystyle \frac{106}{15}~~~}

\pi \approx \displaystyle 3 + \frac{15}{106}

\pi \approx \displaystyle \frac{333}{106}

Step 3. Continuing with the next denominator, we subtract 15 and take the reciprocal again.

TIpi3

At this point, we have shown that

\pi = \displaystyle 3 + \frac{1}{7 + \displaystyle\frac{1}{15 + \displaystyle \frac{1}{1.00341723\dots}}}

If we round the final denominator down to 1, we obtain the approximation

\pi \approx \displaystyle 3 + \frac{1}{7 + \displaystyle\frac{1}{16}}

\pi \approx \displaystyle 3 + \frac{1}{~~~\displaystyle \frac{113}{16}~~~}

\pi \approx \displaystyle 3 + \frac{16}{113}

\pi \approx \displaystyle \frac{355}{113}

Step 4. Let me show one more step.TIpi4

At this point, we have shown that

\pi = \displaystyle 3 + \frac{1}{7 + \displaystyle\frac{1}{15 + \displaystyle \frac{1}{1 + \displaystyle \frac{1}{292.634598\dots}}}}

If we round the final denominator down to 292, we (eventually) obtain the approximation

\pi \approx \displaystyle \frac{52163}{16604}

green lineThe calculations above are the initial steps in finding the continued fraction representation of \pi. A full treatment of continued fractions is well outside the scope of a single blog post. Instead, I’ll refer the interested reader to the good write-ups at MathWorld (http://mathworld.wolfram.com/ContinuedFraction.html) and Wikipedia (http://en.wikipedia.org/wiki/Continued_fraction) as well as the references therein.

But I would like to point out one important property of the convergents that we found above, which were

\displaystyle \frac{22}{7}, \frac{333}{106}, \frac{355}{113}, ~ \hbox{and} ~ \frac{52163}{16604}

All of these fractions are pretty close to \pi, as shown below. (The first decimal below is the result for 22/7.)

TIpi5

In fact, these are the first terms in a sequence of best possible rational approximations to $\pi$ up to the given denominator. In other words:

  • \displaystyle \frac{22}{7} is the best rational approximation to \pi using a denominator less than $106$. In other words, no integer over 8 will be any closer to \pi than \displaystyle \frac{22}{7}.¬† No integer over 9 will be any closer to \pi than \displaystyle \frac{22}{7}. And so on, all the way up to denominators of 105. Small wonder that we usually teach children the approximation \pi \approx \displaystyle \frac{22}{7}.
  • Once we reach 106, the fraction \displaystyle \frac{323}{106} is the best rational approximation to \pi using a denominator less than 113.
  • Then \displaystyle \frac{355}{113} is the best rational approximation to \pi using a denominator less than 16604.

As noted above, the ancient Chinese mathematicians were superior to the ancient Greeks in this regard, as they were able to develop the approximation \pi \approx \displaystyle \frac{355}{113}. For example, Archimedes was able to establish that

3\frac{10}{71} < \pi < 3\frac{1}{7}