Sunday, 7 December 2014

mathematics - 6 Attempts to Guess a Number Between 1-100 ~ Ranges


You get get 6 attempts to find the number between 1-100. Each "attempt" can either be a guess, or a range it could fall in, responses you could receive are "Correct!", "My number is lower.", "My number is higher", or "My number is within that range".



You have 6 tries to guess it, NOT to know it.


If you can do it in less than 6 please do post it.



Answer



Divide the current range by three and guess the middle range. It's either correct, higher, or lower, which reduces your search space by ⅔. You'll go from a search space of 100 to (worst case) 34, to 12, to 4, to 2, to 1 which you can state on your 6th guess.


No comments:

Post a Comment

Understanding Stagnation point in pitot fluid

What is stagnation point in fluid mechanics. At the open end of the pitot tube the velocity of the fluid becomes zero.But that should result...