Tuesday, June 7, 2011

Mind-reading card trick

Alice draws 5 cards from a deck, keeps one secret, and shows the other 4 to Bob in a particular order that allows him to guess the secret card. To anyone observing who doesn't know the trick, it looks like Bob is reading Alice's mind.

This trick works because of two facts:
  • When Alice draws a 5-card hand from a deck of cards, she must get at least two cards of the same suit.
  • Think of a deck of cards as going from 1 (ace) to 13 (king) and put these numbers around a clock. The farthest apart any two cards can be is 6 steps, so long as you start on the correct card (it takes 7 steps to get from 13 to 7 but only 6 steps to get from 7 to 13).
Alice draws her hand and chooses two cards in the same suit. One of these is the "base" card and the other is the secret card. It must be possible to get from the base card to the secret card in 6 or fewer steps.

Alice shows Bob the base card. Now Bob knows the suit of the secret card, and he knows he has to count upward some amount from the base card to find the number of the secret card.

To tell Bob how much to count, Alice hands Bob her three remaining cards in the appropriate order:
low medium high - count up 1 step
low high medium - count up 2
medium low high - count up 3
medium high low - count up 4
high low medium - count up 5
high medium low - count up 6

If Alice has multiple cards with the same number, she orders those cards by suit. From lowest to highest, the suits go Clubs, Diamonds, Hearts, Spades.

Here are a couple of examples.

Example 1

Alice draws: A clubs, 4 diamonds, 5 hearts, 6 spades, 7 spades.

Since spades is the only suit in which she has 2 cards, she has to use spades for the base card and the secret card. Since it takes only 1 step to go from 6 to 7, she shows Bob the 6 of spades as the base card.

Her remaining cards are A clubs (low), 4 diamonds (medium), 5 hearts (high). She shows Bob these cards in this order.

Bob knows he must step up 1 from the 6 of spades, so the secret card must be the 7 of spades.

Example 2

Alice draws: K hearts, 4 hearts, 2 clubs, 2 diamonds, J spades.

Since hearts is the only suit in which she has 2 cards, the secret card and the base card must be hearts. The base card has to be the king of hearts, since we can get from K to 4 in 5 steps but it takes 9 steps to get from 4 to K.

The remaining cards are 2 clubs (low), 2 diamonds (medium), J spades (high). She needs to tell Bob to step up 5, so she shows him the cards in the order
J spades (high), 2 clubs (low), 2 diamonds (medium)

Bob knows to step up 5 from the king of hearts, so the secret card must be the 4 of hearts.

Monday, June 6, 2011

Cryptology - the final foray

This was my favorite day. During the previous five weeks of the EB I felt that I was having trouble finding the optimal working arrangement for this group - they didn't want to work alone, or in pairs, or in small groups, or all together with me at the chalkboard. What to do?

On week six I handed them these rules:
  • If there are prizes, they must be divided evenly.
  • Cooperate! Help each other! Also, make sure everyone gets to help.
  • Leave the room as you found it.
Then I handed them a box labeled "Spy Tools" containing alphabet clocks, enigma machines, sheets with the alphabet for solving substitution ciphers, and some odd-looking index cards with weird holes cut out.


Then I handed them the first clue and stood back.

1. Easiest first! XQGHU WKH WUDVK FDQ


They correctly figured out that "easiest first" referred to the Caesar cipher, the easiest code we had learned. They found the next clue UNDER THE TRASH CAN:


2. The mystery starts with AAA. AIHFACJQMBJOLYW


"Starts with AAA" indicated that they needed to use an Enigma machine with all its rotors initially set to A.


The next clue was found on the BOTTOMBOOKSHELF.


3. VMVVPNPMFGQVGGQCETDI - Jesse

This one didn't even hint at which method was needed, but since they hadn't used the alphabet clock yet they decided to try that, with my name as the key. It worked.


The next clue was found under the MIDDLELUNCHROOMTABLE.

4. Congratulations! Sorry there aren't any prizes, but at least you're not getting painted red, boxed up, and given as an inter-office Christmas gift.

This is very unhelpful! However, when they held one of those funny-looking index cards over it, the cut-out spaces revealed this message:

4. Congratulations! Sorry there aren't any prizes, but at least you're not getting painted red, boxed up, and given as an inter-office Christmas gift.

They found the PRIZES IN RED BAG IN OFFICE as advertised. One bottle of bubbles, one grow-beast dinosaur, and two pencil erasers for everyone. Max took charge of the prize distribution in a very effective way, declaring that dinosaurs would be picked from youngest to oldest. It was subsequently decided that pencil erasers would be chosen first from youngest to oldest, then from oldest to youngest.

Catching up on the blog!

In which we build all the Platonic solids and do one real mathematical proof:

With the big group, we spent a lot of time playing with zome tools to build the Platonic solids. Platonic solids are convex regular polyhedra. Here's what that mouthful means:
  • A polyhedron is a 3-D object, as opposed to a polygon, which is a 2-D object.
  • Regular in this case means "all the same." A regular polygon is a polygon where all the sides and angles are the same length, such as an equilateral triangle or a square. A regular polyhedron is one for which all the sides are the same regular polygon.
  • A polygon or polyhedron is convex if, when we pick two points inside it and connect them by the shortest straight line, the line is entirely contained inside the polygon or polyhedron.
There are three different Platonic solids whose faces are triangles (tetrahedron, octahedron, and icosahedron), one whose faces are squares (cube), and one whose faces are pentagons (dodecahedron). We tried to build one whose faces were hexagons but we ended up with a soccer ball instead - some faces were hexagons, some faces were pentagons.

We talked about what a proof is. To a mathematician, a proof is an argument that convinces a reasonable listener of some claim. I made the claim that we had in fact built all the Platonic solids there were to be built, then went through the geometric proof of this claim. Most of the reasonable listeners were convinced.

In which we do calculus:

With the small group, I had gotten some requests to do calculus, so we did.

We talked a little about limits: the sequence 1, 1/2, 1/3, 1/4, ... has a limit of 0. The sequence 1, 1, 1,... has a limit of 1.

We found the area of a circle by filling the circle with concentric rings (using yarn or playdoh), then unrolling the rings into a triangle and finding the area of the triangle, which is the same as the area of the circle. This is explained beautifully at the website betterexplained.com.

We had a refresher of what "slope" means. I like the phrase
"slope equals rise over run"
since I think it's easier to remember "rise over run" than it is to remember whether x or y goes on top. Then we tried to figure out what "slope" should mean if the line isn't straight. We found the slope of the function y=x^2 pretty much as you would do it in a calculus class, by calculating the slope of the line between the points
(x,x^2) and (x+delta x, (x+delta x)^2)
and talking about what happens as delta x gets smaller and smaller.

In which we do origami:

When the schedules were crazy with field trips and such, I caved and let them do origami again. Rabbits and turtles and boxes, oh my. The small group did some modular origami and we talked about what "modular" means.