View Full Version : strategy to guessing a random number


doobster
12-07-05, 06:15 PM
I'm trying to play a game in which you need to guess a random number between 1 and 10 million!

These are the messages you receive after guessing:

higher and lower by 100,002 - freezing

You are between 30,002 and 300,000 points, higher or lower - cold

You are between 10,002 and 100,000 points, higher or lower - warm

when you get within 10,000 you only get a note saying you are red hot - hot

I was hoping someone could help me develop a process to guess the number in the least amount of guesses.

Thanks.

James R
12-07-05, 08:33 PM
Start at 5 million, then successively halve the range at each guess until you are red hot. Then, take the 10000 range and work through it 1 number at a time.

Pete
12-07-05, 11:50 PM
I don't follow the rules... if you guess 200,000 more than the number, do you get "freezing" or "cold"? Or could it be either?

Is "red hot - hot" a single message, or are "red hot" and "hot" separate messages?

Aer
12-08-05, 03:14 AM
I don't follow the rules... if you guess 200,000 more than the number, do you get "freezing" or "cold"? Or could it be either?


I took it to mean:

error > 300,000 - freezing message
100,002 <= error <= 300,000 - freezing and cold message
error = 100,001 - cold message
30,002 <= error <= 100,000 - cold and warm message
10,002 <= error <= 30,000 - warm message
error = 10,001 - no message??
error <= 10,000 - hot message

As a first cut analysis of the situation, I'd try:

(1) I'd try my luck at 300,000 - if I get just freezing, then I know the number is greater than my guess

(2) I'd proceed to add 600,000 until I get freezing and cold, then I know the range must be over these two intervals error-300,000:error-100,002 and error+100,002:error+300,000

(3) I'd eliminate one of the ranges by guessing error-200,000, if I am freezing, then I know it is in the other range.

(4) At this point I'd try to hit exactly cold or no message since you know exactly what your error must be and thus you only have 2 possible choices as to what the number is.

doobster
12-08-05, 04:46 PM
the messages didn't seem to make logical sense, but what i understand is:

100,001 is the furthest message.

so if you are inside 100,001 you will receive the message between 30,000 and 300,001.

if you are inside 30,000 you will receive the 10,001 to 100,001

when you are inside 10,000 you only get the red hot message.

leopold99
12-11-05, 03:03 AM
the method you are searching for is called a binary search
you take 2 numbers a,b (1 and 10 million in your example)
you subtract a from b and divide by 2 (round up), call it g for guess
if g=r (the random number sought) then you win
if g is less than r then assign g to b and stert again
if g>r then you assign g to a and start again
this method will allow you to guess a random number as specifide with 24 or less guesses.


as for the op it makes absolutly no sense.