How to Calculate Pi... =?
|
I've never liked accepting anything on faith. Given that fact, it was inevitable that someday I would have to come to terms with the (arguably) most-beloved irrational number, .
There are many ways to calculate . First I'll give the most accessible one I know. It requires only the Pythagorean Theorem and some head-scratching. There are much easier ways to calculate it with sufficient knowledge of Calculus.
|
The Insider's 2n-gon Method
In which we calculate the area of the regular 2n-gon contained in a circle of unit radius...
|
This method determines as the ratio of a circle's area to the square of its radius by drawing a series of triangles that fill the circle. I haven't seen this method anywhere else, but it must have been done long before me. Its disadvantage is that it requires knowledge of lots of square roots, but those are easy to compute (if time-intensive) via the guess-and-check technique, so this method does pass the desert-island test. If we consider a circle of radius one, then we have A= . So let's calculate the area of a circle of radius one.
First we draw a square inside the circle. The square is composed of two right triangles, both with base=2 and height=1. (Remember, the radius is one!) Since we'll be drawing more triangles, I'll denote the base and height of each set of identical triangles with an index. The first ones will be known by their base and height, b0 and h0.
So our first set of triangles gives us an approximation for the area of the circle:
To first order in this technique, =2.
Now consider the area of the next set of triangles. There are four of them, one for each equal side of our first two isoceles triangles. To the right is a figure showing their bases and heights, b1 and h1.
Using the Pythagorean Theorem, b1 in terms of b0 and h0 is
.
|
It would have been simpler to write b1 in terms of h0 only, but it is nice to write it this way for reasons that will soon be apparent.
|


|
Next it is useful to note that 1, b1/2 and the segment 1-h1 form a right triangle. So we may use the Pythagorean Theorem again to determine the segment 1-h1, and consequently h1:
Thus A1, determined by four triangles with base b1=√2 and height h1=1-√2 (Plug b0=2 and h0=1 into the two formulae just given.), is A1=4(1/2)b1h1≈0.82.
Add the areas of the first two triangles to the areas of the four smaller triangles to get the second-order result.
To the right is a figure drawn with blue and red segments highlighting the next region of interest. The third area to calculate is the region between the outside of the blue-and-red triangle and the arc that touches two of its vertices. The two figures below magnify the region of interest, with the second exaggerating the next triangular region to compute.

|

Note that h1, b1/2 and b2 form a right triangle with b2 as the hypotenuse.
Once again, the base of the new isoceles triangle is bisected by a radius such that 1, b2/2 and 1-h2 form a right triangle with 1 as the hypotenuse. Thus for b2 and h2 one gets
|
 | and | .
|
Substitution of b1 and h1 into these equations gives b2=.819 and h2=0.0878. The result for A2 is
The value of at this level is ≈A0+A1+A2=3.06. Getting there.
The ambitious reader should be able to extend this technique to write the exact value of in terms of an infinite series with a recursion relation. There's really nothing to it; just note the similarity between the formulae for b1,h1 and b2,h2. The formula follows.
That's exact. Admittedly, it would be a formidable task taking all those square roots on a desert island, but what else would you do? The table to the right contains the values this method gives for the first seven iterations.
I plan to add more methods soon, but I need to do some work and get some sleep. Try not to let the suspense get to you.
|
|
Iteration | " " |
| 0 | 2 |
| 1 | 2.82 |
| 2 | 3.06 |
| 3 | 3.12 |
| 4 | 3.137 |
| 5 | 3.1403 |
| 6 | 3.1413 |
| 7 | 3.14151 |
|
|
|
The Method of Archimedes
|
Archimedes calculated limits on by considering polygons circumscribed and inscribed by the unit circle. It is possible to approximate by the average of the inner and outer polygon. Since the limit of an n-gon as n approaches infinity is a circle, this method should do very well for large n.
|
|
Consider a square. A square circumscribed by a unit circle has area 2, as calculated previously. A square with a unit circle inscribed has sides of length 2 and area 4. Just by taking the average of the inner and outer square one gets =3. Damn, that was easy!
Another case that should easily succumb to the method of Archimedes is the hexagon. A hexagon is especially nice since it is composed of equilateral triangles.
 
|

