0% found this document useful (0 votes)
126 views3 pages

Best Card Trick

The document describes a famous card trick called 'The Best Card Trick' where a magician is able to correctly name a hidden card after being shown four other cards from a hand of five that were chosen by the audience member. It provides the method and history behind how the trick works using concepts from information theory and combinatorics.

Uploaded by

Anonymous t5TDwd
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
126 views3 pages

Best Card Trick

The document describes a famous card trick called 'The Best Card Trick' where a magician is able to correctly name a hidden card after being shown four other cards from a hand of five that were chosen by the audience member. It provides the method and history behind how the trick works using concepts from information theory and combinatorics.

Uploaded by

Anonymous t5TDwd
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

i~L',l~-T;I.i:-l|,l~-t,l[,..l.-:ii::f';'i(:-]-,,e-:li,a,~[:-],|,l~.li.

" -

This column is a place for those bits of


contagions mathematics that travel
from person to person in the
community, because they are so
elegant, suprising, or appealing that
one has an urge to pass them on.
Contributions are most welcome.

Michael

Kleber

and

Ravi Vakil,

The Best Card


Trick
Michael Kleber
ou, m y friend, are about to witess the best card trick there is.
Here, take this ordinary deck of cards,
and draw a hand of f i v e cards f r o m
it. Choose them deliberately or randomly, whichever you prefer--but do
not show them to me! Show them instead to m y lovely assistant, who will
now give me f o u r of them: the 7 ~ ,
then the Q ~P, the 8,$,, the 3 0 . There
is one card left in your hand, known
only to you and m y assistant. And the
hidden card, m y friend, is the K&.
Surely this is impossible. My lovely
assistant p a s s e d m e four cards, which
m e a n s there are 48 c a r d s left that could
be the h i d d e n one. I received the four
cards in s o m e specific order, and b y
varying that o r d e r m y assistant could
p a s s m e s o m e information: one o f 4! =
24 messages. It s e e m s the b a n d w i d t h is
off b y a factor of two. Maybe w e are
passing one e x t r a bit o f information illicitly? No, I a s s u r e you: the only information I have is a sequence of four
of the c a r d s you chose, and I can n a m e
the fifth one.

The Story

Please send all submissions to


Mathematical Entertainments Editor,
Ravi Vakil, Stanford University,
Department of Mathematics, Bldg. 380,
Stanford, CA 94305-2125, USA
e-mail: [email protected]

f f y o u h a v e n ' t s e e n this t r i c k before, the


effect really is r e m a r k a b l e ; reading it in
print d o e s n o t do it justice. (I a m forever i n d e b t e d to a g r a d u a t e student in
one a u d i e n c e w h o b l u r t e d out "No
way!" j u s t before I n a m e d the hidden
card.) Please t a k e a m o m e n t to p o n d e r
h o w the trick could work, while I relate s o m e history a n d delay giving
a w a y the a n s w e r for a page o r two.
Fkilly appreciating the trick will involve

Editors

a little information t h e o r y a n d applications of the B i r k h o f f - v o n N e u m a n n


