Send to a Friend

LostInParadise's avatar

How do you do an optimal binary search on a two variable function?

Asked by LostInParadise (31913points) March 30th, 2012

Suppose we have a symmetric strictly increasing function f(x,y), where x and y are non-negative integers. For a given value k, how do you go about finding all (x,y) such f(x,y) = k? Assume that we start knowing that f(0,y0) is an upper bound.

I was working with this and found that it was not as easy as it seems. Suppose that we find that f(3,7) < k < f(3,8). When we look at f(7,y), because of the symmetry and increasing properties of the function, we know that f(7,3) < k < f(7,8).

Using Fluther

or

Using Email

Separate multiple emails with commas.
We’ll only use these emails for this message.