As the geometer his mind applies
To square the circle, nor for all his wit
Finds the right formula, howe'er he tries
1) The first method is the definition itself. So what is the definition of 'Ï€'? Come on, go back to your high school days. Yes, the oldest and most prevalent one is it is the 'ratio of the circumference of circle to its diameter'. So, your task is simple - Just take a compass and draw a circle with unit radius. Take a rope and place it on the circumference and measure its length. Now 'Ï€' is just half of the obtained length. Job done! You have calculated value of 'Ï€'. But the as stated above, Mathematicians require precision. Assuming you drawn a perfect circle and you use regular ruler to measure length of 'perfectly thin' rope you will get it right up-to around first decimal place. That's OK, for first try. But wait we can do better. Now draw a circle with radius 10 times the previous radius and "cha-ching"!!!..you have precision up-to second decimal place. Now go on increasing radius and in theory you can go to infinite precision. But we all know that's just a ridiculously hard method to find 'Ï€'. Let;s see if we can do better in further methods.
Bonus - You can do this even with a spherical ball. Just fill that ball with water. Next, weigh the ball+water and subtract the mass of the ball from it. We know the 1kg of water = 1L of water. Hence we know the volume of water a.k.a volume of sphere. 3/4th of this volume will give you 'Ï€'. Easy? Damn yes....Practical for Mathematicians? Not so much....
2) So we have 1(and half) method behind us. What next? We can still do a bit with geometry. Not surprisingly, all the initial calculation of value of 'pi' is through geometry. Consider the following figure- Here we draw two squares(regular polygon of side 4), outside and inside the circle and compare the areas.
In 1st figure
In 1st figure
In 2nd figure
Now, we inscribe circle into more complex regular polygons and repeat the process in a similar way i.e compare the areas and give upper and lower limits(Areas of polygon can be found very easily).
Theoretically, a polygon of infinite sides should give us a perfect result. But practically this is not possible. However we can go very far with method. In fact Archimedes had used this method to find 'Ï€' and he had reached up-to a regular polygon of '96' sides simply called '96'-gon. With this he had estimated 'Ï€' to close to 3+1/7. This is close to 3.1428!!. This is very close to current estimates of
3.1415. Even with no proper algebra, number system Archimedes had estimated 'Ï€' to such high
accuracy.
EUREKA!!!
Francois Viete took this method further and used 393,216 sided polygon and calculated 'pi' up to 9 decimal place. Now that's what we should be aiming for - 393,216 sided polygon.
VOILA!!!
This method was further improved and values up-to 700-800 decimal places was found.
3) Next for a simple method let's check out our beloved Trigonometry and calculus for help. We know that tan(π/4) = 1. Thus its inverse, arctan(1) = π/4. Now we should get our hands dirty(don't blame me). We can expand any function at some point in terms any variable of our choice. If we expand in terms of sine and cosine functions it is called Fourier series. If we do it with polynomials we can call it Taylor series expansion. Now we can expand arctan function using Taylor which leads to messy formula(please do look up if want). The point is we can do it for any function and here we do it for arctan. Next I know arctan(1) = π/4 =1 - 1/3 + 1/5 - .... (got by using the expansion). Thus we can predict 'π' accurately. But this converges very slowly - on running a python code with 5000000 iterations we get 5 decimal places accuracy. But we can use other trigonometric functions for the purpose, modify them and get better results.
Francois Viete took this method further and used 393,216 sided polygon and calculated 'pi' up to 9 decimal place. Now that's what we should be aiming for - 393,216 sided polygon.
VOILA!!!
This method was further improved and values up-to 700-800 decimal places was found.
3) Next for a simple method let's check out our beloved Trigonometry and calculus for help. We know that tan(π/4) = 1. Thus its inverse, arctan(1) = π/4. Now we should get our hands dirty(don't blame me). We can expand any function at some point in terms any variable of our choice. If we expand in terms of sine and cosine functions it is called Fourier series. If we do it with polynomials we can call it Taylor series expansion. Now we can expand arctan function using Taylor which leads to messy formula(please do look up if want). The point is we can do it for any function and here we do it for arctan. Next I know arctan(1) = π/4 =1 - 1/3 + 1/5 - .... (got by using the expansion). Thus we can predict 'π' accurately. But this converges very slowly - on running a python code with 5000000 iterations we get 5 decimal places accuracy. But we can use other trigonometric functions for the purpose, modify them and get better results.
Not only trigonometry but we can use various other methods. Ramanujan is well known for his very fast converging formulas for 'Ï€'. His formulas give accuracy up-to several decimal places in just a single iteration. Here are some of them(as expected they look otherworldly)-
Bonus 1 - Here is the Python program for Trigonometric formula
>>> sum = 0
>>> for i in range(1,10000000,2):
k = int((i - 1)/2)
sum += ((-1)**k) * (1.0/i)
>>> pi = 4 *sum
Bonus 2 - Among the formulas, the Riemann zeta value of 'Ï€' is interesting because it comes along with Riemann-Zeta function and Riemann's conjecture is closely attached to it. It's still an unsolved problem and one who solves it will get Millenium prize with prize money of US $1 million. It is one among the 7 Millennium Prize problems.
4) Above 3 are some of the conventional methods to find 'Ï€' and they are very good at that. But there is one which sounds funny but works and has a solid mathematical basis. So here I go- just do whatever I tell and you shall manually find value of 'Ï€'.
Go out and draw a square of side '2' units and then draw a circle inside it as shown in figure1 above. This will have unit radius. Now a bit far from the setup and start throwing stones on the setup so that they fall at some place inside the square, wherever it may be. To get better results, blindfold yourself and start throwing stones in the direction of the setup. Continue this process until you are exhausted or stones around you are exhausted(or until you hit someone with a stone). Now remove the blindfold and start counting how many stones are inside the square and also how many of those are inside circle. Now divide no.of stones inside circle by no.of stones inside square as a whole. Multiply the obtained number by 4 and VOILA!!! You have calculated π. You will have a pretty good approximation of 'π' if you follow the above method. This is called 'Monte-Carlo' method. It is based on probability. It works in following way. I am sure you have solved problems on probability in 12th(if not you will learn it now!). Given 10 balls of different colors of which 2 are blue, what is the probability of getting a blue ball if you draw a ball at random? The answer is 2/10. Now greatly increase no.of balls and make it almost infinity. And spread them over your square. And increase no.of blue balls and spread them over your circle. Now I ask above question again, what's your answer? Naturally, the probability should be Area of circle/Area of the square. We also know that probability is no.of success/ no.of trials. In our experiment success is hitting circle and trials is hitting square. Thus combining two concepts we get π to [4*no.of stones inside the circle(success)/ no.of.stones inside square(trials)]. There you have your 'pi'. This can be checked in python by coding the algorithm. So here is the algorithm-For square of size 40 centered at the origin. This program gives pi up-to 2 decimal places. But for longer runs, it should give better results.
>>>import random
>>>n_hits = 0
>>>n_trials = 10**6
>>>for n_trials in range(n_trials):
x,y = random.uniform(-20,20),random.uniform(-20,20)
if x**2 + y**2 < 400 : n_hits+=1
>>>pi = 4 * n_hits/n_trials
>>>print(pi)
>>> sum = 0
>>> for i in range(1,10000000,2):
k = int((i - 1)/2)
sum += ((-1)**k) * (1.0/i)
>>> pi = 4 *sum
Bonus 2 - Among the formulas, the Riemann zeta value of 'Ï€' is interesting because it comes along with Riemann-Zeta function and Riemann's conjecture is closely attached to it. It's still an unsolved problem and one who solves it will get Millenium prize with prize money of US $1 million. It is one among the 7 Millennium Prize problems.
4) Above 3 are some of the conventional methods to find 'Ï€' and they are very good at that. But there is one which sounds funny but works and has a solid mathematical basis. So here I go- just do whatever I tell and you shall manually find value of 'Ï€'.
Go out and draw a square of side '2' units and then draw a circle inside it as shown in figure1 above. This will have unit radius. Now a bit far from the setup and start throwing stones on the setup so that they fall at some place inside the square, wherever it may be. To get better results, blindfold yourself and start throwing stones in the direction of the setup. Continue this process until you are exhausted or stones around you are exhausted(or until you hit someone with a stone). Now remove the blindfold and start counting how many stones are inside the square and also how many of those are inside circle. Now divide no.of stones inside circle by no.of stones inside square as a whole. Multiply the obtained number by 4 and VOILA!!! You have calculated π. You will have a pretty good approximation of 'π' if you follow the above method. This is called 'Monte-Carlo' method. It is based on probability. It works in following way. I am sure you have solved problems on probability in 12th(if not you will learn it now!). Given 10 balls of different colors of which 2 are blue, what is the probability of getting a blue ball if you draw a ball at random? The answer is 2/10. Now greatly increase no.of balls and make it almost infinity. And spread them over your square. And increase no.of blue balls and spread them over your circle. Now I ask above question again, what's your answer? Naturally, the probability should be Area of circle/Area of the square. We also know that probability is no.of success/ no.of trials. In our experiment success is hitting circle and trials is hitting square. Thus combining two concepts we get π to [4*no.of stones inside the circle(success)/ no.of.stones inside square(trials)]. There you have your 'pi'. This can be checked in python by coding the algorithm. So here is the algorithm-For square of size 40 centered at the origin. This program gives pi up-to 2 decimal places. But for longer runs, it should give better results.
>>>import random
>>>n_hits = 0
>>>n_trials = 10**6
>>>for n_trials in range(n_trials):
x,y = random.uniform(-20,20),random.uniform(-20,20)
if x**2 + y**2 < 400 : n_hits+=1
>>>pi = 4 * n_hits/n_trials
>>>print(pi)
These are some the simple methods that I have come across to calculate 'Ï€'. Because of its amazing property to pop up in every field it has generated much attention. You can already see the variety of methods and fields we have come across in the process and this just a drop in the ocean. There much more interesting problems in the field and that is for another day (i.e once I understand them, and if you already know about please write a post about and drop a link!!!).
Source -
1) Lots of interesting discussion and stories are available in Journey through Genius, by William Dunham. It also contains various other math topics. Do check it out. It's AWESOME.
1) Lots of interesting discussion and stories are available in Journey through Genius, by William Dunham. It also contains various other math topics. Do check it out. It's AWESOME.
It is a treat to read your article. So much of interesting things.
ReplyDeleteThank you Vinayaka
Delete