Return to my Mathematics pages
Go to my home page


Pi

Note: If your WWW browser cannot display special symbols, like ² or 2, then click here for the alternative pi(Pi) page.

© Copyright 1998, Jim Loy

Definition of pi:

circle with radius r and diameter dWhat is pi (the symbol is the small Greek letter pi)? It is equal to C/d, or C/2r, where C is the circumference of any circle, and d is its diameter, and r is its radius.

Euclid proved that this ratio (C/d) is always the same, no matter the size of the circle. What he did was inscribe similar regular polygons in any two circles. Then, he increased the number of sides of the inscribed regular polygons. He reasoned that as the number of sides increased, the perimeter of the inscribed polygon gets closer and closer to the circumference of the circle. He also showed that the perimeters of the similar polygons were proportional to the radii of the circles in which they were inscribed. And so, C is proportional to r, in other words C/r is a constant. By convention, pi=C/2r. And we can use that as our definition of pi.

Definition of pi: pi=C/2r

Since we know pi to many decimal places, the following version of the same equation becomes fairly useful:

Circumference formula: C=2(pi)r


Value of pi:

Archimedes approximated pi, by inscribing and circumscribing a circle with polygons of many sides. He showed that 3+10/71<pi<3+1/7 (in other words, 3.1408450704225 . . . < pi < 3.142857142857142857 . . . ). Now, pi is approximated by computers, using infinite series.

Pi is about:

3.14159 26535 89793 23846 26433 83279 50288 41971 69399 37510 58209 74944 59230 78164 06286 20899 86280 34825 34211 70679 82148 08651 . . .

One of my mathematics teachers (in High School, as I recall) told us that pi was exactly 22/7 (3+1/7), which is 3.142857142857142857 . . . Notice that it repeats every six digits. It is not bad (three digits of accuracy), but certainly not exact. By the way, the square root of 10 is fairly close to pi: 3.162277660168... (only two digits of accuracy). Using sqr() as the square root function, sqr(3)+sqr(2)=3.146264369942 . . . (about three digits of accuracy). Fiddling around with ratios, I found that 20/9 times the square root of 2 is 3.142696805274... (three digits of accuracy), which is slightly closer than 22/7. Much closer is 355/113, which is 3.141592920354 . . . (seven digits of accuracy). Kochansky's approximation is sqrt(40/3-2sqrt(3)), which is 3.141533... (about four digits of accuracy).


Area of a circle:

area of a circleAt the top of this article, I said that Euclid proved that C/2r is a constant. C/2r eventually became known as pi, and is our definition of pi. We need to figure out the area of a circle.

Let's say that we approximate a circle with a regular polygon of n sides. This diagram shows three of those sides, with length P/n (where P is the perimeter of the polygon). And I have drawn a triangle by drawing two of the radii. The area of this triangle is approximately Pr/2n (the altitude is close to r), and as the number of sides of our polygon increases, the area of the triangle gets closer and closer to Cr/2n. In other words, the altitude of the triangle gets closer and closer to r, and the perimeter of the polygon gets closer and closer to the circumference of the circle. There are n of these triangles filling up the circle. So the area of the circle is about A=nCr/2n=Cr/2. Our definition of pi was C=2(pi)r. Substituting this for C, we get A=(pi)r2. So we now know where these two famous equations come from.

Area formula: A=(pi)r2


Addendum #1 (comments):

I hear that the dimensions of the Great Pyramid (of Khufu, also known as Cheops) show that the ancient Egyptians knew the value of pi. Those people who measure the dimensions of pyramids claim tremendous accuracy, much more accuracy than the rough exterior of a pyramid warrants. So, when they say that the Great Pyramid exhibits the value pi, to many decimal places, a person should be skeptical. But, it is also not very remarkable that the ancient Egyptians might have used pi in this pyramid. It seems that the base (much of it is missing) of the pyramid is within a few inches of being square, and is just a few minutes of arc from being aligned with true north, very accurate indeed.

By the way, there are many pyramids, and each has a different slope. So, the Great Pyramid is the only one with just those dimensions and ratios. There is also evidence that the ancient Egyptians preferred a steeper slope than that of the Great Pyramid, but had to settle for shallower slopes, to keep the pyramids from collapsing.

