MATH 2130 Study Guide - Midterm Guide: Pivot Element, Double-Precision Floating-Point Format, Bisection Method

76 views8 pages
28 Jul 2019
Department
Course
Professor

Document Summary

Prof. a. willms, dept. of mathematics and statistics, university of guelph. Answer these multiple choice questions using the printed. 5 pts: the following matlab code is an incorrect implementation of the xed point iteration xn+1 = g(xn) = The implementation is intended to return the result (an approximation of 5) after two successive values of x are within a relative distance of tolx, or until a maximum number of iterations, maxiter, is reached. Circle all errors and in the blank area to the right give the correct version of the lines with errors. % fpiter - fixed point iteration for g(x) iter = 0; y = x*(1 + 2*tolx); while abs(y-x) > tolx || iter < maxiter iter = iter + 1; y = x; y = 0. 05*(x + 5. 0/x); end. Errors were on lines 1, 5 (two errors), 7, and 8.