Finding a Number between 0 and 1 millsion

mjtnas

New member
Joined
Feb 7, 2010
Messages
8
The question...Suppose we are playing the game Twenty Qeustions. But instead of something animal, vegetable, or mineral, I am thinking of a whole number between zero and a million. What questions would you ask (remember, only yes-or-no questions are allowed) in order to guess the number?

My first avenue would be to ask if the number is a perfect number. It narrows the pool significantly and its easy to find that answer.

However, where to go if it is not - what questions should be asked? Is there a formula to figure this out?
 
How about halving the interval, with each question.

"Is it greater than 500,000?"

If the answer is yes, then ask, "Is it greater than 750,000".

If the answer is no, then ask, "Is is greater than 250,000".

Each time you discover an interval that contains the number, cut that interval in two, and ask if the number is in the second half.

Each question and answer will narrow the interval.
 
2[sup:8rhrhe74]20[/sup:8rhrhe74] = 1,048,576

.
 
Re:

mmm4444bot said:
How about halving the interval, with each question.

"Is it greater than 500,000?"

If the answer is yes, then ask, "Is it greater than 750,000".

If the answer is no, then ask, "Is is greater than 250,000".

Each time you discover an interval that contains the number, cut that interval in two, and ask if the number is in the second half.

Each question and answer will narrow the interval.

If you already know that it is greater than 500,000, why would you ask if it was greater than 250,000? =P

I believe this is the best choice, because as Subhotosh Khan pointed out, with 20 questions this will bring you right to the right answer.
 
?

JuicyBurger said:
If you already know that it is greater than 500,000, why would you ask if it was greater than 250,000?

I'm thinking that you misread my post. I suggested asking whether the number is greater than 250,000, if the number is known to be LESS than 500,000.

?
 
So it seems I did, I was thinking that you were saying "if no to greater than 750,000" then ask if greater than 250,000.
 
Top