## Wednesday, March 6, 2013

### The Search for Pi

Pi is the ratio of the circumference to the diameter in any circle. The ratio is a constant and never changes no matter what size of circle is examined.

It has always been my teaching method to make sure that my students understood the terms I was using. That is, the technical terms and other words that were at the core of the topic I was explaining.

Before I would teach my introductory lecture on solid state physics … the key to understanding transistors and integrated circuits, I made the students look up about fifty technical terms I would use in my lecture and write down the definitions. It was an interesting homework assignment and I didn’t care if they copied off of other student’s papers, as long as they wrote out the definitions in long hand. This was when I was teaching at a private school and I gave them an hour in class to look up the words and write out the definitions.

That way they would understand the key building blocks, the words that were essential to my explanation. In ancient times students would study topics such as mathematics, physics, astronomy, and biology from ancient Greek texts. That’s why all colleges in the middle ages taught the Greek language and it is the root of the phrase, “it’s all Greek to me” as an explanation for not understanding something. In those days it was all Greek.

So I might have said that, “Pi is the ratio of the περιφέρεια to the διάμετρος in any circle.” If you don't know these fundamental terms and what they mean, then that sentence would be "Greek to you!"

Therefore, let me define some terms. I suspect you all know what a “circle” is, but the "circumference" may be a word that is a bit fuzzy for you all these years after school. The circumference of a circle is the linear distance around the outside. In other words, tie a string around a circle and the length of the string is the circumference.

The circumference of a circle is of special importance to geometric and trigonometric concepts. Circumference is a special example of perimeter. I won’t define perimeter. You’ll have to look that one up yourself.

Diameter is the distance from one point on a circle, through the center, and to the other side of the circle. It is a measure of the widest part of a circle. Related to the diameter is the distance from the center to the edge that is called the “radius.” The diameter is exactly twice the length of the radius. We often construct circles with a tool like a “compass” which has two legs with a pin on one leg and a pencil on the other. You set the distance between the two legs to the “radius” and draw circles.

In mathematics and especially geometry, the study of shapes, a drawing is a good illustration of terms. A picture truly is worth a thousand words.

So now the parts of a circle are no longer Greek to us, and we’re ready for some math. So, as I was saying, Pi is the ratio of the circumference to the diameter in any circle. The circumference, c, of any circle is obviously longer than the diameter, d. The question is, how many times as long is it?

Circles all have the same shape, and in figures of the same shape, corresponding lines have the same ratio. This is a fundamental principle established over 2,000 years. Thus, in any circle, c=πd, or, c=2πr, where r is the radius.

Mathematicians selected the Greek letter π, or pi, to stand for this relationship. If you measure the circumference and diameter of a drinking glass or a round table top, you will find that π equals a bit more than 3. Closer measurements would yield around 3 1/7. This is often used for pi when the results need not be too accurate.

Actually, 22/7 is pretty darn close, being accurate to better than 1%. But, as most people know, there is no exact value for pi. Nor is there a fraction that exactly captures pi’s value. The ancient Greeks thought at first that all numbers could be expressed as fractions or ratios, and when they realized that certain values, such as the square root of two, could not be expressed in this “rational” form, they called these new number “irrational.” In today’s terms we could say that an irrational number is one that has an infinite number of numbers beyond the decimal place. (More precisely, it has no repeating numbers since 1/3 is rational and has an infinite number of numbers beyond the decimal, 0.3333333…)

Since π is an irrational number, all finite numbers are just approximations for pi. I memorized pi to about ten decimal places many years ago thinking it was a worthwhile thing to do:

“3.1415926536”

Not only does this sequence of numbers continue forever, but there is no pattern to the numbers. In fact, they make an excellent method for creating random numbers. Pick a series anywhere in the decimal expansion and the values will be random.

We still do not know π, but just a very close approximation of the value, although the approximation is always being increased, if, for no other reason, to demonstrate the power of new computers or the prowess of new programmers. Last I checked, the record was 400,000,000,000, that’s four hundred billion digits, and I’ll bet that has been beaten.

Starting in around 300 BC, a method to calculate the value of pi was developed that depends on drawing a polygon or multiple sided figure inside of the circle and another outside the circle. As you increase the number of sides of the two polygons, the calculation of the perimeter becomes a closer and closer approximation of the value of pi. The value would lie between the calculation of the inner polygon and the outer polygon, so we not only get a value, but also an error limit which would be the difference between the two numbers. That's how the ancient Greeks calculated a value for pi, and they got pretty close.

This diagram doesn't exactly capture the process. The process to calculate pi used one circle and two polygons, one drawn on the inside and one outside of the circle. The more sides in the polygon the closer it seems to be to a circle. As you add sides to the polygon, the formula for the perimeter is a relatively simple algebraic equation. Solve for the perimeter of the outer polygon and the inner and π has a value between the two numbers. When the polygon is increased to several sides, the math takes longer to calculate, but the result gets closer and closer to the actual value. But it will never equal the actual circumference, since polygons have rational values for the perimeter, but circles do not.

This method, although obvious in its ability to produce a good result, is not really very practical. As the size of the polygons grew, the math got very tedious.

The ancient Greek mathematician, Archimedes, used a measure for arc length called the "radian" to calculate pi. A radian is the length of an arc of a circle exactly equal to the radius. (An arc is a portion of the circumference of a circle.) From the formula for circumference (c = 2πr) we see that the circumference is equal to 2π times the radius. Therefore, the circumference is exactly 2π radians in length. Thus, radians can be used in formulas to determine the value of pi.

