MATT: OK, so I’m going to
do a card trick based on the number 27. And this is my all-time favorite
maths card trick. And I’m going to show it for
you today, and I’m going to explain it. I found this trick in an old
1950’s math book written by Martin Gardner. And for me it is the maths
card trick with the most beautiful maths behind it
out of all of them. And because it is a math card
trick, it does involve a lot of long tedious counting. But bear with us here. So this involves 27 cards, so
I’m going to take 27 off. And this is a genuine count. One, two, three, four, five,
six, seven, eight, nine, 10. 27 is actually one of my
favorite numbers– One, two, three, four, five,
six, seven, eight, nine, 10– because it’s a cubed number. One, two, three, four,
five, six, seven. OK, that’s 27 cards. And this works with any 27
cards, and none of this trick is slight-of-hand. None of it is YouTube magic
where I’m using something sneaky, or a sneaky edit. And I’ll explain the trick
afterwards, so it’s OK. But this is how works– You get 27 cards, you
shuffle them up. I’m actually going to
get Brady to both film and be the volunteer. So I’ll flick through, do you
want to tap which one you want, which one of these? OK that one there. Do you want to show you
the camera that card? Don’t let me see
it, obviously. And do you want to put it back
in wherever you want? Thank you. Now all he needs to do is just
remember what that card was, and believe me, people in the
comments will mention afterwards if you don’t. Brady what’s your favorite
number from 1 to 27, if you had to pick a number? BRADY: 10. MATT: 10, any particular
reason why 10? BRADY: I just like
how it looks. MATT: You like it? OK. Are you looking for your
card by the way? What I want you to do is have
a look, and see if you can spot which pile your
card goes into. And people may have seen
this trick done before. It’s a variation, in fact, it’s
a generalization on a 21 card trick. Which pile is it in? BRADY: It’s in that pile. MATT: In the middle
pile there? OK, I’m going to pick
them up from the viewer’s right to left. And what people tend to do is
they do this tedious counting out each time. And what I’m actually
doing is last time I memorized all the cards. And so I when you told me which
pile, I had narrowed it down to nine possible
cards it could be. If I do it again, because of the
way I’m dealing it out, if you tell me which pile it’s in
this time, I will narrow it down to one of three
possible cards. Which pile is it in this time? BRADY: This time it is
in the middle pile. MATT: The middle one again,
there we are. OK purely coincidence, I’ll
pick them up again. And then we’ll do it one last
time again dividing by 3, and this is why 27 is 3 cubed. If you say which one it’s in I
will know, having memorized all the cards, exactly one in
one, or I will know precisely which card it is. And that’s just the pure
information of this trick. Which one’s it in? BRADY: That one. MATT: That one over there. Cool, OK. So now to be fair all
of that wasn’t true. Well the numbers were true,
and the number of cards it could’ve been going from 27 to
nine, to three, to one, that is completely accurate. I wasn’t bothering to memorize
them though, I was doing something else slightly
different. What was your card? You can tell me now. BRADY: It was the
king of hearts. MATT: King of hearts, and what
was your favorite number? BRADY: 10. MATT: OK. Watch this. Here we go. Ready? One, two, three, four, five,
six, seven, eight, nine, 10. King of hearts. So this trick, you can put the
card– even though you don’t know what it is– as long as
they tell you which pile it’s in, you can put it anywhere
in that deck. So if you say any number, after
three lots of dealing it out, I can put the card
into that position. And that is my all-time
favorite maths based card trick. Do you want to know
how it works? BRADY: Yes please. MATT: This is brilliant. OK, so can I have some of
your famous brown paper? OK, excellent. Now let’s look at why
this trick works. Now you’re going to have
to bear with me here. I’m going to set up a
slightly unusual way to look at the cards. Because when you get the 27
cards, the very last step– if we go from the end
of the trick– I pick them up into three
piles of nine cards. From now on I’m going to call
the top one the 0th pile, and then the first pile, and
the second pile. And there’s a reason for that
in a moment, but just bear with me while I set
up some notation. So when the cards go back
together there are nine cards in the top pile one, two, three,
four, five, six, seven, eight, nine. So that was why I called
the 0th pile on top. Then there was one, two, three,
four, five, six, seven, eight, nine in the first pile. And the bottom one– one, two,
three, four, five, six, seven, eight, nine, that was
the second pile. And as it turns out your one
was the king of hearts. That ended up being the
10th card down. Because you said at the very
beginning your favorite number is 10, and your king of
hearts ended up there. And so now when you think about
it these top three from the final pile– because this is
the very last top, middle, and bottom pile– that top one came from the
previous top pile. That was the previous 0th pile,
that was the previous middle pile, that was the
previous bottom pile. That was the previous
top, middle, bottom. Top, middle, bottom. And so actually if you
watch it you can see how that happens. Because I’ve picked them up
from the second time. I’ve got the top, the middle,
and the bottom packets. Each are nine cards, I’ve
put them together. I deal out the next three piles,
and the first three come from that top
pack of nine. And then the next three come
from that top pack of nine, and then the next three from
the same top pack of nine. So that’s why over here the
top three come from the previous top 0th pile. The next three of each one come
from the middle pile. So that’s the first three off
the middle, next three off the middle, next three
off the middle. And I’ve got nine left, that was
the previous bottom pile. That’s why now I get three from
the bottom, three from the bottom, three
from the bottom. So they end up going
down like that. And if you get some cards and
you start playing around with this, within the final ordering
it turns out from the very, very first time you put
them together this is the top, the middle, the bottom. The top, the middle,
the bottom. The top, the middle,
the bottom. And don’t lose too much sleep
over exactly why this happens. If you get a pack of cards
and deal it, you’ll start to see why. And what you end up here is this
is the ordering from the first time we dealt
the cards out. That’s the ordering from the
second time we dealt the cards out, and that’s the ordering
from the third time we dealt the cards out. And to get it here at 10th,
I can see that to get this position here it’s
the 0th 0 first. Or top, top, middle. And so each time Brady pointed
to where his card was the first time I put that pile back
on top, the second time I put that pile back on top, The
third time I put that pile in the middle. The first time I put that
pile back on top. The second time I put that
pile back on top. The third time I put that
pile in the middle. In fact, Brady, do you want to
pick a different number? BRADY: So say I told you my
favorite number was 13, what would you have done? MATT: OK so 13, I need to put
12 cards on top of that, and 12 is one 9, one 3,
and no units. So I’m going to put
that on the top, the middle, the middle. 13 is, nine, 10, 11, 12, 13. Yeah see? 0, top, middle, middle. But the way I work it
out is I’m actually working it out in base-3. Because this whole trick uses
base-3 ternary numbers, which I think are absolutely
amazing. And the first time you put the
piles back together you’re doing the units column of
your base-3 number. The next time you put them back
together you doing 3’s column, and then the last time
you’re doing the 9’s column. And so when you give me your
number I work out that number in base-3, and then that
tells me how to put the piles back together. OK so now we’re going to redo
the very first trick I did in almost slow motion, in annotated
mode if you will. And so you had a look at one
card, and then I started dealing these. And then I talked to you about
your favorite number, and you said 10. You’re looking for the king of
hearts, and I’m thinking how am I going to get that
king of hearts? Well I don’t know
what card it is. How’m I going to get
whatever the card is to the 10th position? And 10, nine goes
into that once. And so I want to get
nine cards on top. So I actually have to put it in
the top, the top, and then the middle. So has the king of
hearts gone past? Where was it? BRADY: It was there. MATT: OK so I now know it has
to go top, top, middle. So when I pick them up from left
to right– these two I don’t care about– that can be
bottom, that can be middle. The king of hearts is in this
one, so it has to go on top. Which means it’s going to
be one of the first nine to get dealt out. And so it’s going to be either
the top card of the next piles, or the second card of
the next piles, which it happens to be, or
the third card. And then the rest we actually
don’t care about. Because those other two piles
I know it wasn’t in those. These are just padding to get it
into the correct position. So now which one was it in? The middle one? OK so again it’s top,
top, middle. So it has to go top again. And if you watch, when I pick
them up I still pick them up in the same order. But I put them together
in a different order. So that goes on top, and then
I’ll get this last one, and I’ll just shove it underneath. So now I know it’s on top. In fact I know it’s in the top
three of the top pile. So when I go down this time
it has to be the top card, there it is. And then the rest go on top, and
then the last time it has to go in the middle. And so you can see what’s
going to happen now. Because if it goes in the middle
it’s going to get nine cards put on top of it. It’s going to be the top card in
the middle pile, it’s going to be the 10th card. So it was in this one? Well how about that? Pick that one up first, pick
that one up and put it underneath. So it was the middle one, put
that one underneath like that, and so now it has to
be the 10th card. One, two, three, four, five,
six, seven, eight, nine, boom. So in fact one way you can
think about it is I like drawing a time versus
card height diagram. So the first time you do
it– this is the first time you deal out– you’ve got the bottom pack,
you’ve got the middle pack, and you’ve got the
top pack when you put them back together. And the reason I use 0, one, and
two is actual units column in ternary. The second time you’ve got the
bottom pack, you’ve got the middle pack, you’ve got the top
pack, and again that’s 0, one, and two. And that’s the second
time you deal. And then the third time you
deal, again you’ve got the bottom, the middle pack,
and the top, and that’s 0, one, and two. So there are the three
packs when you put them back together. And in fact this is your
units column, or that your 1’s column. That there’s your 3’s
column, and that there’s your 9’s column. So if you want to put 15 on top,
to get 15 you’re going to need two 3’s, one
9, and no units. So it’s going to go top,
bottom, middle. To put 15 cards on top. And it’ll end up being
the 16th card. BRADY: If someone at home wants
to do this trick do they have to be pretty
good at maths? MATT: You have two options. You can either be pretty good
at maths, or you can spend a lot of your free time practicing
until your brain gets used to doing this. Which to be fair, are both
exactly the same thing. Maths is all about practicing
something, and developing a new way of thinking for your
brain to get used to it. So either option, learn maths,
of learn card tricks. You’re ending up with the same
skill set to be honest. BRADY: You said at the start
this was your favorite trick to some extent. MATT: It is. BRADY: There are
lots of tricks. What is it about that one
that resonates with you? MATT: People know the 21 card
trick, where you put it back in the middle each time, and
then it ends up being the middle card. And so people kind of
know that, but they don’t know why it works. Whereas this one you know why it
works, and then you can do so much more with it. And there’s a huge difference in
math– indeed in anything– between just memorizing the
steps so you know how to do it, versus knowing why
those steps get you where you want to be. And so this utilizes the
advantage of knowing why the steps are doing something,
and then you can tweak it as you go. So instead of always putting it
in the middle you can put it anywhere you want, because
you understand how it works. Because you’re putting three
piles back together three times there are 27 possible
arrangements of putting it back across the trick,
which correspond to all 27 possible positions. In fact you can do this trick
with a lot more cards if you really want to. It’s the number of piles to the
power of how many times you deal the cards out. If you get 10 billion cards,
which is a lot of cards, and you deal them out into 10 piles
10 times, you can put any of those 10 billion cards
into any position just through 10 deals. Although admittedly you are
dealing a million cards into each pile, so it does take
a very long time. In fact in Martin Gardner’s book
Magic, Maths, and Mystery he describes that if you want
to do the 10 billion card version his recommendation is
to be very, very careful as you’re doing the 10 piles
of 10 each time. Because if you make a mistake
very few audiences will sit through that trick for
a second time.