Home | News | Features | Understanding the Mathematics of Card Shuffling

Understanding the Mathematics of Card Shuffling

May 8, 2024

To have a fair card game, you need to always ensure that the cards are shuffled sufficiently. And this is where maths comes in handy, especially in a casino. Maths answers the question of how many times you need to shuffle a deck of cards in order to achieve a thoroughly randomised pack. 

Perhaps you might have seen magicians perform card shuffling tricks to leave you awed. In most instances, these tricks are just maths in action. Below, we will explore the mathematics of card shuffling!

Blackjack dealer shuffling cards.

Card Shuffling: A Game of Numbers

Card shuffling is a game of numbers. Most mathematicians have proven that the number of shuffles required to mix up a deck of 52 cards varies depending on the type of shuffle utilised. So, which are these types of card shuffling techniques? 

1. Riffle Shuffle

Riffle shuffle is a card shuffling technique where you split the deck of cards into halves then use your thumbs to interleave the cards quickly. This technique is one of the most efficient card shuffling techniques and requires just seven shuffles to mix the cards well. 

2. Smoothing 

Smoothing is a technique where you scatter the cards flat on a table and then spread them out randomly over each other. This technique is quite simple and straightforward and requires only 30 seconds to 1 minute to mix the deck of cards thoroughly.

3. Overhand Technique

In the overhand card shuffling method, all you need to do is take sections of stacked cards and move them over to make a new stack. However, this technique is time-consuming as it requires you to mix the deck 10,000 times in order to achieve a perfect mix. 

Card Dealing for Card Game Fairness

Card dealing is a key technique to ensure fairness in card games. The main methods used in card dealing include back-and-forth and the cyclic method.  

The cyclic method deals cards in a repeating sequence. For example, one, two, three, four, one, two, three, four. On the other hand, the back-and-forth technique deals the cards in an alternating sequence. For example, one, two, three, four, four, three, two, one

Basically, the back-and-forth dealing technique is more efficient in terms of improving the randomness of the cards, thus necessitating just a few shuffles to mix the cards well. 

Practical Applications of Card Shuffling

Card shuffling piques interest from gamblers to casino executives among others. For instance, casino operators want to know the number of shuffles needed to mix a deck while employing almost perfect techniques. Casino executives use card shuffling techniques to make gamblers guess as few correct cards as possible.

On the other hand, gamblers use the mathematics behind some card shuffling techniques to maximise the number of times they can guess cards correctly when cards are turned up one at a time. 

How the Type of Game Affects Card Shuffling 

The game being played makes a difference in terms of the number of times required to mix them thoroughly. For example, in blackjack the card suits are ignored because certain cards are equal in value. For instance, ace cards are equal to 1 or 11 depending on the player’s choice and total hand value. What this means is that four or five shuffles are enough to mix the cards thoroughly. 

Beyond the Basics: The Maths Behind Perfect Shuffles

When mathematicians look at shuffling, they don’t focus on hearts, spades, or face cards. Instead, they think about the order of the deck. Imagine labelling each card from 1 at the top to 52 at the bottom. Every shuffle is just a new way of arranging those numbers.

The number of possible arrangements is mind-blowing. It’s written as “52 factorial,” which means multiplying 52 x 51 x 50 x 49, and so on, all the way down to 1. The result is a number with 68 digits. This is so large, in fact, that if someone shuffled a deck every second since the beginning of the universe, they still wouldn’t get through every possible order.

But here’s the twist: neat shuffles, like the in-shuffle and out-shuffle, don’t give anywhere near that many possibilities. Instead, the deck runs through a smaller set of repeating patterns. To the eye, it looks mixed, but mathematically, it’s just moving around in a predictable loop.

What is an Out-Shuffle?

In an out-shuffle, the deck is split perfectly in half and interleaved so that the original top card stays on top and the bottom card stays on the bottom. It looks neat, smooth, and in theory, can restore the deck to its original order after a precise number of shuffles.

What is an In-Shuffle?

An in-shuffle places the original top card into the second position and the bottom card into the second-to-last. It changes the structure more dramatically, but still with a predictable mathematical pattern.

By combining a sequence of in- and out-shuffles, it becomes what’s called the shuffle group: the set of all possible combinations that can form through perfect shuffles alone.

The Discovery of Central Symmetry

In the 1980s, three mathematicians, Persi Diaconis, Ronald Graham, and William Kantor studied perfect shuffles and discovered a theory they called central symmetry. If the top card of a deck moves down three positions after a shuffle, the bottom card moves up three places. Each card is linked with another card the same distance from the bottom, and they always move in the same way when shuffled. This invisible “bond” between cards means perfect shuffles can’t actually become totally random during card games.

Why “Random” Isn’t Always Random

Even though perfect shuffles look neat, they don’t create true randomness. Cards move in fixed patterns, and some always mirror each other. For example, if the top card moves down three spots, the bottom card will move up three spots. It’s kind of like invisible strings tying pairs of cards together. This symmetry is why casinos rely on riffle shuffles instead. They’re messier, less predictable, and much fairer.

Many-Handed Shuffling

keyboard_arrow_down

Most players think of splitting a deck into two halves, but mathematicians came up with the idea of splitting three, four, or even more equal piles before interleaving (weaving two piles of cards together).

Sometimes the number of cards fits perfectly with the way the deck is split, like 16 cards divided into two piles of 8. In those neat cases, the shuffle falls into a small repeating pattern. But most of the time, when the numbers don’t match so neatly, the possible outcomes shoot up massively.

Conclusion

Understanding the mathematics behind card shuffling opens up a new frontier to both casino operators and gamblers alike. While some of the card shuffling techniques are complex, maths comes in handy to at least help make more informed guesses when it comes to card games. Additionally, with a good grasp of card shuffling casinos can achieve fairness in casino card games

FAQs

How many riffle shuffles are needed to randomise a deck?

Mathematicians agree that around seven riffle shuffles are enough to properly mix a 52-card deck.

What is the difference between an in-shuffle and an out-shuffle?

An out-shuffle keeps the top and bottom cards in place, while an in-shuffle moves them inward one position each.

Do different games need different shuffle counts?

Yes. For games like blackjack, fewer shuffles are required since suits don’t matter as much. For poker or bridge, where every card value is more distinct, more mixing is needed for fairness.

Written By
David Lynch

Experienced writer and editor based in Ireland. Attends poker events, covers all casino games and slots, but is really a keen blackjack and roulette player at heart. A sports fanatic among all other things with a soft spot for soccer and F1