# Interesting math card trick, would like some insight on how it works

• elegysix
In summary, the card trick shown in a video involved no actual tricks but was based on math. The dealer uses modular arithmetic to make a prediction by counting the remaining cards in his hand and doing calculations to determine the card's value. The trick is based on the fact that adding up the digits of a number until a single-digit answer is reached will always produce the same remainder when divided by 9. This allows the dealer to make accurate predictions based on the number of cards taken by person A and B. The trick may seem complex, but it relies on the simple idea of looking at everything with respect to the remainder when divided by 9.
elegysix
I watched a video explaining a card trick today, there were no tricks, it was all based on math.
Here's the set up:

52 cards in the deck. person A takes some of them, then person B takes some as well.

The dealer counts the remaining cards in his hand, say he has 18.

Then he says he'll make a prediction. he does these calculations in his head: 1 + 8 = 9, and 16-9=7. So he looks through his cards and pulls out a seven, and sets it aside face down. (persons A and B are unaware of what the card is)

Then person A counts the cards in his hand, suppose he has taken 19. The dealer says 1+9=10 and 1+0=1, so person A has a 1.

Person B counts his cards, and he has 15. So he says then that 1 + 5 = 6, so person B has a 6.

Then he says that since person A has a 1, and person B has a 6, that his card is 1+6 = 7, and flips over his 7 to end the trick.

I find this trick to be truly fascinating. I have no idea how to begin answering why this trick works. Anyone care to try and offer an explanation?

elegysix said:
I watched a video explaining a card trick today, there were no tricks, it was all based on math.
Here's the set up:

52 cards in the deck. person A takes some of them, then person B takes some as well.

The dealer counts the remaining cards in his hand, say he has 18.

Then he says he'll make a prediction. he does these calculations in his head: 1 + 8 = 9, and 16-9=7. So he looks through his cards and pulls out a seven, and sets it aside face down. (persons A and B are unaware of what the card is)

Then person A counts the cards in his hand, suppose he has taken 19. The dealer says 1+9=10 and 1+0=1, so person A has a 1.

Person B counts his cards, and he has 15. So he says then that 1 + 5 = 6, so person B has a 6.

Then he says that since person A has a 1, and person B has a 6, that his card is 1+6 = 7, and flips over his 7 to end the trick.
I find this trick to be truly fascinating. I have no idea how to begin answering why this trick works. Anyone care to try and offer an explanation?

It's just the old trick of "casting out 9's," and it's easily understood using modular arithmetic.

First, what is the remainder when 52 is divided by 9? Well, 9*6 = 45, so the remainder is 7.

Now when you add up the digits of a number and then add its digits, etc., until you're left with a 1-digit answer, you always get the remainder when you divide the original number by 9. That's called "casting out 9's,", and it's an artifact of our base-10 numbering system. In base 8, you can "cast out 7's" for example.

Try it. For example try 12345. Well 1+2+3+4+5 = 15 = 9 + 6, so the remainder when 15's divided by 9 is 6. And if you type "12345 mod 9" into Google, it gives you 6. Isn't the Internet great? In the old days we had to figure that out with pencil and paper!

Ok so back to the card problem. If D is the number of cards the dealer has left after A and B are done, then A+B+D = 52, so A+B = 52-D.

Now the dealer replaces the 52 with the number 16 on the right side of the equation. Why can he do that? Because we only care about remainders, and 52 and 16 have the same remainder when divided by 9 (namely 7). So we have

$A+B \equiv 16-D$ (mod 9)

where the notation $x \equiv y$ (mod 9) means that the left and right side have the same remainder upon division by 9. We say that "x and y are equivalent mod 9" or "x and y are congruent mod 9." All it means is that they have the same remainder when you divide them by 9.

When we cast out 9's from both sides, equivalence (mod 9) is preserved. As I said earlier, if we add up the digits of a number, the result is equivalent (mod 9) to the original number.

So the sum of the number of A's and B's cards is equivalent, mod 9, to 16 minus the number of the dealer's cards. And when we cast out 9's (add the digits), the equivalence is preserved.

Here's another example. A takes 10, B takes 22. The dealer has 30. The dealer adds 3+0 = 3, then calculates 16 - 3 = 13; then adds 1+3 = 4. And how about that, that's what you get when you cast out 9's on the left: $10+12 = 22 \equiv 4$ (mod 9).

If I made this too complicated, it's because I was trying to make it simple by trying to explain modular arithmetic as I went along. Let me know if this made sense.

Last edited:
Yeah, I made some sense of it. I don't know much about modular arithmetic, but I'm going to start googling it! lol, thanks for the response!

