Question
Python: (15) In this problem you will implement the bisection algorithm and per- form tests on it by approximating roots up to a certain number
Python: (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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started