Join 3,512 readers in helping fund MetaFilter (Hide)


How many shuffles?
August 21, 2011 6:21 AM   Subscribe

How many shuffles to randomize a deck of cards?

a.) 52 standard playing cards, symmetric (upright = upside down)
b.) 78 tarot, symmetric
c.) 78 tarot, upright distinct from upside down.

I read in Scientific American 15 years ago that case (a.) requires seven careful shuffles, and although the bona fides of the statistics guy that wrote this seemed fine, I subsequently confirmed for myself with some tedious experimentation that seven shuffles were good.

Seven shuffles is not sufficient with a tarot deck. The most trustworthy person I know uses 21 which seems a little overdone. I have not been able to find a statistician published number.

If you know the correct permute / combination formula to apply I would appreciate that also.

Thank you!
posted by bukvich to Sports, Hobbies, & Recreation (10 answers total) 1 user marked this as a favorite
 
There is no answer to this question until you define "shuffle" a great deal more clearly.
posted by pompomtom at 6:34 AM on August 21, 2011 [4 favorites]


According to Wikipedia, for an n-card deck, the number of riffle shuffles needed grows as 1.5 log (n) / log (2).

I'm guessing, but am sure someone will calculate and correct... you need 9.45 in the case of up/down indistinct, and say 10.96 for the up/down matters shuffling.
posted by Cuppatea at 6:39 AM on August 21, 2011 [2 favorites]


You definitely need better definitions. For example, if you perform perfect faro shuffles, that is you cut the deck in exactly half and interleave the cards precisely, then in eight shuffles you will be back to the deck order you started with (for a standard deck). If you're good enough at doing perfect shuffles and do some pre-planning then you can pre-order the deck so that your desired order comes up after some other number of shuffles, too... Just pick the order you want and un-shuffle it as many times as necessary.
posted by anaelith at 6:58 AM on August 21, 2011 [1 favorite]


You are going to need to read the work of Persi Diaconis:
Professor Diaconis achieved brief national fame when he received a MacArthur Fellowship in 1982, and again in 1992 after the publication (with Dave Bayer) of a paper entitled "Trailing the Dovetail Shuffle to Its Lair" (a term coined by magician Charles Jordan in the early 1900s) which established rigorous results on how many times a deck of playing cards must be riffle shuffled before it can be considered random according to the mathematical measure total variation distance. Diaconis is often cited for the simplified proposition that it takes seven shuffles to randomize a deck. More precisely, Diaconis showed that it takes 5 shuffles before the total variation distance of a 52-card deck begins to drop significantly from the maximum value of 1.0, and 7 shuffles before it drops below 0.5, after which it is reduced by a factor of 2 every shuffle.
Diaconis has coauthored several more recent papers expanding on his 1992 results and relating the problem of shuffling cards to other problems in mathematics.
More recently, some have questioned this result, arguing that the measure of randomness is too demanding, and that six shuffles are enough (Trefethen et al., 2000).[1]
Diaconis and colleagues have published follow-up papers, showing that the separation distance of an ordered blackjack deck (that is, aces on top, followed by 2's, followed by 3's, etc.) drops below .5 after 7 shuffles. Separation distance is an upper bound for variation distance.[2][3]
posted by jeb at 6:59 AM on August 21, 2011 [4 favorites]


In Bridge circles, I always heard 7 for humans and 8 for machines, but I have no mathematical or experimental evidence for this. Still, the wisdom of Bridge players is not to be trifled with....
posted by GenjiandProust at 7:13 AM on August 21, 2011


I uh... heard someplace, yeah that's the ticket... that you should 'shuffle' a tarot deck by washing the cards before perhaps giving it a riffle or three.
posted by ob1quixote at 8:57 AM on August 21, 2011


In the first couple minutes of this video, Penn of Penn&Teller claims it is twelve and gives his source.

He is, though, only talking about a deck of 52.
posted by From Bklyn at 1:46 PM on August 21, 2011


Here's the book to read if you really want to get into it. Persi Diaconis is one of my all-time favourite mathematicians!
posted by kaibutsu at 2:07 PM on August 21, 2011


Seconding the references to Persi Diaconis, but you should know that it is possible to come up with games for which seven shuffles do not suffice. See here. As far as I know, the question of reversed cards has not been studied. First you would have to define how shuffling affects orientation. I assume you want to do something like reverse the top pack after you cut to shuffle each time. That would be tricky to analyze because a cards final orientation will depend on how it travels through the deck. I would not be surprised if it made a difference whether you performed an even or odd number of shuffles.

One way to make it simpler would be to perform shuffles without reversing any cards until the deck is sufficiently randomized (i.e. 9.45 times), then cutting the deck and reversing the top pack. Assuming you cut with a binomial distribution (which I believe is what is usually assumed in the mathematical study of shuffling), this will result in the "right" number of cards being reversed. Assuming the deck is random, which cards get reversed should be random too. Then you just need to perform enough shuffles that the reversed cards are distributed through the deck. Now you don't care about the values on the cards, just whether or not they are reversed. That situation has been examined in a paper[pdf] of Assaf, Diaconis, and Soundararajan. I haven't worked it all out, but it looks like 1 or 2 shuffles should be enough to meet the "seven shuffles suffice" level of randomness.

To summarize, one way of handling the reversed Tarot card case would be to do 10 shuffles without reversing any cards, cut the deck and reverse the top pack, then do 2 more shuffles without reversing.
posted by eruonna at 7:23 PM on August 21, 2011


On further consideration, if you cut the deck, reverse the top and then shuffle the packs together, that should distribute the reversed cards uniformly among the unreversed with no need for an additional shuffle.
posted by eruonna at 8:53 PM on August 21, 2011


« Older Please help, computer techies...   |  What are some materials about ... Newer »
This thread is closed to new comments.