
\documentclass[12pt]{exam}
\input{defs}
\def\noi{\vskip15pt\noindent}
\def\noii{\vskip5pt\noindent}
\def\next{\vfill\eject\noindent}
\begin{document}
%\baselineskip=2in
%\setlength{\baselineskip}{18pt}  or
\renewcommand{\baselinestretch}{1.5}
%\small\normalsize
%\vbox{\vskip.2truein}
%\noi
%\cl {\bf  CALCULATING PI }
%\cl {\it or}
%\cl  {\it  Where did $\pi =3.1415926 \ldots \ldots $ come from and what are those dots for?}
%\noi
%\cl {  Dr. Darren D. Wick }
%\cl {Ashland University Mathematics Seminar}
%\cl {September 17, 2002}
%\noi
%ABSTRACT:  We examine some methods of calculating $\pi$ and the accuracy involved. We begin with geometric
%and probabilistic methods, followed by the use of some techniques of calculus. We also give an historic
%account of the computation of $\pi$, including a discussion of some of the current numerical methods.
%\next
  \Large
\cl {\bf  APPROXIMATING PI }
\cl {\it or}
\cl  {\it  Where did $\pi =3.1415926 \ldots \ldots $} 
  \cl {\it come from and what are those dots for?}
\noi
  \large
  \noi
\cl { Darren Wick }
\cl {Ashland University Mathematics Seminar}
\cl { September 13, 2005}
\noi
\next
  \Large
 \cl{ GOAL} 
\noii
  Examine some methods and their accuracy for calculating $\pi$ to "lots" of decimal places.
  \noi
  \cl {OUTLINE}
  \begin{questions}
  \question Geometric and probabilistic methods. Not particularly useful.
  \question Using techniques of the calculus. Getting closer.
  \question Modern methods used in practice.
  \question Bonus
  \end{questions}
  \next
\noi \cl {\ub {CALCULATING PI EXPERIMENTALLY}} 
\noii
If $C$ is the circumference of a circle and $D$ is its diameter, then
$$\pi ={C\over D}$$
So if we want to approximate $\pi$, why not just measure some circles? Suppose we can measure
the diameter $D$ exactly, and measure the circumference with some maximum error $E$, then 
our approximation to $\pi$ would be
$$\pi \approx {{C\pm E}\over D}$$
and the error in this approximation is $E\over D$.
If we want to calculate $\pi$ to 30 decimal place accuracy, then we would want 
$\ds \bigg|{E\over D}\bigg|<10^{-30}$
\next
   a) If we use a circle with diameter of one foot, we would need 
$$|E|<10^{-30} \ \ \ {\rm feet}$$
\noii 
\cl {\bf Anybody got a ruler??} 
\noi
   b) If we use a big circle, say one the size of the Milky Way Galaxy, which has diameter roughly
$9.435\times 10^{23}$ millimeters, then we would need
$$|E|<9.434\times 10^{-7} \ \ \ {\rm millimeters}$$
\noii
\cl{\bf There has got to be a better way!!}
\next 
\cl {\ub {PROBABILISTIC METHOD}}
\noi
Consider a circle of radius one, centered at the origin and inscribed in a square as shown below:
\noi
\includegraphics[height=3.5in,width=4.8in]{/home/dwick/DATA/Professional/Other/Pictures&Worksheets/Pi_Talk/monte.pdf}

