Question: estimated_pi = sqrt(6 sum(1/n^2)) for n=1 to infinity Define a function called estimated_pi(n) that uses a loop or list comprehension to determine the estimate for
estimated_pi = sqrt(6 sum(1/n^2)) for n=1 to infinity
Define a function called estimated_pi(n) that uses a loop or list comprehension to determine the estimate for where n is the number of iterations to compute. Your function should print the resulting estimate in a statement like "The estimate for pi is x.xxx" with 16-decimal places for . It should also print a statement that says "The difference between the estimate and pi is x.xxx" with 16-decimal places. Use math.pi and the absolute value function in your difference. Recall that there is a list function named sum that could be used here.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
