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 =⌈log⁡21000⌉=\lceil\log_2 1000\rceil; since 29<1000≤2102^9<1000\le2^{10}, it's 1010.

Answer

Reveal answer →

10

Create a free account to see the full worked solution and track your progress.

Interview format: Market Maker, Numerical Reasoning Tests

Related questions