Question: add the complete code (python) Write a function estimatePi( to estimate and return the value of pi based on the formula found by an Indian

add the complete code (python) Write a function estimatePi( to estimate andadd the complete code (python)

Write a function estimatePi( to estimate and return the value of pi based on the formula found by an Indian Mathematician Srinivasa Ramanujan. It should use a while loop to compute the terms of the summation until the last item is smaller than 1e -15. The formula for calculating distance is given below: 7T k=0 1 22 * (4k)!(1103 + 26390k) jo 9801 (k!)43964k where k! is the factorial of k. Examples >>> estimatePi() 3.14159265359 10 pt JUAWNA 1 def estimatePi(): 2. import math 3 def factorial(n): if n == 0: return 1 else: return n * factorial(n-1)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!