In the mathematics of shuffling playing cards, the Gilbert–Shannon–Reeds model is a probability distribution on riffle shuffle permutations.[1] It forms the basis for a recommendation that a deck of cards should be riffled seven times in order to thoroughly randomize it.[2] It is named after the work of Edgar Gilbert, Claude Shannon, and J. Reeds, reported in a 1955 technical report by Gilbert and in a 1981 unpublished manuscript of Reeds.
A riffle shuffle permutation of a sequence of elements is obtained by partitioning the elements into two contiguous subsequences, and then arbitrarily interleaving the two subsequences. For instance, this describes many common ways of shuffling a deck of playing cards, by cutting the deck into two piles of cards that are then riffled together. The Gilbert–Shannon–Reeds model assigns a probability to each of these permutations. In this way, it describes the probability of obtaining each permutation, when a shuffle is performed at random. The model may be defined in several equivalent ways, describing alternative ways of performing this random shuffle:
n
k
n-k
\tbinom{n}{k}/2n
x
y
x/(x+y)
y/(x+y)
n
n
x\mapsto2x\pmod{1}
Among all of the possible riffle shuffle permutations of a card deck, the Gilbert–Shannon–Reeds model gives almost all riffles equal probability,
1/2n
(n+1)/2n
The inverse permutation of a random riffle may be generated directly. To do so, start with a deck of n cards and then repeatedly deal off the bottom card of the deck onto one of two piles, choosing randomly with equal probability which of the two piles to deal each card onto. Then, when all cards have been dealt, stack the two piles back together.[2]
analyzed mathematically the total variation distance between two probability distributions on permutations: the uniform distribution in which all permutations are equally likely, and the distribution generated by repeated applications of the Gilbert–Shannon–Reeds model. The total variation distance measures how similar or dissimilar two probability distributions are; it is zero only when the two distributions are identical, and attains a maximum value of one for probability distributions that never generate the same values as each other. Bayer and Diaconis reported that, for decks of n cards shuffled
\tfrac{3}{2}log2n+\theta
Similar analyses have been performed using the Kullback–Leibler divergence, a distance between two probability distributions defined in terms of entropy; the divergence of a distribution from uniform can be interpreted as the number of bits of information that can still be recovered about the initial state of the card deck. The results are qualitatively different: rather than having a sharp threshold between random and non-random at
\tfrac{3}{2}log2n
log2n
\tfrac{3}{2}log2n