Seven standard "riffle" shuffles are needed to effectively randomize a 52-card deck.
Seven standard "riffle" shuffles are needed to effectively randomize a 52-card deck.
51! through single inline backticks for clairity!
It’s also not sufficient to randomize a deck of cards using a 32-bit seed as was once common in software.
Indeed, even with a 64 bit seed, it is not sufficient.
log2(52!) right?
No problem! It only stood out to me because it’d be an amazing coincidence if 52! fit snuggly into 2^8. Being a nerd, I have many powers of 2 memorized!
With a little playing around, it seems like 57! is the last whole number that fits (254.5 bits needed) so you could add a couple of jokers in or even use a tarot deck’s minor arcana (56 cards) and have room with a 256-bit wide BigInt, with a few bits to spare!
You’re essentially splitting the deck and recombining the two halves imperfectly multiple times in a row. Like if a riffle was perfect, you would get the cards from both halves equally distributed, but nobody can do it perfectly, so they actually end up properly randomized. After 7 imperfect riffles, the entire deck is unpredictable.
After 4 perfect ABAB riffle shuffles, you would end up with the same order as you started with. If your shuffles are imperfect, your deck becomes more random every time.
I don’t know much about card tricks, just that many appear to use on non-random cuts and those ABAB shuffles to get cards where they need to go. This one ‘The Hotel’ might even be easy enough for me to learn:
Numberphile has a bunch of videos on it, and yes 7 the accepted number because more shuffling doesn’t increase the randomness in an effective manner.
I’ve always found this factoid pretty dubious. First off it’s statistical so there are no absolute truths or facts, only tendencies.
But do this experiment for yourself, I just did a few times: take all the kings and aces out. Order them (I used Spade, Club, Heart, Diamond, Aces first then kings) and put them on top of the deck. Now do 7 riffles and look through the deck.
What I found is that the 8 chosen cards are still weighted towards the top of the deck (a little less than half moved to the bottom half, but none to the bottom 1/3rd). The suits got shuffled a little but all the spades and most clubs were still in the top 1/3rd of the deck. Most of the aces and kings stayed together in close pairs or triplets, within 5 cards of each other.
So no, 7 riffles isn’t realistically good enough for fair play at actual tables. You need to mix in some cuts and pool shuffles to break up the structure of the deck and properly distribute the cards.
I do think cuts are necessary, and I use them each time. If each riffle includes a cut I feel this factoid is undoubtedly true, period.
Therefore, I think the definition of riffle must include a cut.