As the title suggests, I'm playing a game where I have 5 attempts to guess the number between 1 and 100. Each time I guess, the game tells me whether the number is higher, lower, or if I guessed it correctly.
I've been playing it by always making my first attempt as 50. If it says it's lower than 50, I divide 50 by 2 and make my second attempt as 25. If it says number is higher than 25, I then add 50+25 and divide the answer by 2 and round up. Making my third attempt 38. If it says lower than 38, than I know the number is between 25 and 38. So, again I add 25 and 38 and divide the number by 2 and round up. Making my fourth attempt 32. The game then says it's lower than 32. So the correct number is between 25 and 32. I have 1 final attempt left. So I repeat the procedure above again (add, divide, round up) and come up with my final 5th attempt as 29. And I happen to guess it correctly.
However, in the example above, I could have got it wrong and the number could've been anything between 25 and 32. The game is reset each time, can be same answer as previous game as it's always a new random number between 1 and 100.
My question: Is there a better method than the one I described above to guess the number correctly more often?
Assume n numbers. If n = 1 then you know the number.
Assume one guess. You can get 2 or 3 numbers if n = 2 or n = 3, and 2 numbers if n >= 4.
Assume two guesses. Up to n = 7 you can get all numbers: Guess the one in the middle and you have two groups with n <= 3. With n >= 8 you can get the number you guessed, three of a group of 3, and two of a group of 4 or more, total six numbers.
And so on. With three guesses you find all of fifteen, or fourteen out of more than fifteen. With four guesses you find all of 31, or 30 out of 32 or more numbers. With five guesses you find all of 63, or 62 out of 64 or more numbers. Given 100 numbers, you can find 2/6/14/30/62 with 1-5 guesses.
Six guesses guarantees you find the number: Guess 64; worst case 63 numbers left. Guess 32, worst case 31 numbers left. Guess 16, worst case 15 numbers left. Guess 8, worst case 7 numbers left. Guess 4, worst case 1-3 left. Guess 2, and you know the result.