Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Exercise 3: (2 pts, manually graded) Notice that when we are using the bisection search method to find square roots, we are also finding approximate

image text in transcribed
image text in transcribed
Exercise 3: (2 pts, manually graded) Notice that when we are using the bisection search method to find square roots, we are also finding approximate solutions to the equation x-a = 0, where a is the number we are finding the square root of In this problem we want to find the root of a function, such as g(x) = x - 4x + 1 in the interval [1,2], by writing a function my root (h, left, right) that takes in a function h, and an interval left,right) that contains the root you're trying to find. The output should be the number of quesses required to find the approximate root, as well as the root. For example, when we run my root(9,1,2) our output should be Number of Guesses is 5 1.859375 is close to the root of the given function [ ]: def g(x): return x** 3-4x+1 def my root(h, left, right): epsilon.01 numGuesses-0 # YOUR CODE HERE raise NotImplementedError() print("Number of Guesses is ", numGuesses) Exercise 3: (2 pts, manually graded) Notice that when we are using the bisection search method to find square roots, we are also finding approximate solutions to the equation xt-a= 0, where a is the number we are finding the square root of In this problem we want to find the root of a function, such as g(x)=x - 4x + 1 In the Interval [1,2], by writing a function my rooth, left, right) that takes in a function h, and an interval left,right) that contains the root you're trying to find. The output should be the number of guesses required to find the approximate root, as well as the root. For example, when we run my root(9,1,2) our output should be Number of Guesses is 5 1.859375 is close to the root of the given function (): def g(x): return x**3-4*x+1 def my root (h, left, right): epsilon".01 numGuesses=0 # YOUR CODE HERE raise NotImplementedError() print("Number of Guesses is ", numGuesses) print (ans," is close to the root of the given function

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Infrastructure For Medical Research In Databases

Authors: Thomas Heinis ,Anastasia Ailamaki

1st Edition

1680833480, 978-1680833485

More Books

Students also viewed these Databases questions

Question

Identify three ways to manage an intergenerational workforce.

Answered: 1 week ago

Question

Prepare a Porters Five Forces analysis.

Answered: 1 week ago

Question

Analyze the impact of mergers and acquisitions on employees.

Answered: 1 week ago