t h e o r e m as well as Hall's Marriage
t h e o r e m . One caveat, though: hilly app r e c i a t i n g this article involves taking
its title as a bit of s h o w m a n s h i p , perh a p s a p e r s o n a l opinion, b u t certainly
not a p r o n o u n c e m e n t of fact!
The trick a p p e a r e d in print in Wallace Lee's b o o k Math Miracles, ] in
which he credits its invention to William
Fitch Cheney, Jr., a.k.a. "Fitch." Fitch
was born in San Francisco in 1894, son
of a p r o f e s s o r of medicine at Cooper
Medical College, which later b e c a m e
the Stanford Medical School. After receiving his B.A. and M.A. from the University of California in 1916 and 1917,
Fitch spent eight years working for the
First National Bank of San Francisco
and then as statistician for the Bank of
Italy. In 1927 he earned the first math
Ph.D. ever a w a r d e d b y MIT; it was supervised by C.L.E. Moore and titled "Infinitesimal deformation o f surfaces in
Riemannian space." Fitch w a s an instructor and assistant p r o f e s s o r then at
the University of Hartford (Hillyer College before 1957) until his retirement in
1971; he remained an adjunct until his
death in 1974.
F o r a l o o k at his e x t r a - m a t h e m a t i cal activities, I a m i n d e b t e d to his son
Bill Cheney, w h o writes:
My father, William F i t c h Cheney, Jr.,
stage-name "Fitch the Magician,"
first b e c a m e i n t e r e s t e d in the art of
magic w h e n attending vaudeville
s h o w s with his p a r e n t s in San Francisco in the early 1900s. He d e v o t e d
c o u n t l e s s hours to learning sleightof-hand skills and o t h e r "pocket
magic" effects with w h i c h to entertain friends a n d family. F r o m the
time of his initial t e a c h i n g assignm e n t s at Tufts College in the 1920s,
he enjoyed introducing magic effects into the classroom, b o t h to il-

1Published by Seeman Printery, Durham, N.C., 1950; Wallace Lee's Magic Studio, Durham, N.C., 1960; Mickey
Hades International, Calgary, 1976.

9 2002 SPRINGER-VERLAGNEWYORK,VOLUME24, NUMBER1, 2002

lustrate points and to a s s u r e his


s t u d e n t s ' attentiveness. He also
t r a i n e d himself to be a m b i d e x t r o u s
(although naturally left-handed),
a n d a m a z e d his classes with his ability to write equations simultaneously with b o t h hands, m e e t i n g in
the c e n t e r at the "equals" sign.
E a c h m o n t h the magazine M-U-M,
official publication o f the Society o f
A m e r i c a n Magicians, i n c l u d e s a section of n e w effects c r e a t e d b y society
m e m b e r s , and "Fitch Cheney" w a s a
r e g u l a r by-line. A n u m b e r o f his contributions have a m a t h e m a t i c a l feel.
His series of seven "Mental Dice Effects" (beginning Dec. 1963) will app e a l to a n y o n e w h o thinks it i m p o r t a n t
to r e m e m b e r w h e t h e r the n u m b e r s 1,
2, 3 a r e oriented c l o c k w i s e o r counterc l o c k w i s e a b o u t their c o m m o n v e r t e x
on a s t a n d a r d die. "Card Sense" (Oct.
1961) e n c o d e s the r a n k o f a c a r d (possibly a j o k e r ) using the f o u r t e e n equiva l e n c e classes of p e r m u t a t i o n s of a b c d
w h i c h r e m a i n distinct if y o u d e c l a r e
a c = c a a n d bd = d b as substrings: the
c a r d is p l a c e d on a p i e c e o f p a p e r
w h o s e four edges are f o l d e d o v e r (by
the magician) to c o v e r it, a n d examining the c r e a s e s gives p r e c i s e l y that
m u c h information a b o u t the o r d e r in
w h i c h t h e y w e r e folded. 2
While Fitch was a mathematician, the
five-card trick was p a s s e d d o w n via Wallace Lee's b o o k and the magic community (I don't know whether it a p p e a r e d
earlier in M-U-M or not.) The trick s e e m s
to be making the rounds of the current
m a t h community and beyond, thanks to
mathematician and magician Art Benjamm, who ran across a copy of Lee's
b o o k at a magic show, then taught the
trick at the Hampshire College Summer
Studies in Mathematics p r o g r a m s in
1986. Since then it has turned up regularly in "brain teaser" puzzle-friendly fo-

rums; on the r e c . p u z z l e s newsgroup, I


once heard that it was p o s e d to a candidate at a j o b interview. It m a d e a recent a p p e a r a n c e in print in the "Problem
Comer" section of the January 2001
E m i s s a r y , t h e newsletter of the Mathematical Sciences Research Institute. As
a result of writing this column, I a m
learning about a slew of papers in preparation that discuss it as well. It is a card
trick whose time has come.

