Thursday, February 18, 2010

How guessnumber works, overexplained

The mom I grew up next door to recently sent me this email:
Why does this work, it's not artificial intelligence, it's some probality. Thanks for your help.
http://www.quizyourprofile.com/guessyournumber.swf
The link takes you to a quiz that presumes to read your mind. I'm sure you're not unfamiliar with this puzzle. In fact, as a child my brother once taught me a card trick that works just like this puzzle, so my familiarity with that old magic trick made it dead simple to catch the trick in this one.  I document below how it works. (Side-note, I actually thought at one point it was more like a phone-book-based magic trick until the puzzle's conclusion. It turns out those old magic tricks were good for something.)

Before reading on, you should take the quiz. Do it now. It will only take a minute. I'll wait.

When you took the quiz you might have noticed most of it was misdirection. In fact, I'll ignore almost all the content, and focus solely on two pages, below.

Page 2: Pick your number.

This page shows you 25 numbers, and asks you to choose one, but keep it to yourself. It does, however, ask you to tell it the color of the number. See below:

See how the numbers are jumbled out of incremental order, or by color group? Misdirection! If the grid looked like this you might have been less confused:

Now we can see that, grouped by color, there are five groups of numbers. We also know the numbers increment from one to twenty-five. Finally by revealing the color, you turned a 1 in 25 guess to a 1 in 5 guess. So how then does it go from guess to certainty?

Page 4: Choose the house that has your number in it.


Now you're asked to tell it in which house you see the number. Let's look.

Hey now, I see five houses with six numbers apiece. So here, the numbers go to 30, meaning there are five numbers in the houses that you could never have guessed. Misdirection! Let's remove them:


Back to it. Let's look at those colors. Do you think those colors match the ones from page two? Nope. As a point of reference, look at the number 2. On top 2 is colored red, but down here it's colored blue. Go check. See? Misdirection! Here's an updated photo of the houses, with the numbers slightly rearranged for clarity, and also where the numbers are recolored with their colors from page two:


Notice something? All five numbers in each house have different colors. More important, all five numbers from each group of colors belong in separate houses. This means that the first question determines which color group the number belongs in, and the second question determines which your chosen number from that color group. Once you indicate the house in which your number appears, you've given the puzzle all the information it needs to answer your question.

The code, cracked.


Each off the possible twenty five numbers can be selected from a single pair of color and house. The grid below lists the translation from number to color-house tuple.
Number
Color
House
1
Magenta
A
2
Red
B
3
Blue
D
4
Blue
A
5
Red
D
6
Magenta
E
7
Black
E
8
Black
C
9
Green
B
10
Blue
B
11
Black
A
12
Green
A
13
Red
A
14
Magenta
C
15
Red
E
16
Green
E
17
Blue
C
18
Blue
E
19
Black
D
20
Red
C
21
Magenta
B
22
Magenta
D
23
Green
D
24
Black
B
25
Green
C
Or, listed as a two-dimensional table of color and house:
A
B
C
D
E
Magenta
1
21
14
22
6
Red
13
2
20
5
15
Blue
4
10
17
3
18
Green
12
9
25
23
16
Black
11
24
8
19
7
Helpful, Mrs. M?

3 comments:

Anonymous said...

No comments? You deserve at least one, this one, for your efforts to successfully explain this trick. I very vaguely remember the same trick, done with a pack of cards, when I was in high school some 35 years ago! Thanks, Robert, truly the king of the entire berg!

konberg said...

Thanks!

Um... who is this?

konberg said...

Thanks!

Um... who is this?