How to use binary search to find a function

1.4k Views Asked by At

I am reading somewhere that $$(\phi'(y))^{-1}=y^{-c_1}+y^{-c_2},$$ $c_1,c_2$ are some numbers, can be solved for $\phi$ using binary search. I am surprised because binary search binary search is used to find number in a list. What does this mean really?

2

There are 2 best solutions below

2
On

You usually use it to find a root of a function in some interval. If you have a function $f$ that is continuous on $[a,b]$ with $f(a)$ and $f(b)$ of opposite signs, the intermediate value theorem guarantees that there is at least one root in the interval. You evaluate $f(\frac12(a+b))$, replace the endppoint of the interval of the same sign, and keep going. The interval gets cut in half at each step. There are other, often faster, one dimensional root finding techniques. They are discussed in any numerical analysis text.

0
On

If you want to solve $f(y) = g(y)$ using binary search, then you need to find a zero of a function $f(y) - g(y)$.

For different values of y, you get a list of numbers: $.., f(0) - g(0), .., f(1) - g(1), ..$ So use a same technique as finding a number 0 in that list.