The Math of Card Shuffling

The Math of Card Shuffling.

When playing any card game with friends or family you want to play with a decent shuffled deck of cards to prevent misunderstandings, discussions or being accused of cheating. So, when is a deck of cards shuffled to the extent that we can call it random?  Let's look at the numbers and assume we have a new deck of cards with 52 cards and when you unbox them they are in perfect order / sorted.
Ok, so we split the new deck in exactly two stacks of 26 cards and we will execute a Riffle shuffle on the deck as pictured on the left here.

When performing a perfect riffle, the riffle shuffle rearranges the cards so that the first half of the deck (26 cards) and second half of the deck (26 cards) are interlaced, so the original deck order:

[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51]

becomes

[26, 0, 27, 1, 28, 2, 29, 3, 30, 4, 31, 5, 32, 6, 33, 7, 34, 8, 35, 9, 36, 10, 37, 11, 38, 12, 39, 13, 40, 14, 41, 15, 42, 16, 43, 17, 44, 18, 45, 19, 46, 20, 47, 21, 48, 22, 49, 23, 50, 24, 51, 25]

Because we shuffled a perfect riffle.

If we would repeat the perfect riffle shuffle on a 52 card deck 7 times, we would end up with this sequence:

[40, 28, 16, 4, 45, 33, 21, 9, 50, 38, 26, 14, 2, 43, 31, 19, 7, 48, 36, 24, 12, 0, 41, 29, 17, 5, 46, 34, 22, 10, 51, 39, 27, 15, 3, 44, 32, 20, 8, 49, 37, 25, 13, 1, 42, 30, 18, 6, 47, 35, 23, 11]

Which looks like this in a diagram:

Huh? A pattern? Oh, oh this is not good. When shuffling riffle perfectly, depending on which deck is on top when you start shuffling after 8 or 52 perfect shuffles the cards are back in their original order of when you started! Ok, so now what? Well, first there's a mathematical field that studies group mathematics.
Cheryl Praeger from the University of Western Australia explains that there can be a problem when using an N to the power of 2 number of decks; It's randomness is cut back so drastically to the point that we can't consider a Riffle shuffle random anymore. Her explanation can be found here:
To go short, never use 1,4 ,9 or 16 decks and use a SMOOSH shuffle to play serious games with. 
 
Smooshing
Also known as a scramble, smooshing is a method of shuffling where the cards are placed face down and spread around over each other before being gathered back into a stack. 

 

It looks simple but smooshing makes up for it with great effectiveness. Any card can end up in any position in the stack. The way the cards slide over or under each other is unpredictable and it is impossible to repeat the exact smooshing movement again and again. The potential for disorder is at a maximum.

In practice, smooshing lasting about a minute is more than enough to ensure a statistically random arrangement of cards. 

So, what’s the best way to shuffle a deck of cards?

Ultimately, it's up to you: shuffle several times in an orderly fashion or only once with chaotic abandon. However, when playing for money, with family, card-counters or magicians, I would smoosh until my hands hurt or at least a couple of minutes.....Have Fun Playing!

Referrals & Sources:
https://www.birs.ca//workshops//2019/19w5046/files/2019-Praeger-Banff-ShuffleGroups.pdf 
https://arxiv.org/pdf/1908.05128.pdf
https://coolconversion.com/math/factorial/_52_
 

Leave a comment

All comments are moderated before being published