A little trigonometric thought will demonstrate that, since the tangent of a forty-five degree angle is one (recall that tan x = sin x / cos x and since sin and cos are equal at that point) then arc tan(1) is equal to forty-five degrees. If a total circle is 2π radians or 360 degrees, then half a circle would be π radians or 180 degrees, a quarter circle is π/2 radians or 90 degrees and 45 degrees would equal π/4 radians.

Therefore, the formula for the tangent of 45 degrees can be transposed to yield a formula for pi in terms of the radius.

To solve the equation for pi, you take the inverse or "reciprocal" of the tangent function which is called the "arc tangent" (tan-1).

The arc tangent or "arctan" is literally "the angle whose tangent is." That's the inverse of the Tangent. That is, the arctan(1) = π/4. Therefore, evaluating the value of the arctan at exactly 1 would yield a number equal to one-fourth of pi. Multiply the result by 4 and you get pi … to as many decimal places as you care to have.

You could use a Taylor series to calculate the arctan of one, but the Taylor series converges rather slowly for values near one and very, very, very slowly for values at one. That means you need a lot of terms calculated to get to a good approximation. It isn't as efficient as the next method I'll describe.

Taylor series to evaluate the arctan of t:

t/1 - t3/3 + t5/5 - t7/7 + t9/9 - t11/11…

When t=1, this eliminates all the "power" or exponential terms leaving just

1 - 1/3 + 1/5 - 1/7 + 1/9 - 1/11 …

(Remember, this formula calculates π/4. You multiply the result of this series by 4 to obtain π. The result is 1 - 1/3 = 2/3, plus 1/5, minus 1/7, etc. So it seems this would be a value about 2/3 or a little more and that actually is the familiar 3.14159… It just takes evaluating thousands or even millions of these fractions to get close to the actual number. Very inefficient.)

(It is fascinating, however, that you would get pi — or at least one-quarter of pi — by alternatively adding and subtracting fractions with denominators equal to all the odd numbers. How could that be? What is the relation between a series of odd fractions and pi? Ah, that IS the question! What is the connection??)

The all around best formula for calculating pi involves every other number in the Fibonacci sequence. The Fibonacci sequence is a recursive alliteration. It starts out 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, … It was discovered around 1500 AD and has many interesting uses.

Each term in the Fibonacci series is the sum of the two preceding terms. That's simple, isn't it? This simple series of numbers has many practical uses in mathematics. One is to yield a formula for arc tan that eliminates the problem of evaluating a Taylor series for the value of one.

The formula or series used to calculate the arctan(1) using Fibonacci numbers is:

arctan(1) = pi/4 = arctan(1/2) - arctan(1/5) + arctan(1/13) - arctan(1/34) + arctan(1/89) - arctan(1/233) + …

Note that these values are every other term in the Fibonacci series.

(I am always amazed at how the different branches of mathematics interconnect, and the connections are often amazing. That, in itself, is proof of the existence of an intelligent design to the universe, at least it appears like that to me. It just doesn't seem like it would come from coincidence and random variation.)

You then use a Taylor series to evaluate each term in this series.

Although this method still uses the Taylor series to calculate each term, the series does converge rather quickly for these values much smaller than one, and each term converges even faster. (Note the largest value of t is 1/2 or 0.5 and most other terms are much smaller than that.) Once again, mathematicians figured out how to work "smarter," not "harder."

Thus you use an infinite series to calculate each term in an infinite series. That's a lot of number crunching, but the series converge quickly which means they get very accurate with only a few terms calculated. However, it is interesting that you can use some advanced trigonometric formulas and relationships to get at an algorithm to quickly calculate these values. The calculations involve infinite series of numbers (irrational result), but you can terminate the process and get a good approximation.

To calculate pi to more accuracy, you just calculate more terms in the series. It isn't new math. It just means crunch the numbers longer for a better result.

I won’t go into more detail, but that method has not changed in many years, however, today, we use powerful computers to calculate the result. Somewhere in the middle ages some scribe spent his entire life calculating pi by hand and got an answer with hundreds of digits. Unfortunately he made a math error at around the 75th digit and his result was worthless.

Think about that. Spend your life calculating this number, and you make an error early on and your result is worthless.

As George Takei would say, “Oh Myyyyyy.”

Many ancient peoples besides the Greeks knew in a general way of this relationship between diameter and circumference. For centuries many just used “3.” That was close enough. The Old Testament indicates the value to be 3, without any added decimal. This is indicated in the description of Solomon’s Temple in I Kings, 7. King Hiram of Tyre made for the Temple a circular basin called a “molten sea.” It was “ten cubits from the one brim to the other,” while a “line of thirty cubits did compass it round about.”

As I said earlier, pi can be approximated by the ratio 22/7. The ancient mathematicians similarly used 25/8 (Babylonia), 256/81 (Egypt), or 339/108 (India), each of which is within one percent or better, which is more accurate than most measurable tolerances of the period. We would say, "close enough for government work."

At one point in the twentieth century, a state legislature passed a law setting π as 3 to make things easier. This is the same crowd that brings you the Federal Income Tax System. Does that explain a lot?

So now you know π. My personal favorite is apple, but then you already knew I liked Apple. Just remember, the area of a circle, A, is πr2 or "pi r squared."

Oh no, pie are round, cake are square. Everybody know that. I just wasted my entire mathematical education! Maybe I should have studied Greek.