All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Logic
Magic Rods (Posted on 2003-11-11) Difficulty: 4 of 5
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?

See The Solution Submitted by Lewis    
Rating: 4.0000 (7 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution Spare the rod, spoil the magician | Comment 8 of 13 |
Every number between 1 and 31 (inclusive) can be uniquely represented as a sum of one or more of the following powers of 2 (where the symbol ^ means "raised to the power of"):

2^0 = 1
2^1 = 2
2^2 = 4
2^3 = 8
2^4 = 16

For example, 7 = (2^2) + (2^1) + (2^0)
and 21 = (2^4) + (2^2) + (2^0)

So let's call the five rods A B C D E. Write each of the numbers 1-31 on them as follows:

Write the number on A if, when it is represented as a sum of those powers of 2, the sum does **NOT** include 2^0
Write it on B if the sum does **NOT** include 2^1
Write it on C if the sum does **NOT** include 2^2
Write it on D if the sum does **NOT** include 2^3
Write it on E if the sum does **NOT** include 2^4

(For example, 18 = 2^4 + 2^1, and since this sum does not contain 2^0, 2^2 or 2^3, we would write 18 on A, C and D)

Finally, write 31 on **ALL** the rods.

Write these numbers on these rods in this exact physical sequence from the tops of the rods:

A = {2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,31}
B = {1,4,5,8,9,12,13,16,17,20,21,24,25,28,29,31}
C = {3,2,1,5,8,9,10,11,16,18,19,24,25,26,27,31}
D = {4,2,3,1,5,6,7,16,17,18,19,20,21,22,23,31}
E = {5,2,3,4,1,6,7,8,9,10,11,12,13,14,15,31}

Then if the person shows the magician the numbers 2,1,3,4,5, the magician will instantly know that the person had picked 31, the only number on all the rods. If the person only shows him 3, he will know that the person has picked a number which is only on the rod that does not include numbers with representative sums that contain 2^2 -- so the number is (2^0) + (2^1) + (2^3) + (2^4) = 27. If he shows him 3 and 5, the magician will know that the picked number's representative sum does not contain 2^2 or 2^4 -- hence it must be (2^0) + (2^1) + (2^3) = 11.

etc.
Edited on November 12, 2003, 7:47 pm
  Posted by Dan on 2003-11-12 02:39:32
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (5)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (1)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2020 by Animus Pactum Consulting. All rights reserved. Privacy Information