Main idea is to look at everything mod 9. Meaning, look at everything with respect to the remainder when divided by 9.

52 has remainder 7. And that fact stays the same no matter how many piles you divide the 52 into. So there are 3 piles, A, B, and D. So A+B+D = 52 (mod 9) [here I'm using '=' instead of the three-bar symbol to avoid using markup.]

Therefore A+B = 52 - D (mod 9).

The right side does not change if you replace 52 with 16 since they have the same remainder. So

A + B = 16 - D (mod 9)

Now that's all well and good, but there is one more trick: If you add the digits of any number, you get the same result as if you took the remainder (mod 9) of the original number.

So we have the relationship A + B = 16 - D (mod 9), and then we just add the digits on each side. The dealer adds the digits of the number of his own cards; subtracts from 16; adds digits again if needed, and that's the same number you get when you add the digits of the number of cards of A and B.

That's the same thing I said before but it's shorter!

Blaise Pascal once sent someone a long letter, explaining, "The present letter is a very long one, simply because I had no leisure to make it shorter."

very interesting, thanks!

I've got another trick that I figured out a formula for, through trial and error. Interested?

Here's the set up, 52 cards.
I pick a random card, say its a 7, then i place cards under it, one for 8,9,10,11,12, and 13. that makes one pile.

then say the next card is a 10. I do the same for it, putting the 10 on top and counting one card for 11, one for 12 and one for 13. - it has 4 cards total in the pile.

and the next card i pull is a 4. so I put 9 cards under it - 10 total cards in the pile.

I do this until I run out of cards or don't have enough for a complete pile.

then I have someone choose 3 piles, and I pick up the rest.

Of the 3 piles, the top card on two of them is flipped over so it faces up. say these are a 4 and a 10.

I take 4+10 = 14, and 14+10 is 24. So I count 24 cards from my hand. The number of remaining cards in my hand is the value of the third card, which is 7.

Some guy at a bar taught me this trick, and I could do it over and over and never knew why it worked. I attempted to find an explanation, and I worked out a formula that sort of models it. This was done only with algebra and guesses lol

R is the number of cards in my hand, and $N_{x}$ is the number of cards in pile x

52= R + $N_{A} + N_{B} + N_{C}$

$N_{A}$ = 14-[A] where [A] is the value shown (ex 10 card, 14-[10]=4 cards in pile)

52 = R + 14-[A] + 14- + 14-[C]

52-3*14 = 10 = R-[A]--[C]

[C]=R - [A] - - 10

[C]=R-([A] + + 10)

which means [C] is the number of cards remaining in my hand after doing the subtraction.

Is there an explanation for this trick through set theory or modular arithmetic? My explanation of why it works is just that it's algebra. Lol.

## What are the steps to perform this math card trick?

The steps to perform this math card trick are as follows:1. Ask the participant to choose any 5 cards from a deck and arrange them in any order.2. Ask them to add up the numbers on the cards and remember the total.3. Have them shuffle the deck and add up the numbers on the top and bottom cards.4. Ask them to add the two totals together.5. Subtract the total from step 4 from the total in step 2.6. Count the cards in the deck to the number in step 5 and reveal the card at that position - it will be the 6th card.

## How does this math card trick work?

This math card trick works due to the principles of modular arithmetic. By adding up the numbers on the cards and performing the specified calculations, the final result will always be a multiple of 13. Since there are 52 cards in a deck, counting the number in the final result will always lead to the 6th card in the deck.

## Can this math card trick be performed with any number of cards?

No, this math card trick specifically works with 5 cards and a deck of 52 cards. If the number of cards or the size of the deck is changed, the trick will not work.

## Do I need any special skills or knowledge to perform this math card trick?

No, this math card trick only requires basic addition and subtraction skills. However, it may take some practice to perform it smoothly and confidently.

## Can this math card trick be performed multiple times with the same deck?

Yes, this math card trick can be performed multiple times with the same deck. However, the participant should choose different cards and perform the steps in a different order each time to prevent the trick from being easily figured out.

• General Math
Replies
9
Views
2K
• Calculus and Beyond Homework Help
Replies
31
Views
3K
• Precalculus Mathematics Homework Help
Replies
4
Views
837
• General Math
Replies
4
Views
452
• Precalculus Mathematics Homework Help
Replies
2
Views
901
• General Math
Replies
17
Views
2K
• General Math
Replies
30
Views
3K
• General Math
Replies
2
Views
946
• General Math
Replies
18
Views
1K
• General Math
Replies
55
Views
3K