Guess the number from 1 to 100: why seven guesses is always enough
The halving method that finds any number from 1 to 100 in seven guesses or fewer, and why it works.
Always guess the middle
Start with 50. If the answer is higher, the secret is between 51 and 100, so guess the middle of that range, 75. If it is lower, guess 25. Keep choosing the middle of whatever range is left.
Each guess throws away half of the numbers that are still possible. From one hundred numbers you go to fifty, then twenty-five, then about twelve, six, three and one. That is why seven guesses is always enough.
Why halving is the best you can do
Every hint has only two answers, higher or lower, so a guess can at best split the possibilities into two equal parts. Two to the power of seven is 128, which is more than 100, so seven yes-or-no splits can single out any number. Six splits only cover 64 numbers, which is why no method can promise six.
This idea is called binary search, and it is the same trick computers use to find a name in a sorted list or a word in a dictionary.
Getting lucky without taking risks
The middle does not have to be exact. When a range has an even number of values, either of the two middle numbers works equally well. You can also guess a number you like, as long as it stays close to the centre.
Never guess outside the range. If the hints say higher than 62 and lower than 70, the only useful guesses are 63 to 69. Number Guess shows that range at the top, so you do not have to keep track yourself.