Question: HW 6 (Compute ?) You can approximate ? by using the following series 3 5 7 9 11 2i-1 hat displays the ? value for

 HW 6 (Compute ?) You can approximate ? by using the

following series 3 5 7 9 11 2i-1 hat displays the ?

HW 6 (Compute ?) You can approximate ? by using the following series 3 5 7 9 11 2i-1 hat displays the ? value for i 10000, 20000, .. , and Write a program t 100000 Hint: This is a sample of series in mathematics. The more terms you use, y??approximation will become more accurate. We know that pi 3.14159265359. Now let's see how the above series can be used to get pi If we use only 1 term from the series, then we will have P 4 (1) 4 This is not exactly pi, but 4 is close enough to the exact value of the pi 3.14159265359. Now let's add one more term P 4 (1-1/3) 2.66 Now we add the third term: P 4*(1-1/3+1/5) 3.466 As you see we are getting closer by adding more terms. Let's add a few more terms P = 4*(1-1/3+1/5-1/7) = 2.89 One more 4*(1-1/3+1/5-1/7+1/9) 3.33 As you see step by step we are getting closer to the exact value of the pi which is 3.14159265359. Lets add some more terms and see how exact can be this formula 4*(1-1/3+1/5-1/7+1/9-1/11+1/13-1/15+1/17-1/19+1/21-1/23+1/25-1/27+1/29-1/31+1/33- 1/35+1/37-1/39+1/41-1/43+1/45) 3.18 As you see 3.18 is close enough to 3.14 and we continue this for many times, we will get much closer to the exact value Your task here is to write a program that get the i(the number of terms in the series) and find the estimated value of pi. The higher value user enters for the input, the longer program will take to run and the higher will be the precision of the estimation

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!