It’s Time to Play With Cards

Here’s a great little card trick a professor told me that you can do with the help of a little bit of simple mathematics. It consists of the following: any random person shuffles a deck of cards and gives me 5, and using that set of 5 cards I have to use 4 of those cards to tell another person (who knows the trick) the 5th card. So basically, given 5 cards, I can encode one of the cards using the other 4 (and remember that these are any 5 random cards). Sounds pretty darn impossible, huh? Stop reading if you want to try and figure it out, otherwise, here’s how it’s done.

The pigeonhole concept is a very simple concept with large implications that you would not expect, and most people consider it to be obvious. Given 16 pigeons, and 5 holes, this concept says that at least one hole will have 4 or more pigeons. In a more formal sense, given n objects and k holes, there will be at least [n/k] pigeons in at least one hole. The brackets around n/k indicate that this has to be rounded upwards. Well using this, we know that given 5 cards we will have at least 2 cards of 1 suit (there are 4 different suits).

Now how many increments in the number of one of the two cards of the same suit will be necessary to obtain the other? Given that we can increment a card over the ace and back to the 2, where it will continue, the minimum number of steps to get to any other number is 6: think about it: there are 13 different cards, so the maximum separation is 6 because if it is 7 or more, you would just take the other route (starting from the other card).

Now let’s put these two things together. We’ll take the card which we want to start from to increment to get the other card (these are both the same suit) as the first card in the set of cards, and now we have to use the other 3 cards to represent a number which you have to increment the card by. Well there are 6 different permutations of 3 different cards (3x2x1), so this can be done by simply different arrangements of the next 3 cards. So if we establish rules such as ascending order being 1, and descending order being 6, we can completely represent any possibility. Here is a good method to order the cards (let 1, 2, and 3 represent the 3 cards, with 3 as the highest):

1, 2, 3: 1

1, 3, 2: 2

2, 1, 3: 3

2, 3, 1: 4

3, 1, 2: 5

3, 2, 1: 6

There is also the case when there are 2 cards which both have the same number, but this tie can easily be sorted out with rankings within the suits, which generally go spades, heart, diamond, and then clover. Let me give you an example: You give me a 5 of spades, jack of hearts, king of spades, 2 of diamonds, and 8 of clover. So I simply place the king of spades first, indicating the suit and base card, and then arrange the next three cards in the order of highest, lowest, middle, indicating an increment of 5 to get 5 of spades, which is the other card.  So the order is:

Pretty cool, right?