Halving Search
Guess a number from 1 to 100 in as few tries as you can, with only "higher" and "lower" as clues. Then watch how a computer does it.
Guess number 1
Could still be right: 100 1 – 100
The computer has picked a number. Enter a guess.
A simplified teaching model.
How to play
Your goal is to find the number in as few guesses as possible. In "You guess", the computer picks a number and you guess it. The only clues are "higher" or "lower". The dark part of the bar shows the numbers that could still be right. In "Computer guesses", you think of a number in your head. Answer each of the computer's guesses with "Higher", "Lower" or "Correct". Press "Show it automatically" to watch the computer do it alone. Choose a range of 1 to 100 or 1 to 1,000,000.
Learn more
Each time you guess the middle number, the possibilities are cut exactly in half. For 100 numbers: 100, 50, 25, 12 and so on, and 7 guesses always suffice. Six guesses can tell apart at most 63 numbers, which is not enough for 100. Even for a million numbers, 20 guesses always suffice. Making the range 10,000 times bigger only raises the count from 7 to 20. This is binary search, a basic way computers find things in big data (the data must be in order). The numbers on this page were checked by this site's tests for every number from 1 to 100 and from 1 to 1,000,000. A simplified teaching model.