The ancient Egyptians seem to have sometimes used a value of 22/7 for pi. There is also evidence that they estimated the area of a circle with a square with a side that is 8/9 the size of the circle's diameter. This gives a value of pi of 3.16049382716 . . .

See Pi and the Great Pyramid.

Any fool can figure that the value of pi is a little greater than 3, if he/she wants to experiment a little. Draw a circle, the larger the better, and measure the diameter and the circumference (with a string perhaps). Calculate pi=C/2r. You will probably get 3 or 4 digits of accuracy. If you are really good at that sort of thing, you may be able to get 5 digits. That's pretty good. That's better than Archimedes. Try that for a simple low-tech science fair project.


Addendum #2 (trigonometric series):

Here are a couple of series which can be used to approximate pi:

pi/4=1 - 1/3 + 1/5 - 1/7 + 1/9 - . . .

pi2/12=1 - 1/4 + 1/9 - 1/16 + 1/25 - . . .

The first one converges to pi/4 very slowly. The second one is quite a bit faster. There are much better series than these. The first one evidently comes from this series (use x=1):

arctan(x)=x - x3/3 + x5/5 - x7/7 + x9/9 - . . .

The arctangent of x is in radians. Here are some more series:

pi2/6=1 + 1/4 + 1/9 + 1/16 + 1/25 + . . .

pi2/8=1 + 1/9 + 1/25 + 1/49 + . . .

pi2/24=1/4 + 1/16 + 1/36 + 1/64 + . . .

Let's try each of these series for 1000 terms, on my computer. Here are the results:

series pi
pi/4=1 - 1/3 + 1/5 - 1/7 + 1/9 - ... 3.14059265383979
pi2/12=1 - 1/4 + 1/9 - 1/16 + 1/25 - ... 3.14159169961492
pi2/6=1 + 1/4 + 1/9 + 1/16 + 1/25 + ... 3.14063805620598
pi2/8=1 + 1/9 + 1/25 + 1/49 + ... 3.14127432760275
pi2/24=1/4 + 1/16 + 1/36 + 1/64 + ... 3.14063805620599

The last series gave almost exactly the same answer as the third one. The second one was by far the best (about seven digits of accuracy). After 10000 terms, it produces a couple more digits of accuracy: 3.14159264404146


Addendum #3 (comments):

If you have similar triangles (they have the same shape), their areas are equal to some common ratio s times one of the sides (or other part, like an angle bisector) squared. The same thing is true of quadrilaterals and other polygons. In the case of squares, which are all similar to each other, s is 1, the area of a square is the side squared. In the case of a circle (all circles are similar), when the part in question is the radius, then s is pi.

An interesting attempt to estimate pi is this: Drop a needle onto a paper with equally spaced lines on it. Keep track of how many times the needle touches a line, and how many times it does not touch a line. Pi=2L/Pd, where L is the length of the needle, d is the distance between lines, and P is the probability of touching a line. P is estimated by hits/tries, tries is the number of times you dropped the needle, and hits are how many times the needle touched a line. This method is inefficient. Thousands of tries will result in only about 4 digits of accuracy. In 1901, Lazzerini (I do not know his first name) used this method to calculate pi to 6 decimal places, using only 3408 tosses of a needle, a result that sounds to most mathematicians like cheating.


Addendum #4 (calculus):

tall thin rectanglesIn Calculus, we may estimate pi by estimating the area of a semicircle. Here we will use a radius of 1. We know the equation of this semicircle: x2+y2=1, or y=sqrt(1-x2), where sqrt() is the square root function. We estimate the area on a computer, using thin rectangles, which have width delta x (a small increment of x) and height y. We will choose x to be half-way between the left and right sides of each tall rectangle (this gives us a closer fit between the semicircle and the many rectangles). We will get the area, which we already know is (pi)r2/2 (because it is a semicircle). Since r=1, our sum should be pi/2. So, to estimate pi, I will double our sum. I'll just run the program, and report the results:

delta x pi
.001 3.14155546691103
.0001 3.14159147761134
.00001 3.14159261640191

This last one has 8 digits of accuracy and took about three minutes to run in a slow interpreter computer language.


My Sleazy Method of estimating pi:

