Free logic puzzle — instant play, no signup, no download
Number Guess picks a number in a range and tells you whether each guess is too high or too low. Optimal play is binary search — halve the range every time — and that guarantees you find any number in a small, predictable number of guesses. It is the cleanest possible demonstration of why halving beats scanning.
A secret number is chosen within a stated range.
Make a guess.
You are told whether the target is higher or lower.
Narrow the range and guess again.
Find it in as few guesses as possible.
Binary search reasoning — the habit of halving a search space rather than stepping through it. It is the single most useful search strategy there is and it generalises far beyond numbers.
Always guess the midpoint of the remaining range. Anything else wastes information.
Keep both bounds in mind, not just the last hint. 'Higher' means higher than the last guess and lower than your upper bound.
Round to a convenient midpoint rather than an exact one. The cost is negligible and the arithmetic is much faster.
1 to 100 takes at most seven guesses with perfect halving. If you are using more, you are not halving.
At most the base-two logarithm of the range size, rounded up. For 1 to 100 that is seven.
No. Halving is provably optimal when the only feedback is higher or lower.
Because the arithmetic is trivial and the whole content is the search strategy.
Constantly — it is how you find a bug by bisecting a code history, or a word in a dictionary.