As some of the readers of this blog may know, in my professional life I'm a mathematician (working in probability theory). In my spare time I like, among other things, to read books (initially I wanted to write "good books", but then I recalled that a friend of mine once put on his webpage a rather redundant line saying "I like reading good emails" — I might be wrong, but I don't think the masochism of reading bad emails is so common as to make the qualification "good" necessary). Now, I've never found "math-inspired literature" (in the sense of prose structured by some rigidly followed formal rules or the novel's world-bulding being informed by mathematical, clearly spelled out assumptions) particularly interesting, as to me it has always had an air of a rather sterile, nerdy intellectual exercise. This is far from the ineffable, chiefly emotional qualities that I look for in fiction. One could say that both mathematics and literature are worthwhile human activities, but each for entirely different reasons. Nevertheless, when reading a book it sometimes happens that one encounters a small detail, playing at best a minor role in the plot or exposition, but related to something mathematically interesting — a treat which may fall completely under the radar of a layman, but piques the mathematician's interest (even if it's just a moment like "ha! I know what this fancy term means").
![]() |
Tadeusz Konwicki (1926-2015) photo: Chris Niedenthal |
"If my prescriptions do not produce the desired results in any specific case, which, of course, can happen, I can only beg your forgiveness, and as a consolation I will give the injured parties an effective rule for winning in the card game called Twenty-one. I learned this trick in my youth and was later to shine in many games of Twenty-one. I was taught the trick by a folk doctor, a mysterious wanderer, or by an old gypsy before his death. In any case, whoever it was was a magical figure and did not seem to be a part of this world.
There are two methods, because where I come from there are two ways of playing Twenty-one — using the whole deck or leaving the tens and picture cards out. So, when you're the dealer and using the latter method, make a separate pile for the nines. Then shuffle them back in casually, nonchalantly. Naturally, one of the players will notice what you're doing and accuse you of stacking the deck. Propose that he shuffle. He'll shuffle the cards for quite some time with a vengeful grin on his face, sometimes even for several minutes, in order to wipe out anything you may have done to them. Watch this closely, seem afraid, but remain calm. The more he shuffles, the more he brings defeat upon himself. Because in practically every hand, or at least in the statistical majority of them, your opponent will go bust.
When playing with a full deck, you must separate the picture cards, tens, and nines, into one pile, and everything from eight down in the other one. Shuffle as you did before.
I am sincere when I say I don't know how this trick works. And I never looked into it, either. I even think it's better not to succumb to the temptation of being too inquisitive. It's enough that it works.
On the other hand, one may well doubt whether a last will is the proper place for revealing secrets on how to cheat people at cards. But I humbly submit that people who have been successful at playing cards their whole lives will burst into laughter at such naive sorcery. On the other hand, people who have had no luck at cards will try my method once or twice and will occasionally even clean out the lucky players, thereby bringing Nemesis' scales into momentary balance."
Very noble indeed! But, being naturally curious and with Konwicki long dead, I think we can nevertheless safely attempt to peer into old gypsy's secrets and try to answer the nagging question: does the trick actually work or is it all just baloney?
![]() |
I could not find a convincing"magical gypsy" picture, so a Magic: The Gathering card must do. |
The rules always give a very slight advantage to the banker, so if the deck is perfectly shuffled and both players follow optimal strategies, the banker will win a majority of hands, but only with a small edge over the player in the long run. A very detailed analysis of strategy in blackjack (which is a refined variant of the game) can be found in "The Doctrine of Chances" by Stewart N. Ethier in Chapter (nomen omen) 21.
So to sum it up — we have a relatively simple card game with one player trying to stack the deck, the other one repeatedly shuffling the cards to undo the cheating and each of them has in effect some statistical odds of winning. What is mathematically interesting here? Contrary to what a layman might expect, the precise calculation of winning odds and strategy in a particular card game (be it poker, bridge, blackjack or what you like) is rarely of interest to a professional mathematician, at least in his capacity as a researcher (as opposed to a hobbyist or a gambler desperate to minimize the house advantage in a casino). Mathematicians are usually drawn to problems exhibiting (or at least promising) some theoretical depth, going beyond number-crunching necessary to determine, say, how likely it is to draw a hand with two aces when the previous player has a nine and a five and the dealer has... etc.
In fact, here probably the most interesting part of the whole game is the act of shuffling itself. Somewhat surprisingly, the topic is rich enough to be the subject of extensive mathematical research since at least 1980s, with a fairly recent, lovely book "The Mathematics of Shuffling Cards" by Persi Diaconis and Jason Fulman published in 2023. In mathematical terms, shuffling a deck of cards is an example of what in probability theory is known as a Markov chain. Informally speaking, this is a type of a random process evolving in time whose state in the next step depends only on the current state of the system (plus of course some randomness), but not otherwise on the history of the process. So in our case the state is the current arrangement of cards in the deck and what happens after an additional shuffle obviously depends only on the current ordering of the cards and how we shuffle (and not, say, how the cards were arranged a month ago). The exact mathematical description of the process depends on what method of shuffling is used, whether it's the (perhaps most common) riffle shuffle (with the deck being split in two packets which are then interleaved), the overhand shuffle or some other method, some of which are rather impractical but related to beautiful mathematics (such as the "random transpositions model" related to representation theory of the symmetric group).
![]() |
Persi Diaconis (1945-) photo: Erica Klarreich |
After this long digression we can finally get back to our question: does the damn card trick actually work or not? And here the answer is a resounding no. The old gypsy was spouting nonsense — sorry Mr. Konwicki, you've been had. As a matter of fact, the reason why the cheat doesn't work has nothing to do with the particular card game played, the trick used or the shuffling technique employed. This is all due to a result in the theory of Markov chains called the ergodic theorem. Informally speaking, it says that unless you shuffle the cards in a completely dumb and faulty way (for example, leaving one half of the deck intact), after sufficiently many shuffles the arrangement of cards in the deck will always be almost perfectly random, no matter what the starting arrangement of cards was (again, you can look up the precise formulation on Wikipedia). The theorem is fairly basic (it is taught in a standard third year probability class at my department), yet already sufficient to debunk old gypsy's "sorcery".
Of course, the catch here is that to obtain almost perfect randomness we need to perform "sufficiently many" shuffles, which for some methods of shuffling might in fact be "astronomically many". But here the old gypsy (or rather Konwicki in his description of the trick) doubled down on the dubious part of the trick, saying about our opponent: "The more he shuffles, the more he brings defeat upon himself". In reality, this statement is false in a very strong, definite sense — there is a theorem in the theory of Markov chains (if you want a precise reference: Exercise 4.2 in "Markov Chains and Mixing Times" by David Levin and Yuval Peres) saying that the so-called total variation distance to the uniform distribution of cards is decreasing with each subsequent shuffle (which means the deck becomes better mixed with each single shuffle, not only in some asymptotic sense). So the truth is, the more the opponent shuffles, the more the deck becomes well-randomized and any advantage due to possible deck stacking vanishes.
Now, an important caveat — we can imagine that in pre-war Lithuania, just as today, shuffling for a very long time would itself look suspicious, so in practice the opponent might be limited to performing only a small number of shuffles, possibly not "sufficiently many" as our theorem requires. In that case, it is possible that the deck has some residual non-randomness which can be exploited (although probably not nearly to the extent that will enable us to win "in practically every hand, or at least in the statistical majority of them"). Furthermore, some methods of shuffling enable an alert player to use techniques such as the so-called "sequence tracking" (see Chapter 7.5 in Diaconis and Fulman's book for a more detailed description) to exploit the imperfections in the shuffling procedure and predict which cards will end up clumped together. But the general point stands — if the opponent doesn't botch his job and shuffles thoroughly (as per Bayer and Diaconis, about seven times are enough for any game when using the riffle shuffle; for blackjack even less is enough, see Chapter 4.2 in Diaconis-Fulman), trying to stack the deck is a waste of time.
I should probably end this post with the following disclaimer: I am fully aware that anyone subscribing to the mathematical analysis presented above is bound to make a laughingstock of himself when confronted with a lucky gambler who actually followed old gypsy's tricks and earned a fortune. Well, such are the vagaries of life — we may calculate probabilities and put faith in rational theories, but what are they worth when we are faced with the Unknown, the magical world of the real life itself? In the end the old gypsy might have the upper hand with his sorcery, Markov chains and all that math be damned. I encourage the readers to check out for themselves and share their experiences.



2 comments:
What is the origin of the name of the blog?
This is explained on the "About this blog" page: https://push-processed.blogspot.com/p/about-this-blog.html
Post a Comment