You need to make a set of five rods for a magic trick, with numbers on them ranging from 1 to 31 inclusive. Then you ask people to pick a number and show you only the top number
of whatever rods it is on. From that you have to guess which number the person picked. This has to be done within a few seconds and isn't a matter of remembering what numbers are on them.
What numbers should be on each of the five rods?
What makes this problem easier is realizing that 2^5 is 32. Right away, this makes me think of binary and as SilverKnight has used in his solution.
Posted by S
on 2003-11-11 15:45:16