Problem 954. Pi Estimate 2
Solution Stats
Problem Comments
-
7 Comments
It seems that the formula is an infinite sum of factorial(n)^2/factorial(2*n+1) (starting at zero) multiplied by
9/(2*sqrt(3)), When (current sum - previous sum) < 10^-n then we should stop the infinite sum. One expected output is the number of summands and the other is our estimated value for pi (rounded to 10 decimal places) in this order. Good luck for anyone trying.
Thanks Rafael!
For the record the stopping condition should use 10^-d, not 10^-n.
More precisely, we aim to utilize the relation
$$ \sum_{n=1}^{\infty} \frac{(n!)^2}{(2n+1)!} = \frac{2\sqrt{3}}{9}\pi-1 $$
to estimate the value of $\pi$ by iteratively adding terms from this series and comparing successive partial sums to a desired level of accuracy.
Solution Comments
Show commentsProblem Recent Solvers47
Suggested Problems
-
Count from 0 to N^M in base N.
236 Solvers
-
Back to basics 13 - Input variables
268 Solvers
-
477 Solvers
-
The Answer to Life, the Universe, and Everything
544 Solvers
-
Relative ratio of "1" in binary number
1455 Solvers
More from this Author4
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!