Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I\'m using Python 2. The sum shown below is: pi = 4*((((-1)**k)/(2*k+1))*(4*((1/

ID: 3602510 • Letter: I

Question

I'm using Python 2. The sum shown below is: pi = 4*((((-1)**k)/(2*k+1))*(4*((1/5)**(2*k+1))-((1/239)**(2*k+1))))

Python: Implement the sum of 00 (-1) k=0 2k+1 1 2k+1 239 in a python loop to estimate to an accuracy of 10-12 That is, 3.141592653589 to 12 significant figures. Print all intermediate iterations to get to . (Hint: if all of the itererations do not fit on single computer screen at once, you have made a mistake.) Please print all the iterations. So for example, output should look something like: (approximated pi, iteration1) (approximated pi, iteration2) (approximated pi. iteration3) etc. until approximated pi is accurate to 12 significant figures.

Explanation / Answer

approximated pi = 3.18326359832636, iteration1
approximated pi = 3.1405970293260608, iteration2
approximated pi = 3.141621029325035, iteration3
approximated pi = 3.1415917721821778, iteration4
approximated pi = 3.1415926824044, iteration5
approximated pi = 3.141592652615309, iteration6
approximated pi = 3.1415926536235554, iteration7
approximated pi = 3.141592653588603, iteration8
approximated pi = 3.1415926535898366, iteration9