Guessing a number with high-low hints
Your friend picks a secret integer from to . You guess repeatedly; after each guess you're told whether the secret is higher or lower. Playing optimally, how many guesses do you need in the worst case to guarantee finding it?
Show hints (2)+
- Each answer halves the search space - this is binary search.
- Worst case ; since , it's .
Answer
Reveal answer →Final answer
10
Want the full step-by-step worked solution? It's part of Premium - along with a worked solution for every question in the bank.
Asked at: Jane Street, Optiver