the question is like this: there is a sorted list of n numbers. Given x, find a number which is equal to x in the sorted list. Here we assume that x is indeed in the list. There is an oracle that can answer “yes” or “no” to your question “whether x>=y?”. Unlike normal binary search, the oracle is allowed to lie once to your question. The most naive way to solve this problem is you ask each question twice to the oracle. If the two answers are the same, you know that the orale is not lying. This algorithm we need compare 2log_2(n) times. But this question ask me to find an algorithm that can find x using only log_2(n)+o(logn) comparisons.
I tried very hard but failed. Can anybody give me some advice on how to solve this problem? Thank you.
Keep track of the interval you are in. If you need a total of
kquestions, check for consistency (whether you are in the interval you are supposed to be) everysqrt(k)steps. While checking for consistency you may ask each question twice to be sure. If you detect inconsistency, go backsqrt(k)steps. You will be asking no more thanc*sqrt(k)additional questions.