- 4 1 In Calculus We Learn That A Geometric Series Has An Exact Sum I 0 Provided That R 1 For Instance If R 5 Then T 1 (98.93 KiB) Viewed 224 times
4.1 In Calculus we learn that a geometric series has an exact sum i=0 provided that r < 1. For instance, if r= .5 then t
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
4.1 In Calculus we learn that a geometric series has an exact sum i=0 provided that r < 1. For instance, if r= .5 then t
4.1 In Calculus we learn that a geometric series has an exact sum i=0 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 - O; % 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. i Add a line at the end of the program to compute the relative error of Snew (with respect to the exact value from the formula above). 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.3 to compute the total distance traveled by the ball while its bounces are at least 0.1 millimeter high. Use a while loop (instead of for) 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.