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

In Calculus, we learn that a geometric series has In Calculus, we learn that a g

ID: 3851752 • Letter: I

Question

In Calculus, we learn that a geometric series has In Calculus, we learn that a geometric s has an exact sum OO 1-r i 0 provided that lrl 1. For instance, ifr 0.5, then the sum is exactly 2. Write a MATLAB function to calculate the approximation (the summation) using a stopping criterion of 0.01% Run your file for r-0.9, 0.99, 0.999, 0.9999, 0.99999, and 0.999999. In a table, report the number of iterations needed and the relative error for each r. Show transcribed image text In Calculus, we learn that a geometric series has an exact sum: Sigma^infinity _i = 0 r^i = 1/1 - r, provided that |r| < 1. For instance, if r = 0.5, then the sum is exactly 2. Write a MATLAB function to calculate the approximation (the summation) using a stopping criterion of 0.01%. Run your file for r = 0.9,0.99,0.999,0.9999,0.99999, and 0.999999. In a table, report the number of iterations needed and the relative error for each r.

Explanation / Answer

xs = [0,1,1,0,0];
xt = [0.25,0.75,0.75,0.25,0.25];
ys = [0,0,1,1,0];
yt = [0.25,0.25,0.75,0.75,0.25];
plot(xs,ys,'b-')
hold on
axis equal
ylim([-0.1,1.1])
plot(xt,yt,'b-')
plot(xs,ys,'k.','MarkerSize',12)
plot(xt,yt,'k.','MarkerSize',12)
text(-0.1,0.5,'0','Color','r')
text(0.5,0.5,'0','Color','r')
text(1.1,0.5,'0','Color','r')
text(0.15,0.15,'1','Color','r')
text(0.85,0.85,'1','Color','r')
text(0.5,0,'1')
text(0.99,0.5,'2')
text(0.5,1,'3')
text(-0.01,0.5,'4')
text(0.5,0.25,'5')
text(0.74,0.5,'6')
text(0.5,0.75,'7')
text(0.24,0.5,'8')
annotation('arrow',[0.6,0.7],[0.18,0.18])
annotation('arrow',[0.6,0.7],[0.86,0.86])
annotation('arrow',[0.26,0.26],[0.7,0.8])
annotation('arrow',[0.77,0.77],[0.7,0.8])
annotation('arrow',[0.53,0.63],[0.35,0.35])
annotation('arrow',[0.53,0.63],[0.69,0.69])
annotation('arrow',[0.39,0.39],[0.55,0.65])
annotation('arrow',[0.645,0.645],[0.55,0.65])