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: vakil@math.stanford.edu

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

9

2 While Fitch was a mathematician. So there is plenty of e x t r a space: the set of messages is ~ s~ = 2. before you try this in public. Then the three c a r d s can be thought o f as smallest. 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. Once I s e e the first card.) The trick s e e m s to be making the rounds of the current m a t h community and beyond.edu. t h e newsletter of the Mathematical Sciences Research Institute. 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. 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.e. lexicographically. 2. . 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 . The Workings N o w to business. J Q K . 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. 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. We c a n p u t that choice to g o o d use. 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. totally o r d e r a d e c k of cards: s a y ini- tially by rank. 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.) 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. msl.. mls. Wh~le this satisfied Wallace Lee. a n d a m a z e d his classes with his ability to write equations simultaneously with b o t h hands. a r r a n g e d in a circle. Fitch recommended placing it (i mod 4)th for the ith performance to the same audience. 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. a n d again w e are one bit short. there are 52 x 5 1 x 50 x 49 such messages. and enlightening introduction to mathematical thinking for talented high-school students. Since I see four o f y o u r c a r d s and n a m e the fifth. p u z z l e s newsgroup. on the r e c . Natural Science Department. the "real" version of the five-card trick secretly communicates the missing bit of information. 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).g. a n d largest. 2This sort of "Purloined Letter" style hiding of information in plain sight is a cornerstone of magic. respectively. 5If your goal is to confound instead. a n d leave the suit unchanged. 4 N o w go out a n d a m a z e (and illuminate 5) y o u r friends. 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!. Ims is just the lex order on the inverse of the permutation. slm. . 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. e. "Card Sense" (Oct. 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.. 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. 3Unpaid advertisement: for more information on this outstanding. MA 01002. intense. As a result of writing this column. I a m learning about a slew of papers in preparation that discuss it as well. 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. 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. and "Fitch Cheney" w a s a r e g u l a r by-line. (I speak. Amherst. 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. Since then it has turned up regularly in "brain teaser" puzzle-friendly fo- rums.lustrate points and to a s s u r e his s t u d e n t s ' attentiveness. m e e t i n g in the c e n t e r at the "equals" sign. 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. w e w o u l d like to k n o w more. middle. 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.5 t i m e s as large as the set of situations.. to identify the h i d d e n card. The resulting order sml. 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! -. E a c h m o n t h the magazine M-U-M. 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. t h e r e are only twelve c h o i c e s for the h i d d e n card. there are certainly two of the s a m e suit.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. and the six p e r m u t a t i o n s can be ordered.6 messages. s a y 20 times in a row. Ism." In summary. 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 . Persi Diaconis tells me there was a discussion of ways to do this in the late 1950s. 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. 10 THE MATHEMATICALINTELLIGENCER . alphabetical) order. who ran across a copy of Lee's b o o k at a magic show. 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). It is a card trick whose time has come. sadly. contact David Kelly. & 0 s &. Indeed. and s o m e messages never get used (any message which contains the c a r d it encodes). But. His series of seven "Mental Dice Effects" (beginning Dec. For our purposes we'll ignore these clever but non-mathematical ruses. A 2 3 . then taught the trick at the Hampshire College Summer Studies in Mathematics p r o g r a m s in 1986. it is too transparent always to put the suit-indicating card first. placing medium before or after large to indicate the first or second number in each pair. official publication o f the Society o f A m e r i c a n Magicians. 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. o f which t h e r e are (552). 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 . I increm e n t the r a n k o f the card by the number. As w e saw above. 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. and b r e a k ties by ordering the suits as in bridge (i. or dkelly@hampshire. from experience. From that point of view. thanks to mathematician and magician Art Benjamm. First. Hampshire College. I once heard that it was p o s e d to a candidate at a j o b interview. 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. With five cards in y o u r hand.

When we take d to be our u p p e r b o u n d of n! + n . I t h a n k him. Betsy Pittman. Sadly. 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.Generalize n o w to a deck with d cards. Given a hand of five cards CO < el < C2 < C3 < C4. in "base factorial:" p = d l l ! + d22! + d33!. d. Tufts. 1. Connecticut. Indeed. likely others have done so too. who w o r k e d out the solution to the original trick with me on a long winter's walk). we would like a workable strategy.. they always choose the same card to r e m a i n hidden. In helping track Fitch Cheney from his Ph. Moreover. unless d -< n! + n . Geogory Colati. I may need to resort to this variant to stay ahead of the crowd. 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. my preference. 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. 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 . 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. respectively. The constant row and column sums ensure that any k rows have at least k colunms they consider eligible. Benjamin Kleber.1) 9 9 9 (d . Applying this to our nonnegative integer matrix.. and the extra bit encodes the flip of the coin. 94. 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. But with n = 5 the above matrix has 225. Now it is clear that there are exactly 24 possibilities. i. I owe thanks to Marlene Manoff. and Sara Billey. 7 Decoding the hidden card is straightforward: take 5p + ( .024-row matrix seems like a bad way to begin. this is a square matrix. o n every hand.s mod 5. 7Or. or 4 to acc o u n t for skipping the cards that appear in the message. Thanks also to my lovely assistants: Jessica Polito (my wife. Now c o n s i d e r the (very large) 0 . I have n o information o n whether Fitch Cheney thought about this generalization at all. counts how many cards larger than the/th smallest appear to the left of it. This is an application of Hall's Marriage theorem. 2. The trick really is impossible (without subterfuge) if there are more hands t h a n messages.150. Nora Murphy. and Hartford. can be done with a deck of 124. 8Exercise: Verify that if your lovely assistant shows you the sequence of cards 37. 3. but at least n!. Persi Diaconis. 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. from which you draw a hand of n. Daniel Biss. the hidden card's n e w n u m b e r is c o n g r u e n t to . a n d I've b e e n told that Stein Kulseth and Gadiel Seroussi came up with essentially the same one independently. 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. T h e n the hidden card is congruent to . and has exactly n! l ' s in each row and column. where for lex order. suppose the message consists of four cards which sum to s m o d 5.150. Encoding and decoding work just as before. Either way. NUMBER 1. I will give a n algorithm in a moment.s m o d 5) and add 0. Perfection Technically the above proof is constructive. the n = 5 trick. 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. not 120.n + 1)! messages. 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. Tara Holm. 61. 2002 11 . c o l u m n s indexed by the d ! / ( d . the deck has 60 cards left. To see how this works.. 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.n + 2 ) p o s s i b l e messages. and Bill Cheney for sharing what they k n e w of its history. one that we have a chance at performing without consulting a cheat sheet or scribbling o n scrap paper.ith) are smaller t h a n it. there are d(d . Is there a good one? Acknowledgments Much credit goes to Art B e n j a m i n for popularizing the trick.1. The perfect strategy b e l o w I learned from Elwyn Berlekamp.D. 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. But this is precisely a strategy for me a n d m y lovely assist a n t .s o two strategies are equivalent if. in that the proof of Hall's Marriage theorem is itself a construction. s Having performed the 124-card version.1. so there is room for improvement. a n d Ethel Bacon. only now w h e n we delete the four cards used to transmit the message. the conversion feels perfectly natural after practicing a few times. there is n o t j u s t one strategy. then the hidden card is the page number in this issue where the first six colorful algorithms converge:) VOLUME24. While we calculated that there are enough messages to encode all the hands. Number the cards in the deck 0 through 123. which we can do with 52 cards. my assistant will choose ci to remain hidden. collection managers and archivists at MIT. Suppose for simplicity of exposition that n = 5. Berlekamp mentions that he has also performed the trick with a deck of only 64 cards.a bijection b e t w e e n hands and messages which can be used to represent them.1] with each row and column s u m m i n g to 1.e. We conclude that some subset of these l ' s forms a permutation matrix. and (gn) possible 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. where i = Co + cl + c2 + c3 + c4 mod 5.1 matrix with rows indexed by the ( d ) hands. 6Exercise: Do so for your favorite magic square.s + i m o d 5 if it is ci. If the 52-card version becomes too well known. di-< i counts how m a n y cards to the right of the ( n . MIT again.024 rows a n d columns. I can report that with only a little practice it flows quite nicely. by the above paragraph. Calculating as above. and entries equal to 1 indicating that the cards used in the message all appear in the hand. 7. b u t first an interesting n o n c o n s t r u c t i v e proof. through his m a t h e m a t i c a l career.