Question: Write separate functions for bisect() and polynomial it iterates on Our job then is to describe the bisection method succinctly: We assume that f(x) is

Write separate functions for bisect() and polynomial it iterates on

Our job then is to describe the bisection method succinctly: We assume 

Our job then is to describe the bisection method succinctly: We assume that f(x) is strictly increasing over the interval chosen (call it [I, r]). Suppose also that somewhere inside the interval, f(x) is zero. Then clearly f(l) < 0 and f(r) > 0. We can find the point t where f(t) = 0 by progressively splitting the interval, choosing smaller and smaller intervals until we find t, or the interval is small enough that we consider our answer found. In particular, take a point z that is the mid-point of the interval [1, r]. If f(z) > 0 then clearly the root of f(x) is to be found in the interval [1, z]. Similarly if f(z) < 0 then... What this means is that we can take the new interval [1, z] - replacing r with z - and ask the same question of its mid-point! We can keep doing this until we find z such that f(z) = 0 or until the interval [I, z] (or [z, r] for that matter) is small. In this assignment you will implement this bisection method for root finding. Write a function bisect(), which calls your polynomial function f() repeatedly until it finds the root to within 3 decimal places. Check your bisect() function using f(x) = x - 2, whose root I am sure we all know! Use your program to compute the 7th root of 126, the cube root of 43 and the 5th root of 729. Be careful to choose the right initial interval!

Step by Step Solution

3.54 Rating (154 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Heres an implementation of the bisect function and a polynomial function fx that it iterates on def fx return x2 2 def bisectf a b tol0001 if fa fb 0 ... View full answer

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 Accounting Questions!