Jim's methodHere is my own sleazy method for estimating pi. In the diagram, sin a=x, and pi is approximately (360 sin a)/2a or pi=(180 sin a)/a, as a gets small. Angle a is measured in degrees. Let's try this formula on a few values of a, using a calculator:

a pi
.01 3.14154029392740
.0001 3.14159264835381
.000001 3.14159265358927

That is very impressive, about 13 digits of accuracy for that last one. Think about the following:

Question: Can you figure out what is strange about my method?

Answer: My calculator converts the angle to radians, and then uses several terms of an infinite series to estimate the sine. Here is my equation in radians: pi=(pi sin a)/a. We are using pi to estimate pi. Pi=3.14159265358979 is hard coded into my calculator. We are using pi with 15 digits of accuracy to estimate pi to 13 digits of accuracy. That is fairly foolish.


Here is a sleazy fraction which seems to be close to pi: 10471975511/3333333333. This is 3.141592653614 . . ., a remarkable 11 digits of accuracy. OK, I confess. All I did was find the fraction that is the repeating decimal 3.1415926536 1415926536 14 . . ., and reduce it to its lowest terms.

Here is another: 10000000000/3183098862=3.141592653429... That is 9 digits of accuracy. I cheated again. I used pi to figure out the denominator.


Addendum #5 (a complicated series):

There are many series for estimating pi. One of the best (fastest converging) is:

complicated series

which gives about 14 more digits of accuracy for every new term. It was discovered by D. & G. Chudnovsky in 1987. Series like this are probably the ones used by the super computers. Srinivasa Ramanujan was apparently a pioneer in creating several of these complicated, and rapidly converging series.

Alternating series (the terms alternate between positive and negative), like this one and the first two series above, are handier to use, because they automatically give a simple estimate of the error. The true value is always somewhere between the last sum and the next to last sum.

In 1997, pi was calculated to a record 51,539,600,000 digits, by Y. Kanada.


Addendum #6 (Indiana bill):

In 1897, the Indiana State House of Representatives passed a bill (House Bill 246) supposedly setting the value of pi. The bill was defeated in the Senate, despite support from the State Superintendent of Education. It was written by Edward J. Goodwin (who was offering his mathematical results to the State of Indiana, "free of charge"), and introduced by Representative Taylor I. Record. According to David Singmaster, in the Mathematical Intelligencer, the bill was actually ambiguous, and seemed to say that pi is equal to the following values:

4
3.3333 . . .
3.2
3.555558
3.232488
3.265306

It also implied that the square root of 2 is 10/7. The bill can be found in several sources, including the Indiana State Library. See Indiana bill sets the value of pi to 3. My hero, Indiana Bill.


Addendum #7 (Archimedes):

doubling the number of sidesHow did Archimedes estimate pi? The following is a rough approximation of his method. In the diagram on the left, I have drawn one side (with length x) of a polygon inscribed in a circle with radius of 1/2. Then I double the number of sides, producing sides of length y. What is y in terms of x? Application of The Pythagorean Theorem, leads to y=sqrt(1/2-sqrt(1-x)/2). If we start with a hexagon, then x=1/2, and pi is approximated by 6x. I will then use a computer to calculate y, producing a dodecagon (12-gon). Pi is then approximated by 12y. Then y becomes my next x, and I can double the number of sides again, approximating pi with 24y. Archimedes was satisfied with a 96-gon. In the following table, I went on to a 24576-gon:

  sides pi
0 6 3.000000000000001
1 12 3.105828541230250
2 24 3.132628613281237
3 48 3.139350203046872
4 96 3.141031950890530
5 192 3.141452472285345
6 384 3.141557607911622
7 768 3.141583892148936
8 1536 3.141590463236762
9 3072 3.141592106043049
10 6144 3.141592516588155
11 12288 3.141592618640790
12 24576 3.141592645321216

I started losing accuracy after that. I assume that the available square root function is not particularly accurate (about 10 digits). Archimedes not only inscribed a polygon, but he also circumscribed a similar polygon. That would give an upper and lower bound on the answer. So he would know about how accurate he was. But, he didn't have algebra and a computer. So, he stopped at a 96-gon (and his work is difficult to follow without algebra). We and Archimedes started with a hexagon. We could have started with a square, which wouldn't have been any more difficult.