The Workings
N o w to business. Our " p r o o f ' of impossibility ignored the other c h o i c e m y
lovely a s s i s t a n t gets to make: w h i c h o f
the five c a r d s r e m a i n s hidden. We c a n
p u t that choice to g o o d use. With five
cards in y o u r hand, there are certainly
two of the s a m e suit; we a d o p t the
strategy that the fLrst card m y a s s i s t a n t
s h o w s m e is of the s a m e suit as the
c a r d t h a t stays hidden. Once I s e e the
first card, t h e r e are only twelve c h o i c e s
for the h i d d e n card. But a bit m o r e
cleverness is required: by p e r m u t i n g
the t h r e e r e m a i n i n g c a r d s m y a s s i s t a n t
can s e n d m e one of only 3! -- 6 messages, a n d again w e are one bit short.
The r e m a i n i n g choice m y a s s i s t a n t
m a k e s is w h i c h card from the s a m e suit p a i r is d i s p l a y e d and w h i c h is hidden. C o n s i d e r the ranks of t h e s e c a r d s
to be t w o o f the n u m b e r s from 1 to 13,
a r r a n g e d in a circle. It is always possible to a d d a n u m b e r b e t w e e n 1 a n d 6
to one c a r d ( m o d u l o 13) and o b t a i n the
other; this a m o u n t s to going a r o u n d t h e
circle "the s h o r t way." In summary, m y
a s s i s t a n t c a n s h o w m e one c a r d a n d
t r a n s m i t a n u m b e r from 1 to 6; I increm e n t the r a n k o f the card by the number, a n d leave the suit unchanged, to
identify the h i d d e n card.
It r e m a i n s only for me a n d m y assistant to p i c k a convention for representing the n u m b e r s from 1 to 6. First,
totally o r d e r a d e c k of cards: s a y ini-

tially by rank, A 2 3 . . . J Q K , and b r e a k


ties by ordering the suits as in bridge
(i.e., alphabetical) order, & 0 s &.
Then the three c a r d s can be thought o f
as smallest, middle, a n d largest, and
the six p e r m u t a t i o n s can be ordered,
e.g., lexicographically. 4
N o w go out a n d a m a z e (and illuminate 5) y o u r friends. But, please: j u s t
m a k e sure that you a n d y o u r assistant
agree on c o n v e n t i o n s a n d can name the
hidden card flawlessly, s a y 20 times in
a row, before you try this in public. As
w e saw above, it's n o t h a r d to n a m e the
hidden c a r d half the t i m e - - a n d it's
tough to win b a c k y o u r a u d i e n c e if you
h a p p e n to get the first one wrong. (I
speak, sadly, from experience.)

The Big Time


Our s c h e m e w o r k s beautifully with a
s t a n d a r d deck, a l m o s t as if four suits
o f thirteen c a r d s e a c h w e r e c h o s e n j u s t
for this reason. Wh~le this satisfied
Wallace Lee, w e w o u l d like to k n o w
more. Can w e do this with a l a r g e r d e c k
of cards? And if w e r e p l a c e the h a n d
size of five with n, w h a t h a p p e n s ?
First w e n e e d a b e t t e r analysis o f t h e
information-passing. My assistant is
sending me a m e s s a g e consisting of an
o r d e r e d set of four cards; there are
52 x 5 1 x 50 x 49 such messages.
Since I see four o f y o u r c a r d s and n a m e
the fifth, the information I ultimately
e x t r a c t is an u n o r d e r e d set of five
cards, o f which t h e r e are (552), which
for c o m p a r i s o n w e should write as
52 x 51 x 50 x 49 x 48/5!. So there is
plenty of e x t r a space: the set of messages is ~ s~ = 2.5 t i m e s as large as the
set of situations. Indeed, we can see
some of that slop space in our algorithm:
some hands are e n c o d e d by more than
one message (any h a n d with more than
two cards of the s a m e suit), and s o m e
messages never get used (any message
which contains the c a r d it encodes).

