How do they calculate Pi?

For the discussion of math. Duh.

Moderators: gmalivuk, Moderators General, Prelates

quesman
Posts: 1
Joined: Tue Apr 05, 2011 4:16 am UTC

How do they calculate Pi?

Postby quesman » Tue Apr 05, 2011 4:20 am UTC

Hey,
I know that Pi is 3.14159........., but how do they calculate that number? If someone wanted to calculate Pi to a certain decimal place, what equation do they use? I have heard of using 22/7, but I've also heard that it's just a rough estimate. So which is the actual expression that will get you Pi?
Thanks,
-AJ

User avatar
webby
Posts: 139
Joined: Sat Jul 03, 2010 11:02 am UTC
Location: Sydney, Australia
Contact:

Re: How do they calculate Pi?

Postby webby » Tue Apr 05, 2011 12:52 pm UTC

There are lots of different ways to do it.

Archimedes estimated pi by estimating the circumference of a circle and dividing it by its diameter. The circumference of a circle was estimated by calculating the perimeter of two many-sided regular polygons - getting an upper bound from the perimeter of a polygon which completely encloses the circle and a lower bound from one which the circle completely encloses.

Now, we instead use complicated series to approximate pi - http://en.wikipedia.org/wiki/Approximat ... th_century.

sccard1
Posts: 3
Joined: Fri Mar 18, 2011 9:00 pm UTC

Re: How do they calculate Pi?

Postby sccard1 » Tue Apr 05, 2011 4:11 pm UTC

There are a whole bunch of ways to compute pi, and there is no set "standard method" to compute pi. One way I have used to estimate pi is to use a Fourier series. Set up a 2-pi periodic Fourier series expansion for f(x)=x. Construct the Fourier series, and set x=pi/2 or pi/4. So the left hand term should be pi/2 or pi/4, then the right hand side should be your Fourier series expansion. Solve for pi and continue expanding. The series should converge, but it converges slowly (i.e after 12 terms or so) and even then it just brackets pi (i.e overshoot, then undershoot). Try that. You might find it to be interesting. I shall warn, a Fourier series can be a pain to construct. If you are unfamiliar with them, look up euler coefficients for Fourier series. It takes time to construct t, but you should be able to plug the resulting expression (solved for pi) into MATLAB and use a for loop to do the computations.

I hope this helps,
sccard1.

User avatar
z4lis
Posts: 767
Joined: Mon Mar 03, 2008 10:59 pm UTC

Re: How do they calculate Pi?

Postby z4lis » Tue Apr 05, 2011 7:29 pm UTC

Here's a link to a formula to calculate any digit of pi you'd like in base 16: http://en.wikipedia.org/wiki/Bailey%E2% ... fe_formula.
What they (mathematicians) define as interesting depends on their particular field of study; mathematical anaylsts find pain and extreme confusion interesting, whereas geometers are interested in beauty.

User avatar
Qaanol
The Cheshirest Catamount
Posts: 3069
Joined: Sat May 09, 2009 11:55 pm UTC

Re: How do they calculate Pi?

Postby Qaanol » Tue Apr 05, 2011 9:57 pm UTC

quesman wrote:Hey,
I know that Pi is 3.14159........., but how do they calculate that number? If someone wanted to calculate Pi to a certain decimal place, what equation do they use? I have heard of using 22/7, but I've also heard that it's just a rough estimate. So which is the actual expression that will get you Pi?
Thanks,
-AJ

One very simple sum that converges (painfully slowly) to π is
[math]\pi = \sum_{n = 0}^{\infty}{(-1)^{n}\frac{4}{2n+1}} = \frac{4}{1} - \frac{4}{3} + \frac{4}{5} - \frac{4}{7} + \frac{4}{9} - \frac{4}{11} + \cdots[/math]
For serious calculations of huge numbers of digits, nowadays most such algorithms are based on the work of Ramanujan, as covered in the Wikipedia article linked by webby above.

