# January 31, 2006

• We did a magic trick that involved shuffling cards. Take a new deck of 52 cards, ask a volunteer to shuffle the cards 3 times and then cut the deck 3 times, take the top card from the deck, look at it and put it somewhere in the middle. The trick is that it is possible to find the card without much difficulty.
• I played for you the radio program The Number 7 (http://www.bbc.co.uk/radio4/science/another5.shtml) which talked about why this magic trick worked. The main result talked about in the program is that it takes seven shuffles before a deck is really mixed.
• Another interesting question is how many PERFECT shuffles does it take before a deck returns to its orginal order. In the radio program it mentions that Percy Diaconis is able to shuffle a 52 card deck 8 times and it returns to the orginal order.
• I asked the puzzle question, given a deck with n cards (n even) how many shuffles does it take to return the deck to its original order. We computed the following table of values for the number of shuffles it takes before a deck of cards returns to its orginal order. What is the pattern?
A table of cards versus number of shuffles to return to the orginal order
no. of cards no. of shuffles
4 2
6 4
8 3
10 6
12 10
14 12
16 4
18 8
20 18
22 6
24 11

We found this data by shuffling decks of cards but our shuffles were a little strange. See below for the example of what happens with 4 cards which explains why it only took two shuffles to return it to its usual deck

 Before shuffling After shuffling card #0 ---> card #0 card #1 ---> card #2 card #2 ---> card #1 card #3 ---> card #3
• The pattern is definitely hard to spot. I described an equation with a larger example of 14 cards. I introduced the operation of "remainder when divided by n" or "(mod n)" So observe the example below:
 Before shuffling After shuffling card #0 ---> card #0 card #1 ---> card #7 card #2 ---> card #1 card #3 ---> card #8 card #4 ---> card #2 card #5 ---> card #9 card #6 ---> card #3 card #7 ---> card #10 card #8 ---> card #4 card #9 ---> card #11 card #10 ---> card #5 card #11 ---> card #12 card #12 ---> card #6 card #13 ---> card #13
• If you try to describe this in an equation if k is between 0 and 6 then card k goes to where the card 2k used to be and if k is between 7 and 13 then card k goes to position 2k-13. All this can be described by one equation card k -> the position of card 2k (mod 13). After several rounds k -> 2k -> 4k -> 8k -> 16k -> ... (mod 13). So when does this get back to the orginal? Strangely when 2^r has remainder of 1 when divided by 13. This happens after 12 rounds. That is 2^12 = 4096 = 1 (mod 13) and 12 is the first time that this happens.

Previous class : January 24, 2006

Next class : February 7, 2006

Main class page : Mathematics 1590 Nature of Mathematics II