|
Above are the two relevant triangles for the hexagon. Knowing that equilateral triangles are composed of two right triangles with sides equal to an overall multiplicative constant times 1, 2, and √3, it is very easy to calculate the areas of these two triangles. The one on the left has height=1 (it's the radius) and using knowledge of equilateral triangles the base is 2/√3. Thus its area is 1/√3≈ 0.5774. The one on the right has base 1 (it's the radius) and height=√3/2. So its area is √3/4≈0.433.
The result for the method of Archimedes with hexagons is 6(0.433+0.5774)/2=3.03, or ≈3.03. I found it somewhat disappointing that a hexagon offers so little improvement over a square. C'est la vie!
Further calculations using larger polygons could get pretty messy. But a little reflection on the method of Archimedes should make you wonder: why don't we calculate 2n-gons with an inscribed circle using a method similar to what we did above for circumscribed 2n-gons?
|
|
The Outsider's 2n-gon Method
|
Start with a square, then systematically cut corners.
The area of the square with a circle of unit radius inscribed is 4.
The second figure shows the first triangle to consider. Its height is the green segment, its base is the blue segment, and there are four of them: one for each corner of the square.
Two observations are necessary to obtain the recursion relation for this approach. For any new set of isoceles triangles, the radius of the circle plus the new triangle's height will be the hypotenuse of a right triangle, with the other two sides formed by half the base of the previous iteration's isoceles triangle and the radius of the circle. The second thing to notice is that the right triangle formed by half of the new isoceles triangle is similar to the triangle formed by the radius of the circle, the new height plus the radius of the circle, and half the previous isoceles triangle's base. The picture below illustrates these statements.
|


That's all it takes to write the recursion relation. Feel free to work through things a little more rigorously. The formula and the first seven iterations follow.
|
|

|
| Iteration | n-gon n= | Area Inscribed | Area Circumscribed | " " (Average) |
| 0 | 4 | 4 | 2 | 3 |
| 1 | 8 | 3.31 | 2.82 | 3.07 |
| 2 | 16 | 3.18 | 3.06 | 3.12 |
| 3 | 32 | 3.15 | 3.12 | 3.14 |
| 4 | 64 | 3.144 | 3.137 | 3.141 |
| 5 | 128 | 3.142 | 3.1403 | 3.1412 |
| 6 | 256 | 3.1418 | 3.1413 | 3.1416 |
| 7 | 512 | 3.1416 | 3.14151 | 3.1416 |
|
By all accounts, seven iterations gets a value of good to a couple parts in a million. Not bad.
|
by Calculus
|
It is much easier to get a piece of the using calculus. The most obvious technique is to Taylor expand a trig function about zero for a small angle.

|
Take an equilateral triangle with sides of length two, cut it in half, and it is easy to see that the sine of ( /6) is 1/2.

|
Now write this known quantity as a Taylor series.
Neglect every term but the first and get =3.
Keep the first two terms, substituting the previous result of =3 into the second term to get (23/24) /6=1/2, which gives =(24/23)3=3.13. That's only a second attempt, with no square roots or anything fancy necessary!
|

|
Keeping only the first three terms in the series and substituting the answer into the terms in brackets again and again until the answer stops changing gives
=3.14158!!!
So just by learning a tiny bit of calculus you can compute to 1 part in 3 million on a couple pieces of scratch paper. The message is clear: calculus kicks ass!
|
Gregory's Formula and the Leibnitz Formula for
|
Gregory's Formula is an infinite series for arctan(x), published by James Gregory in 1672. It is easy to derive as a Taylor Expansion.
Above is a triangle in which y=arctan(x). The first derivative follows from implicit differentiation. The derivative has the right form to expand in a geometric series. As always, a geometric series is valid for |ε| < 1. Having expanded in a geometric series, each term is easy to integrate and the result is a series for arctan(x), valid for |x|<1.
|



|

Evaluate the series at x=1. This corresponds to an old friend, the 1,1,√2 triangle. The answer is well-known.

This is the Leibnitz Formula for . Isn't it a pretty series? But looks aren't everything. It converges very slowly, because x=1 is at the edge of the Gregory Formula's radius of convergence. The formula works much better for smaller values of x. It is easy to rewrite the series in a slightly more useful form, but it still converges very slowly.
|

|
|
|
Stay tuned, more pi to come...
|
|
|