Addendum #8 (science fair project):

estimating pi by hand

Here I have drawn a quarter circle on a 50x50 grid. With a side of 50, the area of the quarter circle should be pi(2500)/4 or 625pi. I have colored the squares that are at least halfway within the quarter circle. My estimate of pi should be the number of blue squares divided by 625. That is 1965/625 or 3.144. That is 3 digits of accuracy, almost as good as Archimedes. It was not very tedious counting the 1965 blue squares, as I didn't have to count every square: the bottom 7 rows are all 50, then next 5 rows are 49, etc. A finer grid, and a larger circle should give us more accuracy.

This method may make a good Science Fair Project. Carefully draw a quarter circle on a very large sheet of graph paper. Probably tape your paper to a smooth floor. You probably want to make the paper small enough so that it will fit in a typical science fair display. But a really huge sheet of paper, with photographs to document just how large it is, would also be nice. Then add some text explaining how you did it (maybe with photographs showing the steps). And display your estimate of pi. Keep records of your arithmetic, and check it several times. If you miss a row, you will be disappointed with the results.

Another way to use a grid like the above, is to connect the diagonals of various rectangles, and estimate pi with a length instead of an area. This should give you a little more accurate results. But it takes a lot more arithmetic, as there are square roots everywhere.


Area of a circle:

area formulaA popular way to prove the area formula is to arrange slices of the circle as shown here. As the slices get thinner, the figure gets closer and closer to a rectangle with sides of r and c/2. We can substitute 2(pi)r for c (definition of pi). Then A=(pi)r2.


Pi on the WWW:


Addendum #9 (1000 decimal places):

Here is pi to 1000 decimal places:

3. 14159 26535 89793 23846 26433 83279 50288 41971 69399 37510 58209 74944 59230 78164 06286 20899 86280 34825 34211 70679 82148 08651 32823 06647 09384 46095 50582 23172 53594 08128 48111 74502 84102 70193 85211 05559 64462 29489 54930 38196 44288 10975 66593 34461 28475 64823 37867 83165 27120 19091 45648 56692 34603 48610 45432 66482 13393 60726 02491 41273 72458 70066 06315 58817 48815 20920 96282 92540 91715 36436 78925 90360 01133 05305 48820 46652 13841 46951 94151 16094 33057 27036 57595 91953 09218 61173 81932 61179 31051 18548 07446 23799 62749 56735 18857 52724 89122 79381 83011 94912 98336 73362 44065 66430 86021 39494 63952 24737 19070 21798 60943 70277 05392 17176 29317 67523 84674 81846 76694 05132 00056 81271 45263 56082 77857 71342 75778 96091 73637 17872 14684 40901 22495 34301 46549 58537 10507 92279 68925 89235 42019 95611 21290 21960 86403 44181 59813 62977 47713 09960 51870 72113 49999 99837 29780 49951 05973 17328 16096 31859 50244 59455 34690 83026 42522 30825 33446 85035 26193 11881 71010 00313 78387 52886 58753 32083 81420 61717 76691 47303 59825 34904 28755 46873 11595 62863 88235 37875 93751 95778 18577 80532 17122 68066 13001 92787 66111 95909 21642 01989 ...


Addendum #10 (more trig):

Above, I said the formula pi/4=1 - 1/3 + 1/5 - 1/7 + 1/9 - ... came from this series for the arctangent (inverse tangent) of x:

arctan(x)=x - x3/3 + x5/5 - x7/7 + x9/9 - ...

Well, this arctan series is also used in other (harder to derive) formulas for pi:

pi=20 arctan(1/7) + 8 arctan(3/79)

pi=4 arctan(1/2) + 4 arctan(1/5) + 4 arctan(1/8)

pi=16 arctan(1/5) - 4 arctan(1/239)

Just use the arctan series to evaluate arctan(1/2), and arctan(1/5), etc. These happen to converge much more rapidly than the pi/4=1 - 1/3 + 1/5 - 1/7 + 1/9 - ... series. Normally, these are given as producing pi/4. I just multiplied by 4. There are other formulas involving arctangents and pi.


Addendum #11 (the Borweins & Ramanujan):

