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

  1. (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.

    1. (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.

    2. (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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!