Answered You can hire a professional tutor to get the answer.

QUESTION

Next we will use the bisection method to calculate a division function. This will be somewhat similar to Exercise 2. While Ix - yl 2 E: r=x+(y - x)/2...

Next we will use the bisection method to calculate a division function. This will be somewhat similar to Exercise 2.

While |x−y|≥ϵ

|x−y|≥ϵ:

r=x+(y−x)/2

r=x+(y−x)/2

If r∗b>a

r∗b>a then y=r

y=r, or else x=r

x=r

Exercise 4 Calculate a/b, by using the bisection method. Please note the value calculated will not be exact, and may be +/- 0.000001 off from the exact calculation.

Next we will use the bisection method to calculate a division function. This will be somewhat similar to Exercise 2.While Ix - yl 2 E:r=x+(y - x)/2If r * b > a then y = r, or else x = rExercise 4 Calculate ", by using the bisection method. Please note the value calculated will not be exact, and may be +/- 0.000001 off from the exactcalculation.def division ( a, b) :(left, right) = division_searching_interval(a, b)###Begin solution###End solutionreturn left#Test cell: Ex_4_testassert division( 10.5, 2.01) <= (10.5/2.01 + 0. 000001) , "Value too high, please try again."assert division( 10.5, 2. 01) >= (10.5/2.01 - 0.000001), "Value too low, please try again."assert division ( 10.5,2.01) != (10.5/2.01) , "Use bisection method, not python division"assert division( 0.2, 0.006) <= (0.2/0. 006 + 0.000001) , "Value too high, please try again. "assert division( 0.2, 0.006) >= (0.2/0.006 - 0.000001) , "Value too low, please try again."assert division( 0.2, 0.006) != (0.2/0.006) , "USe bisection method, not python division"print( "\nPassed! " )
Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question