Jonathan and Peter Borwein (at one time holders of the world record for most digits of pi) give the following computer algorithms for calculating pi (which I modified slightly). In both methods, a approaches 1/pi (* is multiplication, ^2 is squared, sqr(2) is the square root of 2):

Method A:

start: n=0; y=1/sqr(2); a=1/2;
repeat: n=n+1; y=(1-sqr(1-y^2))/(1+sqr(1-y^2)); a=(a*(1+y)^2)-y*2^(n+1);

Method B (really efficient):

start: n=0; y=sqr(2)-1; a=6-4*sqr(2);
repeat: {n=n+1; y=(1-sqr(sqr(1-y^4)))/(1+sqr(sqr(1-y^4)));
a=(a*(1+y)^4)-y*(1+y+y^2)*2^(2*n+3)};

Of course, instead of y^2, use y*y, which is way faster. Also, after a few iterations, you will need to do your own multiple precision arithmetic. Method A gives 19 digits of accuracy after four iterations. Method B gives 694 digits of accuracy after only four iterations. The Borweins say that it may be the most efficient known algorithm for calculating pi. It has been used to set several world records.

a formula by RamanujanHere is a formula by Srinivasa Ramanujan (1914). It converges rapidly, giving about 8 more digits of pi, every iteration.


Addendum #12 (more series):

Newton apparently used the following series (and the fact that the arcsin(1/2)=pi/6) to estimate pi:

arcsin(x)=x+(1)(x^3)/(2)(3)+(1)(3)(x^5)/(2)(4)(5)+(1)(3)(5)(x^7)/(2)(4)(6)(7)+ . . .

pi/6=1/2+1/(2)(3)(2^3)+3/(2)(4)(5)(2^5)+(3)(5)/(2)(4)(6)(7)(2^7)+ . . .

With better notation, you don't need all those parentheses. Another series based on the arctangent series is:

(pi^2)/18=1-1/(3)(3)+1/(3^2)(5)-1/(3^3)(7)+1/(3^4)(9)- . . .

And here is an infinite product:

pi/2=2/1x2/3x4/3x4/5x6/5x6/7x . . .

Here is my own series:

pi /8=1/(1x3)+1/(5x7)+1/(9x11)+1/(13x15)+ . . .


Near the beginning of this article, I said that sqr(3)+sqr(2) is approximately pi. Well sqr(3)-sqr(2) is approximately 1/pi. Is that a coincidence? No, it turns out that sqr(3)-sqr(2)=1/(sqr(3)+sqr(2)). A little algebra turns the expression on the right into the one on the left.


Addendum #13 (pi=3.14868804...?):

