All of you have played the game of high-low in some variation. You are asked to guess a number between $1$ and $n$ where $n$ is often $100$. Your goal is to determine the number in the minimum number of guesses.
When you guess a number, the responses are "You got it" if you correctly guessed the number, "High" if the number you guessed was larger than the number to be guessed, and "Low" otherwise.
Input: the upper bound $n$, and a response to a question "Is it $m$?"
Output: the hidden number.
Describe an algorithm to guess the number. You should try to make sure that your algorithm never requires more than $\left\lceil \log_2(n + 1) \right\rceil$ guesses, and you should never need to guess the same number twice.