2This sort of "Purloined Letter" style hiding of information in plain sight is a cornerstone of magic. From that point of view, the "real" version of the five-card trick secretly communicates the missing bit of information; Persi Diaconis tells me there was a discussion of ways to do this in the late 1950s. For our purposes we'll ignore
these clever but non-mathematical ruses.
3Unpaid advertisement: for more information on this outstanding, intense, and enlightening introduction to mathematical thinking for talented high-school students, contact David Kelly, Natural Science Department, Hampshire College, Amherst, MA 01002, or [email protected].
4For some reason t personally find it easier to encode and decode by scanning for the position of a given card: place the smallest card in the left/middle/right position
to encode 12/34/56, respectively, placing medium before or after large to indicate the first or second number in each pair. The resulting order sml, slm, msl, Ism, mls,
Ims is just the lex order on the inverse of the permutation.
5If your goal is to confound instead, it is too transparent always to put the suit-indicating card first. Fitch recommended placing it (i mod 4)th for the ith performance
to the same audience.

10

THE MATHEMATICALINTELLIGENCER

Generalize n o w to a deck with d


cards, from which you draw a hand of
n. Calculating as above, there are
d(d - 1) 9 9 9 (d - n + 2 ) p o s s i b l e messages, and (gn) possible hands. The
trick really is impossible (without subterfuge) if there are more hands t h a n
messages, i.e., unless d -< n! + n - 1.
The r e m a r k a b l e t h e o r e m is that this
u p p e r b o u n d o n d is always attainable.
While we calculated that there are
enough messages to encode all the
hands, it is far from obvious that we
can match t h e m up so each hand is encoded by a message using only the n
cards available! But we can; the n = 5
trick, which we can do with 52 cards,
can be done with a deck of 124. I will
give a n algorithm in a moment, b u t first
an interesting n o n c o n s t r u c t i v e proof.
The Birkhoff-von N e u m a n n theorem
states that the convex hull of the permutation matrices is precisely the set of
doubly stochastic matrices: matrices
with entries in [0,1] with each row and
column s u m m i n g to 1. We will use the
equivalent discrete statement that any
matrix of nonnegative integers with
constant row and column sums can be
written as a s u m of permutation matrices. 6 To prove this by induction (on the
constant sum) one need only show that
any such matrix is entrywise greater
than some permutation matrix. This is
an application of Hall's Marriage theorem, which states that it is possible to
arrange suitable marriages b e t w e e n n
m e n and n w o m e n as long as any collection of k w o m e n can concoct a list of
at least k m e n that s o m e o n e among
them considers an eligible bachelor. Applying this to our nonnegative integer
matrix, we can marry a row to a c o l u m n
only if their c o m m o n entry is nonzero.
The constant row and column sums ensure that any k rows have at least k
colunms they consider eligible.
Now c o n s i d e r the (very large) 0 - 1
matrix with rows indexed by the
( d ) hands, c o l u m n s indexed by the
d ! / ( d - n + 1)! messages, and entries
equal to 1 indicating that the cards
used in the message all appear in the
hand. When we take d to be our u p p e r

b o u n d of n! + n - 1, this is a square
matrix, and has exactly n! l ' s in each
row and column. We conclude that
some subset of these l ' s forms a permutation matrix. But this is precisely a
strategy for me a n d m y lovely assist a n t - - a bijection b e t w e e n hands and
messages which can be used to represent them. Indeed, by the above paragraph, there is n o t j u s t one strategy,
but at least n!.