\noi
If we pick a random point $(x,y)$ inside the square (i.e. so that both $x$ and $y$ are between $-1$ and
$1$), then the probability that this point lies inside the circle is just the ratio of the area of the
circle to the area of the square, or $\ds \pi \over 4$. We randomly choose $N$ such points (for large $N$)
and calculate the number $M$ of these that fall inside the circle, so that
$${\pi \over 4} \approx {M\over N}$$
\noi
\cl {\ub {BUFFON'S NEEDLE}}
\noi
Another result from probability (sometimes called "Buffon's Needle") is that if you drop a needle on a
lined sheet of paper, where the lines are separated by the same distance as the length of the needle, the
probability that the needle hits a line is $\ds {2 \over \pi}$.
\noi
So, if $N=$ number of needles dropped and $M=$ number of needles that hit a line, we can drop lots of
needles and calculate
$$ {2\over \pi}\approx {M\over N}$$
or
$$\pi \approx {{2N}\over M}$$
\noi
% See www.angelfire.com/wa/hurben/buff.html
\next 
\cl {\ub {INSCRIBED AND CIRCUMSCRIBED POLYGONS}}
\noii
Why not use regular polygons, inscribed and circumscribed about a circle, to approximate its circumference
(or area)? 
   For example, if we take a circle of radius one and inscribe and circumscribe regular four sided
polygons (i.e.  squares), then the area of the circle is bounded by the area of the squares. 
\noi
\includegraphics[height=4.4in,width=6in]{/home/dwick/DATA/Professional/Other/Pictures&Worksheets/Pi_Talk/circlesquare.pdf}
\next
It is easy to see that this gives the bounds
$${\rm Area \ of \ little \ square }< {\rm Area \ of \ circle}< {\rm Area \ of \ big \ square}$$
$$2<\pi <4$$
\noii
Interestingly, using the same two squares and calculating perimeter instead of area, we see that
$$4\sqrt 2< 2\pi< 8$$
$$ 2.82 \ldots  < \pi < 4$$ 
Not real impressive, but if we want more accuracy, we need to do
more work, which means use polygons with more sides. Indeed, Archimedes, over 2200 years ago, did just
this, using regular 96-sided polygons to get the approximation
$$3 {10\over {71}}<\pi <3 {1\over 7}$$
\large
$$ 3.14084507042253521126760563 < \pi < 3.14285714285714285714285714$$
\next
\Large
\cl {\ub {A LIMIT THEOREM FROM CALCULUS}} 
$$\lim_{x\to 0} {{\sin x}\over x}=1$$
   a) Letting $x={\pi \over n}$, we see that for large $n$
$$\pi \approx n\cdot \sin ({\pi \over n})$$
   b) Using the trig identities
$$\sin ({x\over 2})=\sqrt{{1-\cos x}\over {2}} \ \ \ \ {\rm and} \ \ \ \ \cos ({x\over 2})=\sqrt{{1+\cos
x}\over {2}}$$
and beginning with $\sin ({\pi \over 6}) =.5$ and $\cos({\pi \over 6})={\sqrt 3 \over 2}$ we iteratively
compute 
$$\sin ({\pi \over 12}), \ \sin ({\pi \over 24}), \ \sin ({\pi \over 48}), \ \sin ({\pi \over 96}), \
\cdots$$
and thus approximate $\pi$ with $n\cdot \sin({\pi \over n})$ for $n$ large by computing
$$12 \cdot \sin ({\pi \over 12}), \ 24\cdot \sin ({\pi \over 24}), \ 48 \cdot \sin ({\pi \over 48}), \
96\cdot \sin ({\pi
\over 96}),
\
\cdots$$
\noi
This does not require that we evaluate trig functions, but does require that we calculate square
roots.
\next 
\cl {\ub {NEWTON'S METHOD OF APPROXIMATING ROOTS}} 
\noi
Consider the tangent line to the graph of $f(x)$ at $x_0$. Then the equation of this line is
$$y-f(x_0)=f'(x_0)(x-x_0)$$
An approximation for a root of $f$ is then the $x$-intercept of this line, namely
$$x_1 =x_0 -{{f(x_0)}\over {f'(x_0)}}$$
\noi
\includegraphics[height=4in,width=6in]{/home/dwick/DATA/Professional/Other/Pictures&Worksheets/Pi_Talk/newton.pdf}
\next
\noi
Repeated iteration of Newton's Method gives a sequence that "usually" converges to a root of $f$. 
If we apply this method to the function
$$f(x)=\sin x$$ and "start" it correctly, we will converge to the root of $\sin x$ at $x=\pi$.
However,
we've merely replaced the problem of calculating
$\pi$ with that of calculating $\sin x$ for lots of $x$'s!
\next 
\cl {\ub {NUMERICAL INTEGRATION}}
\noi
Using numerical integration techniques (i.e. Trapezoid Rule, Simpson's Rule, etc), we can estimate the
value of definite integrals:
\noi
   a) The area under the graph of $f(x)=\sqrt {2-x^2}$ on the interval $[
-\sqrt 2, \sqrt 2]$ is the area of half of a circle of radius $\sqrt 2$, or $\pi$.  Thus $$ \pi =
\int_{-\sqrt 2}^{\sqrt 2} \sqrt {2-x^2} dx$$
   b) $$\ds \pi = \arctan (1) =\int_0^1 {4\over {1+x^2}} dx$$
\noi
Method a) requires that we calculate square roots, while method b) requires just plain old arithmetic.
\noi
\noi
\cl {\ub {WALLIS'S FORMULA}}
   $${\pi \over 2}={2\over 1}\times {2\over 3}\times {4\over 3}\times {4\over 5}\times 
{6\over 5}\times {6\over 7}\times {8\over 7}\times {8\over 9}\times \cdots$$
\noi
SLOW!! 1000 terms gives only 2 digit accuracy.
\next
\cl {\ub {ARC-TANGENTRY}} 
   a) The Taylor Series for $\ds f(x)={1\over {1-x}}$ about $x=0$ is $${1\over {1-x}}=1+x+x^2+x^3+x^4
+\cdots$$
   b) Substituting $-x^2$ for $x$ gives
$$ {1\over {1+x^2}}=1-x^2+x^4-x^6+\cdots $$
   c) Integrating with respect to $x$ gives
