41 Calculus Learn Geometric Series Exact Sum M L Provided R 1 Instance R 5 Sum Exactly 2 S Q43865396

4.1 In Calculus we learn that a geometric series has an exact sum m=L provided that r < 1. For instance, if r = .5 then the sum is exactly 2. Below is a script program that lacks one line as written. Put in the missing command and then use the program to verify the result above. How many steps does it take? How close is the answer to 2? % Computes a geometric series until it seems to converge format long format compact r = .5; Snew = 0; % start sum at 0 Sold = -1; % set Sold to trick while the first time i = 0; % count iterations while Snew > Sold % is the sum still changing? Sold = Snew; % save previous value to compare to Snew = Snew + r`i; i=i+1; Snew % prints the final value. % prints the # of iterations. Add a line at the end of the program to compute the relative error of Snew versus the exact value. Run the script 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. 4.2 Modify your program from exercise 3.2 to compute the total distance traveled by the ball while its bounces are at least 1 millimeter high. Use a while loop to decide when to stop summing; do not use a for loop or trial and error. Turn in your modified program and a brief summary of the results. Show transcribed image text 4.1 In Calculus we learn that a geometric series has an exact sum m=L provided that r Sold % is the sum still changing? Sold = Snew; % save previous value to compare to Snew = Snew + r`i; i=i+1; Snew % prints the final value. % prints the # of iterations. Add a line at the end of the program to compute the relative error of Snew versus the exact value. Run the script 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. 4.2 Modify your program from exercise 3.2 to compute the total distance traveled by the ball while its bounces are at least 1 millimeter high. Use a while loop to decide when to stop summing; do not use a for loop or trial and error. Turn in your modified program and a brief summary of the results.
Expert Answer
Answer to 4.1 In Calculus we learn that a geometric series has an exact sum m=L provided that r < 1. For instance, if r = .5 then ...
OR