In between, as for the past few hundred years, a lot of ways to calculate π were based on various properties of the arctangent function, notably that [imath]\arctan\frac{\pi}{4} = 1[/imath]. One particular summation that is rather neat, although still moderately slow to converge, is the sum of reciprocal squares,
[math]\frac{\pi^2}{6} = \sum_{n = 1}^{\infty}\frac{1}{n^2} = \frac{1}{1^2} + \frac{1}{2^2} + \frac{1}{3^2} + \frac{1}{4^2} + \cdots[/math]
wee free kings

mr-mitch
Posts: 477
Joined: Sun Jul 05, 2009 6:56 pm UTC

Re: How do they calculate Pi?

Postby mr-mitch » Wed Apr 06, 2011 8:29 am UTC

Every time I come across this topic, I keep on trying to find elusive proofs that these series actually do converge, but I never seem to be able to find them. Does anyone have any links proofs, for example for the hypogeometric series(ses)?

User avatar
Dopefish
Posts: 855
Joined: Sun Sep 20, 2009 5:46 am UTC
Location: The Well of Wishes

Re: How do they calculate Pi?

Postby Dopefish » Wed Apr 06, 2011 7:06 pm UTC

Qaanol wrote: One particular summation that is rather neat, although still moderately slow to converge, is the sum of reciprocal squares,
[math]\frac{\pi^2}{6} = \sum_{n = 1}^{\infty}\frac{1}{n^2} = \frac{1}{1^2} + \frac{1}{2^2} + \frac{1}{3^2} + \frac{1}{4^2} + \cdots[/math]


This one, and a number of similar ones can be proven by finding fourier series for things, and then evaulating them at suitable choice of argument. I believe the one above comes from the fourier series of f(t)=t^2 for 0<t<2, and then subbing in t=0 on both sides and doing some rearranging. (Other formulas that give pi that spawn from that same series come from setting t=1, and also if you add the series at t=1 and t=0 and divide by 2, which will cause the even terms to go away.)

User avatar
lamemaar
Posts: 13
Joined: Wed Dec 29, 2010 9:52 am UTC

Re: How do they calculate Pi?

Postby lamemaar » Fri Apr 08, 2011 11:36 am UTC

Computing [imath]\pi[/imath] in, say, 1000 digits, can be done very quickly using this equation:
[math]\pi=48 \arctan \frac{1}{18}+32 \arctan \frac{1}{57}-20 \arctan \frac{1}{239}[/math]
where each of these three arctan values is approximated by
[math]\arctan x = x - \frac{x^3}{3} + \frac{x^5}{5}-\frac{x^7}{7}+\cdots[/math]
I did it some time ago, using a program of my own and getting this result:

3.
1415926535 8979323846 2643383279 5028841971 6939937510
5820974944 5923078164 0628620899 8628034825 3421170679
8214808651 3282306647 0938446095 5058223172 5359408128
4811174502 8410270193 8521105559 6446229489 5493038196
4428810975 6659334461 2847564823 3786783165 2712019091
4564856692 3460348610 4543266482 1339360726 0249141273
7245870066 0631558817 4881520920 9628292540 9171536436
7892590360 0113305305 4882046652 1384146951 9415116094
3305727036 5759591953 0921861173 8193261179 3105118548
0744623799 6274956735 1885752724 8912279381 8301194912
9833673362 4406566430 8602139494 6395224737 1907021798
6094370277 0539217176 2931767523 8467481846 7669405132
0005681271 4526356082 7785771342 7577896091 7363717872
1468440901 2249534301 4654958537 1050792279 6892589235
4201995611 2129021960 8640344181 5981362977 4771309960
5187072113 4999999837 2978049951 0597317328 1609631859
5024459455 3469083026 4252230825 3344685035 2619311881
7101000313 7838752886 5875332083 8142061717 7669147303
5982534904 2875546873 1159562863 8823537875 9375195778
1857780532 1712268066 1300192787 6611195909 2164201989


Return to “Mathematics”

Who is online

Users browsing this forum: No registered users and 12 guests