You are trying to guess my favorite number. I tell you it is from 1-100 somewhere and is an interger. You can guess anything you like and I will tell you whether my number is higher or lower then your guess. What is the smallest number of guesses you can make to make sure you will get my number, no matter what it is?
Assume that I don't lie to you about the greater or less than value.
I still get 6 guesses and not 7. Using DJ's good method (at the top, guessing 1 number and not a range), you know the number after:
0 guesses if there is no more than 1 number
1 guess if there are no more than 3 numbers
2 guesses if there are no more than7 numbers
3 guesses if there are no more than 15 numbers
4 guesses if there are no more than 31 numbers
5 guesses if there are no more than 63 numbers
6 guesses if there are no more than 127 numbers
So, you can figure the number out using 6 guesses.
I think DJ's trick is a creative idea though, but may not have been what the author intended.
Posted by Gamer
on 2003-06-19 05:54:07