Hello,
I was presented a problem and I am sure it is possible. Sort of hard for me to explain but here goes:
I have a random number within a set of 256 numbers (i.e 0-255, 1-256, -1-254 etc...) I need to be able to figure out what the number is using 7 or less questions (for lack of a better term).
I started out by taking the mid points of the range but it did not work. For example (Using 0-255):
A - Is the number > 256/2? [i.e. 128]
-------If yes then
-------------(b)Is the number > (256 - (256/2)) + ((256/2)/2) [i.e 192]
------------------If yes then
-------------------------(c)Is the number > (256 - etc...) [i.e. 224]
------------------If no then etc...
--------------------------------If Yes Then etc..
--------------------------------If No Then etc...
It always takes me 8 questions to get the answer using mid points when I need 7. I've been trying for a while using other methods. Is this possible?
Thanks for helping me bring closure!![]()




Reply With Quote