Ask your own question, for FREE!
MIT 6.00 Intro Computer Science (OCW) 19 Online
OpenStudy (anonymous):

Are there anymore examples I can attempt to apply the bisection search to?

OpenStudy (anonymous):

in where??? or via which language???

OpenStudy (anonymous):

In Python, the language the course uses.

OpenStudy (anonymous):

okay .... first of all define a function : def f(x) : return x**3 + x -1 It will return the value of function procedure.... then... do you know the process of bisection method??? if you know you can query the method with this function to find..... let me know if you need the method.....

OpenStudy (anonymous):

and try to understand the bisection method process of numeric solutions .... you can take a look here > https://ece.uwaterloo.ca/~dwharder/NumericalAnalysis/10RootFinding/bisection/examples.html

OpenStudy (turingtest):

One of my favorite examples to do with bisection search is finding the square root of a number sqrt(n). For numbers larger than one, we can try half the number, square it, and if it is larger than the input n, we ignore the search space above the number we just tried; if smaller, we ignore the search space below. Once we close in on a number that squares to n (within some margin of error to allow for floating point inaccuracy) that's our root.

OpenStudy (turingtest):

You can then go and write some additional code to handel numbers smaller than 1, so it makes for a nice exercise.

OpenStudy (turingtest):

i should have said that for n > 1, you start off trying the midpoint at (n+1)/2, otherwise you get an infinite loop trying to find sqrt(1.5) (think about why)

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!