I have received email from Peter J. Spencer who says that he can prove that pi=3.14868804... He has a formula, and has calculated it to 293 decimal places. He says that this has all been verified by a retired mathematics professor and a computer. Above (addendum #4), I use integral calculus to approximate pi, using thinner and thinner rectangles to approximate the area of a semicircle. Let's do that again:

  width      pi (lower bound)  pi (upper bound)  pi (avg)
  .01        3.12041703177905  3.16041703177905  3.14041703177905
  .001       3.13955546691103  3.14355546691103  3.14155546691103
  .0001      3.14139147761132  3.14179147761132  3.14159147761132
  .00001     3.14157261640196  3.14161261640196  3.14159261640196
  .000001    3.14159065241382  3.14159465241382  3.14159265241382
  .0000001   3.14159245355234  3.14159285355234  3.14159265355234
  .00000001  3.14159263358948  3.14159267358948  3.14159265358948

This time, while estimating pi, I have deduced lower and upper bounds on pi (much as Archimedes did). All of this could be done by hand, except that it would be very tedious to sum 100,000,000 small rectangles. So the process is not at all mysterious. I used an actual circle of radius 1. The area of each rectangle can be found to any accuracy needed. In each of the narrowest rectangles, the width is 0.00000001 and the height is calculated using the pythagorean theorem. Again, this can be calculated to any accuracy needed (as it is an exact formula). The lower bound is found by making the rectangles all fit within the unit semicircle. The upper bound is found by making the upper side just fit outside the unit semicircle (so the circle is inside the collection of rectangles).

Here, I got fifteen digits of accuracy (which is the most accuracy that I can get out of this particular square root function). We can assume that the last digit may be somewhat inaccurate. I could print out a few square roots to verify this; but I won't. In the last row, we find that pi is between 3.14159263358948 and 3.14159267358948. The value of pi given by Mr. Spencer, 3.14868804..., is not in that range. That should convince anyone that his contention is false. No matter where he got his formula, it has nothing to do with circumferences or areas of circles.

These formulas are the work of Mr. Spencer:

pi=3z=C/d
C=xy7z2
d=xy7z/3
C=10!
x=4
y=7
z=360/73
pi=3628800/1152480=3.14868804...

He still contends that his "pi" is correct, and furthermore is rational (3628800/1152480 which reduces to 1080/343). A rational number is an integer divided by an integer (see Irrational Numbers).

All this is a mystery to me. His pi is not pi. Euclid proved that C/d is the same for all circles. There are many ways to measure pi, using real circles (equations of circles), to any desired accuracy. Above, I have proved, using a real circle, that pi is within a fairly narrow range, and 3.14868804 . . . is not in that range.


Of course, Mr. Spencer is still not convinced. Here is a little history about pi:

Archimedes conjectured (guessed) that pi is irrational. In 1761 (said to be 1766 in some books), Johann Heinrich Lambert proved that pi is irrational. And his proof is apparently very difficult. I have not seen the proof. Legendre proved it in 1794. In 1947, Ivan Niven proved it fairly easily. That proof is described in Proofs from THE Book (by M. Aigner and G. Ziegler) as "an elegant one-page proof that needs only elementary calculus." It also requires a couple more pages of proofs of preliminary theorems. Further results from that proof are that pi squared is irrational, and that e^r is irrational for every rational r not equal to zero. It has further been shown, by Lindemann in 1882, that pi is transcendental number (in other words, it is not the root of any polynomial equation with integer coefficients). The proof of that is apparently very difficult indeed.

Above, Mr. Spencer gives z as pi/3. In email, he asks why people think that z is transcendental. Of course, no one has heard of z. They claim that pi is transcendental, which would mean that Mr. Spencer's z is also transcendental, if the equation z=pi/3 were true. Let's forget about "transcendental," as that is a difficult concept, and deal with "irrational." Pi is irrational. Therefore, z must be irrational, if z=pi/3 is true. Above, we see these equations:

C=xy7z2
d=xy7z/3

Mr. Spencer chooses C=10! (ten factorial). And he defines x=4 and y=7. Then he solves the first equation for z and finds that 3z=3.14868804 . . . and is rational. The second equation is not necessary, except to balance the 3z=C/d equation. Well, 3z is not pi, as I proved above. I actually proved that pi is between 3.14159263358948 and 3.14159267358948. 3z (3.14868804 . . .) is not equal to pi.


Mr. Spencer is still trying to convince me. I sent him this rather sarcastic (but accurate, in my opinion) summary of what he has done:

We want "pi" to be 1080/343 (or 3x360/73 or 3.14868804 . . .) and not 3.1415926535 . . . Then we choose an integer (10! or 3628800) with lots of factors as the circumference C of our circle. For no good reason, we will define a z="pi"/3 and we find that 10!=(4)(77)(z2). We used 77 to cancel out the 7's in the denominator of z2, since 7 is only a factor of 10! once. And who knows why we chose z2 instead of z? There is no pi2 in C=(pi)d. Solving for z, we find that it is (surprise!) 360/343. And therefore (surprise!) "pi"=3.14868804 . . .

I told him that the above IS my understanding of his methods. He didn't seem to like the tone of the above. Anyway, this is all algebraic fiddling and has nothing whatsoever to do with a circle. We threw in 360 just to pretend that we might be dealing with a circle.


Addendum #14:

areaOn the far left we see a number of concentric circles, the largest of which has a radius of r. To the right of that, we see each of the circles unrolled into straight lines filling a right triangle. We know that the right end of each line is in a straight line because its length is proportional to its original radius. It would seem that the triangle has the same area as the circle. This may be obvious or it may not be obvious. We can probably prove it using limits. Anyway, we see that the area of the triangle is (pi)r2. This is a fairly popular proof of the area formula.


Return to my Mathematics pages
Go to my home page