$$\arctan x =\int {1\over {1+x^2}} dx = \int 1 -\int x^2 +\int x^4 -\int x^6 +\cdots $$
or
$$\arctan x = x-{{x^3}\over 3 }
+{{x^5}\over 5}-{{x^7}\over 7} +\cdots$$
\noi
\cl {\ub {LEIBNIZ'S SERIES}}
    Substituting $x=1$ into the Taylor Series for arctangent gives
$${\pi\over 4}=\arctan (1) =1-{1\over 3}+{1\over 5}-{1\over 7}+\cdots$$
\noi
300 terms gives only 2 decimal place accuracy! To get 100 digit accuracy would require $2\times 10^{100}$
terms. 
\next
\cl {\ub {EULER'S FORMULA}}
   $${\pi \over 4}=\arctan{1\over 2}+\arctan {1\over 3}$$
    Substituting $x={1\over 2}$ and $x={1\over 3} $ respectively into the Taylor Series for
arctangent gives
$${\pi\over 4}=({1\over 2}-{1\over {3\cdot 2^3}}+{1\over {5\cdot 2^5}}-{1\over {7\cdot 2^7}} \cdots)
+({1\over 3}-{1\over {3\cdot 3^3}}+{1\over {5\cdot 3^5}}-{1\over {7\cdot 3^7}} \cdots)$$
\noi
It takes 800 terms of this series to get 100 digit accuracy.
\noi
\noi
\cl {\ub {MACHIN'S FORMULA}}
   $${\pi \over 4}=4\arctan{1\over 5}-\arctan {1\over 239}$$
    Substituting $x={1\over 5}$ and $x={1\over 239} $ respectively into the Taylor Series for
arctangent gives

$$ {\pi\over 4}  =  4({1\over 5}-{1\over {3\cdot 5^3}}+{1\over {5\cdot 5^5}}-{1\over {7\cdot 5^7}}
\cdots)$$
$$ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ -({1\over 239}-{1\over {3\cdot 239^3}}+{1\over {5\cdot 239^5}}-{1\over {7\cdot 239^7}}
\cdots)$$

\noi
Taking the first 400 terms gives 100 digit accuracy.
\next
\cl {\ub {SHARP'S SERIES}}
    Substituting $x={1\over {\sqrt 3}}$ into the Taylor Series for arctangent gives
$${\pi\over 6}=\arctan ({1\over {\sqrt 3}}) ={1\over \sqrt 3}-{({1\over \sqrt 3})^3 \over 3}+{({1\over
\sqrt 3})^5 \over 5}-{({1\over \sqrt 3})^7 \over 7}+\cdots$$
or
$$\pi = {6\over \sqrt 3} (1-{1\over {3 \cdot 3}}+{1\over {5\cdot 3^2}}-{1\over {7\cdot 3^3}}+\cdots )$$
\noi
100 digit accuracy can be achieved with only
250 terms.
\noi
\noi
The accuracy of these methods can be computed theoretically (using Taylor's Theorem), so that after $n$
iterations, we can guarantee that a certain number of digits are correct.
\next 
\cl {\ub {LOTS MORE OF EULER'S FORMULAS}}
$${\pi \over 4}=5 \arctan{1\over 7}+2 \arctan {3\over 79}$$
\noi
$${\pi \over 4}=2 \arctan{1\over 3}+ \arctan {1\over 7}$$
\noi
$${\pi^2 \over 6}={{2^2}\over {(2^2-1)}}\times {{3^2}\over {(3^2-1)}} \times {{5^2}\over {(5^2-1)}}
\times {{7^2}\over {(7^2-1)}} \times {{11^2}\over {(11^2-1)}} \times \cdots $$
\noi
$${\pi \over 2}={{3}\over 2}\times {{5}\over 6} \times {{7}\over 6}
\times {{11}\over 10} \times {{13}\over 14} \times {{17}\over {18}}\times {{19}\over {18}} \times 
{{23}\over {22}} \cdots $$
\noi
%$$\arctan x = \sum_{n=0}^\infty {{2^{2n} \cdot (n!)^2 \cdot x^{2n+1}} \over {(2n+1)! \cdot
%(1+x^2)^{n+1}}}$$ 
$${\pi^2 \over 6} = {1\over 1^2} + {1\over 2^2}+{1\over 3^2}+\cdots$$
\noi
$${\pi^4 \over 90}={1\over 1^4}+{1\over 2^4}+{1\over 3^4}+\cdots$$ 
%$$1-\sin x = \bigg(1-{{2x}\over \pi}\bigg)^2 \times \bigg(1+{{2x}\over {3\pi}}\bigg)^2 \times 
%\bigg(1-{{2x}\over {5 \pi}}\bigg)^2 \times \bigg(1+{{2x}\over {7\pi}}\bigg)^2\times \cdots$$
\noi
$${\pi^3 \over {32}} = {1\over 1^3} - {1\over 3^3}+{1\over 5^3}-{1\over 7^3}+\cdots$$
\next 
 \cl {\ub {RECURSIVE ALGORITHM FOR $\pi$ (BORWEIN)}}
$$x_0=\sqrt 2 \ \ \ \ \ \pi_0 = 2+\sqrt 2 \ \ \ \ \ y_1=2^{1\over 4}$$
$$x_{n+1}={1\over 2}\bigg(\sqrt{x_n}+{1\over {\sqrt{x_n}}}\bigg)$$
$$y_{n+1}={{y_n\sqrt {x_n}+{1\over {\sqrt {x_n}}}}\over {y_n +1}}$$
$$\pi_n = \pi_{n-1} {{x_n +1}\over {y_n +1}}$$
Then $\pi_n$ decreases monotonically and converges  to $\pi$ with $$\pi_n -\pi <
10^{-2^{n+1}}$$
\noi
Thus, it takes only 8 iterations to achieve 100 digit accuracy. (Although each iteration requires a
handful of calculations) 
\next
\cl {\ub {RAMANUJAN'S FORMULAS}}
   $${1 \over \pi}= \sum_{n=0}^\infty {2n\choose n}^3
\ \frac{42n+5}{2^{12n+4}}$$
\noi
$${1 \over \pi}= \frac{\sqrt 8}{9801} \times \sum_{n=0}^\infty \frac{(4n)! [1103+26390n]}{
(n!)^4 396^{4n}}$$
Each term produces an additional 8 correct digits
\noi
\noi
\cl {\ub {CHUDNOVSKY BROTHERS'S FORMULA}}
   $${1 \over \pi}=12\times \sum_{n=0}^\infty {(-1)^n}{{(6n)! \cdot [13591409+545140134n]}\over
{(n!)^3 \cdot (3n)! \cdot {[640320]}^{3n+{3\over 2}}}}$$
\noindent
Gives 14 digits accurately per term. This series is used by Mathematica to compute $\pi$.
\noi
\noi
\cl {\ub {BORWEIN AND BORWEIN'S FORMULA}}
   $${1 \over \pi}=12\times \sum_{n=0}^\infty {(-1)^n}{{(6n)! \cdot
[A+Bn]}\over {(n!)^3 \cdot
(3n)!
\cdot {C}^{3n+{3\over 2}}}}$$
$$A=212175710912\sqrt{61} +1657145277365$$
$$B=13773980892672\sqrt{61}+107578229802750$$
$$C=5280(236674+30303\sqrt{61})$$
\noindent
Gives 25 digits accurately per term.
\next
\cl {\ub {SPIGOTRY (RABINOWITZ AND WAGON)}}
\noi
$${\pi \over 2} =1+{1\over 3} \bigg[1+{2\over 5} \bigg[1+{3\over 7} \bigg[1+{4\over 9} \bigg [1+\cdots $$
\noi
This formula can be used to compute the decimal digits of $\pi$ one at a time.
\noi
\noi
\cl {\ub {THE MIRACULOUS BAILEY-BORWEIN-PLOUFFE FORMULA}}
   $$\pi= \sum_{n=0}^\infty \Bigg( {4\over {8n+1}} -{2\over {8n+4}}-{1\over {8n+5}}-{1\over {8n+6}}
\Bigg) \Bigg( {1\over 16}\Bigg)^n$$
\noi
This formula allows calculation of the $n^{th}$ hexadecimal digit of $\pi$ without calculating the previous $n-1$
digits.
\noi
\next
\cl {\ub {BONUS}}
\begin{questions}
\question The current record (Kanada, 2002) is 1.2411 trillion decimal digits. What is the $1.2411$   trillionth decimal digit of $\pi$?
\noi
\question What is the 40 trillionth binary digit of $\pi$?
\noi
\question Memorizing Digits of $\pi$
\noi
   Simon Plouffe (1977): 4396 digits
\noi
   Rajan Mahadevan (1983): Recited 31,811 digits
\noi
   Hiroyuki Goto (1995): Recited 42,000 digits (in 9 hours)
\end{questions}
\next
\noi \cl {\ub {WICK'S FORMULA}}
$$ \pi =\pi$$
\next
\cl {\bf REFERENCES}
\noi
Richard Koch, {\it Computing Pi}
\noii
Bailey, Borwein, Borwein and Plouffe, {\it The Quest for Pi},
\break
 Math. Intelligencer, 1997
\noii
 David Blatner, {\it The Joy of Pi}
\noii
www.ams.org/new-in-math/cover/pi-calc.html
\noii
www.geocities.com/SiliconValley/Bay/9187/pi.htm
\noii
www.daimi.aau.dk/~u951581/pi/MonteCarlo/pimc.html
\noii
www.mathsoft.com/asolve/plouffe/plouffe.html
\noii
www.mcs.surrey.ac.uk/Personal/R.Knott/Fibonacci/fibpi.html
\noii
www.mste.uiuc.edu/reese/buffon/buffon.html
\noii
mathforum.org/library/drmath/view/57543.html
\noii
weyl.math.virginia.edu/~der/capstone/pi.htm
\noii
mathworld.wolfram.com/PiFormulas.html
\noii
www-groups.dcs.st-and.ac.uk/~history/HistTopics
\noii
www.angelfire.com/wa/hurben/buff.html



\end{document}


