Question: Answer using python 5. Return the first value of n such that the sum Sum = 4/1 - 4/3 + 4/5 - 4/7 + ...

Answer using python
5. Return the first value of n such that the sum Sum = 4/1 - 4/3 + 4/5 - 4/7 + ... + 4* (-1)**(n+1)/(2n - 1) is within epsilon of math.pi = 3.141592653589793 For example, if epsilon is 1, then return 1, since 4 is within 1 of pi. If epsilon is 0.5 then return 2, since 4 is not within 0.5 of pi but 4 - 4/3 = 2.67, and that is within 0.5 of pi
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