Perfection
Technically the above proof is constructive, in that the proof of Hall's
Marriage theorem is itself a construction. But with n = 5 the above matrix
has 225,150,024 rows a n d columns, so
there is room for improvement. Moreover, we would like a workable strategy, one that we have a chance at performing without consulting a cheat
sheet or scribbling o n scrap paper. The
perfect strategy b e l o w I learned from
Elwyn Berlekamp, a n d I've b e e n told
that Stein Kulseth and Gadiel Seroussi
came up with essentially the same one
independently; likely others have done
so too. Sadly, I have n o information o n
whether Fitch Cheney thought about
this generalization at all.
Suppose for simplicity of exposition
that n = 5. Number the cards in the deck
0 through 123. Given a hand of five cards
CO < el < C2 < C3 < C4, my assistant will
choose ci to remain hidden, where i =
Co + cl + c2 + c3 + c4 mod 5.
To see how this works, suppose the
message consists of four cards which
sum to s m o d 5. T h e n the hidden card
is congruent to - s + i m o d 5 if it is ci.
This is precisely the same as saying
that if we r e n u m b e r the cards from 0
to 119 by deleting the four cards used
in the message, the hidden card's n e w
n u m b e r is c o n g r u e n t to - s mod 5. Now
it is clear that there are exactly 24 possibilities, and the p e r m u t a t i o n of the
four displayed cards c o m m u n i c a t e s a
n u m b e r p from 0 to 23, in "base factorial:" p = d l l ! + d22! + d33!, where for
lex order, di-< i counts how m a n y
cards to the right of the ( n - ith) are
smaller t h a n it. 7 Decoding the hidden

card is straightforward: take 5p + ( - s


m o d 5) and add 0, 1, 2, 3, or 4 to acc o u n t for skipping the cards that appear in the message, s
Having performed the 124-card version, I can report that with only a little
practice it flows quite nicely. Berlekamp
mentions that he has also performed the
trick with a deck of only 64 cards, where
the audience also flips a coin: after seeing four cards the performer both names
the fifth and states whether the coin
came up heads or tails. Encoding and decoding work just as before, only now
w h e n we delete the four cards used to
transmit the message, the deck has 60
cards left, not 120, and the extra bit encodes the flip of the coin. If the 52-card
version becomes too well known, I may
need to resort to this variant to stay
ahead of the crowd.
And finally a combinatorial question
to which I have no answer: h o w many
strategies exist? We p r o b a b l y ought to
c o u n t equivalence classes modulo
r e n u m b e r i n g the underlying deck of
cards. Perhaps we should also ignore
composing a strategy with arbitrary
p e r m u t a t i o n s of the m e s s a g e - - s o two
strategies are equivalent if, o n every
hand, they always choose the same
card to r e m a i n hidden. Calculating the
p e r m a n e n t of the a f o r e m e n t i o n e d
225,150,024-row matrix seems like a
bad way to begin. Is there a good one?

Acknowledgments
Much credit goes to Art B e n j a m i n for
popularizing the trick; I t h a n k him,
Persi Diaconis, and Bill Cheney for
sharing what they k n e w of its history.
In helping track Fitch Cheney from his
Ph.D. through his m a t h e m a t i c a l career,
I owe thanks to Marlene Manoff, Nora
Murphy, Geogory Colati, Betsy Pittman,
a n d Ethel Bacon, collection managers
and archivists at MIT, MIT again, Tufts,
Connecticut, and Hartford, respectively. Thanks also to my lovely assistants: Jessica Polito (my wife, who
w o r k e d out the solution to the original
trick with me on a long winter's walk),
Benjamin Kleber, Tara Holm, Daniel
Biss, and Sara Billey.

6Exercise: Do so for your favorite magic square.


7Or, my preference, d, counts how many cards larger than the/th smallest appear to the left of it. Either way, the conversion feels perfectly natural after practicing a few times.
8Exercise: Verify that if your lovely assistant shows you the sequence of cards 37, 7, 94, 61, then the hidden card is the page number in this issue where the first six
colorful algorithms converge:)

VOLUME24, NUMBER 1, 2002

11

You might also like