# Math Help - Solution behind a card trick?

1. ## Solution behind a card trick?

I just saw a new card trick tonight and I'm sure there's a mathematical solution to it....just wondering if anyone out there has seen it before. The trick goes like this:

1. Start with a 52-deck of cards

2. Flip the first card over; the number value of the card is the number that you "start counting with", and you count out the number of cards after that so that you end at 13. (For example, the first card you flip is a 9-card...you count out 4 more cards to "count" to 13...the proceeding 4 accounting for 10, 11, 12, and 13....and ultimately you have a little pile of 5 cards). When you are done counting that pile of cards, you put that pile - face down - aside.

3. Continue this process until the entire deck is in little piles of cards....however many it takes.

4. Pick up all but 3 piles of cards, so that all you have left are 3 face-down piles of cards. Flip the top card on any 2 of the piles.

5. Add the values of the 2 newly-flipped cards, and add 10.

6. In the remaining pile (the rest of the deck of cards that you picked up in step 4), count out the number of cards that you ended up with in step 5 - the sum of the values of the 2 cards that you flipped up plus 10.

7. The number of cards remaining in your hand are the same as the value of the "3rd" pile card that is still facing down. (So, for example, if in step 6 you have a 3 and a 5 facing up - you will have counted out 18 cards, and if you have 7 cards remaining in your hand, you can expect that last card to be a 7).

....VERY cool trick. Has anyone seen it and does anyone know why that works? I'm assuming that the magic number 13 relates somehow to the number of cards for a particular suit in the deck....or maybe, alternatively, it's based on the number 4 and 13 is the divisor that gets you there.

I'm sure this one will be swimming around in my head for awhile and I'm anxious to understand the answer...just pretty rusty in actually applying math, and off the bat if this has anything to do with linear algebra (which I know a lot of game theory is based on), I've never been overly strong in that area.

Any thoughts?

2. Say you construct $n$ piles and the value of the top card used to generate pile $i$ has a value $x_i$. Then pile $i$ has $13-x_i+1 = 14-x_i$ cards. The last pile as at most $14-x_n$ cards, but maybe less.

Choose 3 piles (not the last one), say their top card values are $x_i, x_j, x_k$ and so there coresponding stacks contain $14-x_i, 14-x_j, 14-x_k$ cards respectively. Choose any two top cards and add the values plus 10:

$x_i + x_j + 10$, (leaving the 3rd stack which has $14-x_k$).

Obviously you have $52-(14-x_i)-(14-x_j)-(14-x_k) = 52 - 42 + x_i + x_j + x_k = 10 +x_i + x_j + x_k$ cards in your hand (see whats happening?) So if you discard $x_i + x_j + 10$ cards from your hand you are left with $x_k$ cards. Which is the face value of the top card of the third deck.

If you pick the lsat deck and it contains fewer cards than $14-x_n$ then obviously you have more than the correct number of cards in your hand and I don't think it works (did I miss something).

3. Hello, jacquir!

The trick goes like this:

2. Flip the first card over.
The number value of the card is the number that you "start counting with",
and you count out the number of cards after that so that you end at 13.
(For example, the first card you flip is a 9.
You count out "Ten, eleven, twelve, thirteen" and deal 4 cards on top of the 9.
When you are done with that pile of cards, you place it aside, face down.

3. Continue this process until the entire deck is in small piles of cards.
Place the leftover cards ("discards") to the side.

4. Pick up all but 3 piles of cards and add them to the discards.
You have 3 face-down piles of cards lfet.
Flip the top card on any 2 of the piles.

5. Add the values of the 2 newly-flipped cards, and add 10.

6. From the discards, count out the number of cards that you ended up with in step 5
(the sum of the values of the 2 cards that you flipped up plus 10.)

7. The number of cards remaining in your hand is equal to
the value of the top card of the last pile.

VERY cool trick. Has anyone seen it and does anyone know why that works?
I assume that the magic number 13 relates somehow to the number of cards in a suit.

Suppose we make five piles.
Suppose further that the five key cards have values: $a,b,c,d,e$

So the first card is $a$ and we deal $13-a$ cards on top of it.
. . The pile has $14-a$ cards.
The second card is $b$ and we deal $13-b$ cards on it.
. . The pile has $14-b$ cards.
The third card is $c$ and we deal $13-c$ cards on it.
. . The pile has $14-c$ cards.
The fourth card is $d$ and we deal $13-d$ cards on it.
. . The pile has $14-d$ cards.
The fifth card is $e$ and we deal $13-e$ cards on it.
. . The pile has $14-e$ cards.

We have used: $(14-a)+(14-b)+(14-c)+(14-d)+(14-e) \;=\;70 - (a+b+c+d+e)$ cards.

Hence, there are: . $52 - (70 - a - b - c - d - e) \;=\;(a+b+c+d+e)-18$ "discards".

Select any three piles . . . say, the last three.
We will add those cards to the discards.
The discards will have:
. . $(a+b+c+d+e-18) + (14-c) + (14-d) + (14-e) \;=\;a+b+c + 10$ cards.

Select any two of the remaining three piles . . . say, the last two.
We add their key cards, $b\text{ and }c$, and add ten: $b + c + 10$

We deal that many cards from the discards.
Then the discards will contain: . $(a + b + c + 10) - (b + c + 10) \;=\;a$

$\text{Therefore, we have }{\color{red}a}\text{ cards left . . . which is the value of the last key card.}$

4. ## Makes sense!

Thank you for your responses on this - they make sense when I see them all laid out.

For the first response, there was some concern about the "last pile" possibly not having 14-x_k cards in it, and therefore that last case would not work. I checked back with the person who showed me the trick, and he told me that in that case (if you can't count up to 14 with the remaining cards), then you don't put that pile down...you hold it in your hand. So, that takes the "last pile" case out of the equation.

Thanks for the replies!!

5. Nevermind!