Question: (15) In this problem you will implement the bisection algorithm and per- form tests on it by approximating roots up to a certain number of
-
(15) In this problem you will implement the bisection algorithm and per- form tests on it by approximating roots up to a certain number of digits.
-
(a) Provide the code for the function bisection_algorithm. This func- tion will take as inputs a function f, real numbers a and b which give the bounds for an initial interval and a nonnegative integer num_iterations. You will return a real number which is an ap- proximation to the root of f in the interval [a,b] after performing num_iterations of the bisection algorithm.
-
(b) In this part you will approximate the square root of eleven up to five correct decimal places. You will do this by calling the bisection_ algorithm with a function f, two intial numbers a and b, and the fewest number of iterations such that the error bound guarantees you will have the correct number of digits.
-
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
