It is possible to obtain the value of through the infinite sum In this problem, you

Question:

It is possible to obtain the value of π through the infinite sum=  k=1 (-1)*+1 0.5k  0.25

In this problem, you will explore the convergence of this summation for a finite number of terms N,N (-1)k+1 (N) =  0.5k  0.25 k=1

Write a MATLAB function that computes the value of this sum up to a desired value of the residual= | (N) - (N-1)] (N  1)

The latter expression is only valid for N > 1. Your program should compute the value of π(N) and the number of terms N required to reach the first term where the residual is less than ϵ = 10−1, 10−2, . . . , 10−8. Make one semilog plot of the eight outputs for the value of the sum versus ϵ and a log–log plot of the eight outputs for the number of terms needed to compute the sum for a given value of ϵ. Your program should also output the value of π(N) and the value of N for ϵ = 10−8.

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: