Problem 2635. Higher! Lower!
Solution Stats
Problem Comments

8 Comments
Test suite should have assert(isequal(...)).
It's an interesting problem. Unfortunately without any assert, the test suite does not test anything. So any syntactically correct answer succeeds even if it doesn't solve the problem.
Fixed, and (hopefully) rescored. Thanks for the heads up.
your example ([5 7 8]) is not really following the optimal bisection approach. After you choose 5, the new bounds are not 5 and 10, they are 6 and 10, so your next choice should be 8 ((6+10)/2) instead of 7...
The misplaced comment line in the first test case breaks the test suite (at least for "conventional" solutions).
Emphasized Alfonso NietoCastanon Comments "your example ([5 7 8]) is not really following the optimal bisection approach. After you choose 5, the new bounds are not 5 and 10, they are 6 and 10, so your next choice should be 8 ((6+10)/2) instead of 7..."
test suit is broken plz fix since its a budge problem
I used this idea to create a similar problem that requires solvers to apply the bisection method correctly (see previous comments). https://www.mathworks.com/matlabcentral/cody/problems/46603higherlowercorrect
Solution Comments
Show commentsProblem Recent Solvers37
Suggested Problems

289 Solvers

229 Solvers

Side of an equilateral triangle
5733 Solvers

Pernicious Anniversary Problem
816 Solvers

Return fibonacci sequence do not use loop and condition
519 Solvers
More from this Author80
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!