Question: Using Matlab write a code: 6. An approximation for pi is given by: 2n +1 n=0 In series summations such as the one included above,
Using Matlab write a code:
6. An approximation for pi is given by: 2n +1 n=0 In series summations such as the one included above, you must plug each of the n values into the equation, and then add all the results together. In this series, notice that n goes from zero to infinity. Since we can't sit here and plug in an infinite amount of numbers, instead we will only calculate up to some finite upper n value. By stopping early, we are calculating a "partial sum" (rather than the total sum). Use loops to continue adding terms to your partial sum until you reach a satisfactory approximation of pi. The series reaches a satisfactory approximation when the absolute error between your sum and the true value of pi is sufficiently small, given by: pi - partialSum 1 10-15 pi In a sentence, display the final value of n that was used, as well as the value of your approximation (the value of the partialSum) up to 6 decimal places
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
