Ways to Calculate the Mysterious Number Pi
How many digits of pi do you know? Most Americans know only 3.14, but you may know more. 5 digits? 20? 50? 100? 200? Personally, as a pi geek, I know over 200 digits of pi - but really, that'll do you no good. With 10 digits of pi, you could calculate the circumference of the earth to a fraction of an inch, and with 30 digits, you could calculate the spherical volume of the universe. However, I do know that pi memorizing seems to be a hobby for math geeks, and I know some people that memorize hundreds of digits of pi [cough, cough David]. But if you don't have a list of digits of pi in your pocket all the time, here are some ways to calculate pi (arranged in order of easiest to hardest):
One of the easiest ways to calculate pi, however, this way converges very slowly and you will need to calculate a few hundred terms to get a few correct digits, so this is not recommended, unless you can program a computer that can calculate a few thousand terms per second. The Gregory-Leibniz Series: pi = 4/1 - 4/3 + 4/5 - 4/7 + 4/9 - 4/11 + 4/13 - 4/15... After calculating 500,000 correct terms, you will get 5 correct digits of pi (good luck with trying to get 200). So, not the best way to calculate pi, but a simple one.
Another easy way to calculate pi is also using an infinite series, called the Nilakantha Series: pi = 3+4/(2*3*4)-4/(4*5*6)+4/(6*7*8)-4/(8*9*10)+4/(10*11*12)... This is a little more complex than the Gregory-Leibniz Series, but converges much much faster. Try this one instead.
Another easy way to calculate pi is using limit of product: pi/2 = 2*2/1*3 * 4*4/3*5 * 6*6/5*7 * 8*8/7*9...
Note: You have to multiply that result by 2 to get pi because the result is equal to pi/2
One more easy way... using limit of series:
pi/2 1+1/3(1/2)+1/5(1*3)/(2*4)+1/7(1*3*5)/(2*4*6)+1/9(1*3*5*7)/(2*4*6*8)...
This way is created by Ramanujan (I honestly have no idea how this works, but it does!):
Here's the Madhava formula:
Here's the Newton formula:
And here's 2 ways to figure out pi using trigonometry and calculus! (Pretty good ways but very complex calculations):
Calculating pi using a limit is easy: pi = n*sin (180 degrees /n). The higher n is, the more accurate your estimate of pi will get. This is because this function is limited to pi.
Arcsine Function: 2*(Arcsin(sqrt(1-x^2))+abs(Arcsin(x))). Arcsine = inverse sine in radians, and abs = absolute value. Your value, x, however, must be in between 1 and -1.
Here's the BEST way, this formula only uses the 4 basic operations and a square root, and it has quadratic convergence, which means that the number of correct digits you get grows exponentially with the number of iterations you have. So by calculating this to 25 iterations would produce over 45 million digits of pi! I present the Gauss-Legendre Algorithm:
Finally, here's some continued fractions formulas:
I hope this was fun! Let me know in the comment sections if you tried any methods and how many digits you got. Any other formulas you want me to add? Also let me know in the comment sections. All right, that's all for now, but I'll get back to you in a few days, where we explore a few ways to calculate the mathematical constant e.
One of the easiest ways to calculate pi, however, this way converges very slowly and you will need to calculate a few hundred terms to get a few correct digits, so this is not recommended, unless you can program a computer that can calculate a few thousand terms per second. The Gregory-Leibniz Series: pi = 4/1 - 4/3 + 4/5 - 4/7 + 4/9 - 4/11 + 4/13 - 4/15... After calculating 500,000 correct terms, you will get 5 correct digits of pi (good luck with trying to get 200). So, not the best way to calculate pi, but a simple one.
Another easy way to calculate pi is also using an infinite series, called the Nilakantha Series: pi = 3+4/(2*3*4)-4/(4*5*6)+4/(6*7*8)-4/(8*9*10)+4/(10*11*12)... This is a little more complex than the Gregory-Leibniz Series, but converges much much faster. Try this one instead.
Another easy way to calculate pi is using limit of product: pi/2 = 2*2/1*3 * 4*4/3*5 * 6*6/5*7 * 8*8/7*9...
Note: You have to multiply that result by 2 to get pi because the result is equal to pi/2
One more easy way... using limit of series:
pi/2 1+1/3(1/2)+1/5(1*3)/(2*4)+1/7(1*3*5)/(2*4*6)+1/9(1*3*5*7)/(2*4*6*8)...
This way is created by Ramanujan (I honestly have no idea how this works, but it does!):
And here's another Ramanujan-type formula created by the Chudnovsky brothers that was used to break the world record for calculating digits of pi:
Here's the Madhava formula:
Here's the Newton formula:
And here's 2 ways to figure out pi using trigonometry and calculus! (Pretty good ways but very complex calculations):
Calculating pi using a limit is easy: pi = n*sin (180 degrees /n). The higher n is, the more accurate your estimate of pi will get. This is because this function is limited to pi.
Arcsine Function: 2*(Arcsin(sqrt(1-x^2))+abs(Arcsin(x))). Arcsine = inverse sine in radians, and abs = absolute value. Your value, x, however, must be in between 1 and -1.
Here's the BEST way, this formula only uses the 4 basic operations and a square root, and it has quadratic convergence, which means that the number of correct digits you get grows exponentially with the number of iterations you have. So by calculating this to 25 iterations would produce over 45 million digits of pi! I present the Gauss-Legendre Algorithm:
- Initial value setting:
- Repeat the following instructions until the difference of and is within the desired accuracy:
- π is then approximated as:
Finally, here's some continued fractions formulas:
I hope this was fun! Let me know in the comment sections if you tried any methods and how many digits you got. Any other formulas you want me to add? Also let me know in the comment sections. All right, that's all for now, but I'll get back to you in a few days, where we explore a few ways to calculate the mathematical constant e.
I think some of the images got cut off at the top and the bottom. Different ways for the square root of 2 would be fun also. Great post!!!
ReplyDeleteYeah I will do e soon and maybe sqrt(2)... thanks. Also, no images got cut off. And please hurry up and make a post
ReplyDeleteOK.
Delete