Guessing a number with high-low hints

Your friend picks a secret integer from 11 to 10001000. 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)+
  1. Each answer halves the search space - this is binary search.
  2. Worst case =log21000=\lceil\log_2 1000\rceil; since 29<10002102^9<1000\le2^{10}, it's 1010.

Answer

Reveal 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

Related questions