How is the value of pi derived?

Page 2 - Seeking answers? Join the AnandTech community: where nearly half-a-million members share solutions and discuss the latest tech.

Nitemare

Lifer
Feb 8, 2001
35,461
4
81
Originally posted by: Syringer
Originally posted by: b0mbrman
By measuring using bigger and bigger circles :)

Actually, one real way that I remember is 4 - 4/3 + 4/5 - 4/7 + 4/9...

That's cool. I just tried summing up 100 terms using that on my TI-89, and got 3.13159.

1000 terms gets me 3.14059. Anything bigger takes way too long..

FYI, 10000 terms gets you 3.14S1P5I9D2E6R535897932
 

ActuaryTm

Diamond Member
Mar 30, 2003
6,858
12
81
Originally posted by: Syringer
Originally posted by: b0mbrman
By measuring using bigger and bigger circles :)

Actually, one real way that I remember is 4 - 4/3 + 4/5 - 4/7 + 4/9...

That's cool. I just tried summing up 100 terms using that on my TI-89, and got 3.13159.

1000 terms gets me 3.14059. Anything bigger takes way too long..
The simplification of the arctan series. It's actually exactly pi, when fully evaluated. Unfortunately, it is also terribly inefficient as far as a series is concerned.
 

mygumballs

Member
Sep 21, 2001
160
0
0
an interesting "computer sciencie" way of approximating pi is to create a program to randomly generate points in a square of arbitrary length. you then inscribe a circle in that square and find out how many points are in or on that circle (just use the distance from the center of the square). pi should then approximate to:
pi = 4 * (points in circle) / (total points in square)

the more points your generate, the better the approximatio.
 

dullard

Elite Member
May 21, 2001
26,032
4,676
126
Originally posted by: mygumballs
the more points your generate, the better the approximatio.
Interesting, please tell more. Do you have a link?
Originally posted by: Goosemaster
22/7...if you are lazy...;)
I'm too lazy to read the thread.
 

mygumballs

Member
Sep 21, 2001
160
0
0
Originally posted by: dullard
Originally posted by: mygumballs
the more points your generate, the better the approximatio.
Interesting, please tell more. Do you have a link?

no, a friend of mine just told me about it. but a sort of proof is easy. the ratio of points in teh square to the points in the circle is the same as the ratio of the area of the circle to the area of the square. if the square's sides are x long, then its area is x^2 and the area of the circle is 1/4 pi x^2. therefore the ratio is 1/4 pi.

here's some pseudocode of the process:

int p = 0
for (int i = 0, i < n, i++)
{
x = (random number between 0 and 1 )
y = (random number between 0 and 1 )

if ( squareroot( x^2 + y^2 ) <= 1 )
p++
}
pi = 4 * (p / n)


you choose how big of n you want
 

oboeguy

Diamond Member
Dec 7, 1999
3,907
0
76
Originally posted by: dullard
There are dozens and dozens of ways. Here is a fun method. It is quite powerful at calculating all types of things, but it is slow and inefficient.

Dang you for beating me to the Monte Carlo simulation method.

And to all the morons who didn't understand the OP... PWNED! It was pretty obvious the OP was asking how to compute "pi", not what it is. :D
 

oboeguy

Diamond Member
Dec 7, 1999
3,907
0
76
Originally posted by: dullard
Originally posted by: mygumballs
the more points your generate, the better the approximatio.
Interesting, please tell more. Do you have a link?

Dullard, are you being facetious? Mygumball's method is equivalent. Doh!

 

dullard

Elite Member
May 21, 2001
26,032
4,676
126
Originally posted by: mygumballs
no, a friend of mine just told me about it. but a sort of proof is easy. the ratio of points in teh square to the points in the circle is the same as the ratio of the area of the circle to the area of the square. if the square's sides are x long, then its area is x^2 and the area of the circle is 1/4 pi x^2. therefore the ratio is 1/4 pi.
Time to replace your sarcasm and repost meters. Both are malfunctioning today. I posted that exact solution already in this thread.

I lumped your repost reponse with Goosemaster's repost response for a reason.

 

mygumballs

Member
Sep 21, 2001
160
0
0
Originally posted by: oboeguy
Originally posted by: dullard
There are dozens and dozens of ways. Here is a fun method. It is quite powerful at calculating all types of things, but it is slow and inefficient.

Dang you for beating me to the Monte Carlo simulation method.

And to all the morons who didn't understand the OP... PWNED! It was pretty obvious the OP was asking how to compute "pi", not what it is. :D

oh teh nooeeeeeees! i didn't even know some one already posted that method already. now my posts are obsolete...:(