Progressive Randomization of a Deck of Playing Cards : Experimental Tests and Statistical Analysis of the Riffle Shuffle

The question of how many shuffles are required to randomize an initially ordered deck of cards is a problem that has fascinated mathematicians, scientists, and the general public. The two principal theoretical approaches to the problem, which differed in how each defined randomness, has led to statistically different threshold numbers of shuffles. This paper reports a comprehensive experimental analysis of the card randomization problem for the purposes of determining 1) which of the two theoretical approaches made the more accurate prediction, 2) whether different statistical tests yield different threshold numbers of randomizing shuffles, and 3) whether manual or mechanical shuffling randomizes a deck more effectively for a given number of shuffles. Permutations of 52-card decks, each subjected to sets of 19 successive riffle shuffles executed manually and by an auto-shuffling device were recorded sequentially and analyzed in respect to 1) the theory of runs, 2) rank ordering, 3) serial correlation, 4) theory of rising sequences, and 5) entropy and information theory. Among the outcomes, it was found that: 1) different statistical tests were sensitive to different patterns indicative of residual order; 2) as a consequence, the threshold number of randomizing shuffles could vary widely among tests; 3) in general, manual shuffling randomized a deck better than mechanical shuffling for a given number of shuffles; and 4) the mean number of rising sequences as a function of number of manual shuffles matched very closely the theoretical predictions based on the Gilbert-Shannon-Reed (GSR) model of riffle shuffles, whereas mechanical shuffling resulted in significantly fewer rising sequences than predicted.


Introduction: The Card Randomization Problem
Proposed solutions to the problem of determining the number of shuffles required to randomize a deck of cards have drawn upon concepts from probability theory, statistics, combinatorial analysis, group theory, and communication theory [1] [2].The methods employed transcend pure mathematics, and have implications for statistical physics (e.g.random walk; diffusion theory; theory of phase transitions) [3] [4], quantum physics [5], computer science [6] [7], and other fields in which randomly generated data sequences are investigated.Not only mathematicians and scientists, but the general public as well have shown much interest in the card randomization problem, as reported in popular science periodicals and major news media [8] [9] [10] [11].This paper reports what the author believes to be the most thorough experimental examination to date of the randomization of shuffled cards, using statistical tests previously employed in nuclear physics to search for violations of physical laws by testing different radioactive decay processes for non-randomness [12] [13] [14] [15].

Background
Probability as a coherent mathematical theory is said to have been "born in the gaming rooms of the seventeenth century" in attempts to solve one or another betting problem [16].Among the most ancient forms of gambling are card games, which developed initially in Asia but became popular in Europe after the invention of printing [17].Depending on what one considers a distinct game, experts in the subject estimate the number of card games to be between 1000 and 10,000 [18] [19].Most card games are conducted under the assumption that the deck in play has been initially randomized.From a practical standpoint, a deck is considered random if players are unable to predict any sequence of cards following a revealed card.(Mathematically, there is on average 1 chance in n of guessing correctly the value of any unrevealed card in a deck of n randomly distributed cards).
The standard way to mix a deck of cards randomly is to shuffle it, for which purpose the riffle shuffle is perhaps the most widely studied form.To execute a riffle shuffle, one separates ("cuts") the deck into two piles, then interleaves the cards by dropping them alternately from each pile to reform a single deck.The process can be performed either by hand or mechanically by an auto shuffler, like the device shown in Figure 1 used to acquire some of the data reported in this paper.Clearly, a single riffle shuffle cannot randomize an ordered deck because the order of cards from each pile is maintained.Indeed, in a perfect riffle shuffle of an even-numbered deck, whereby the deck is cut exactly in half and 1 card is dropped alternately from each pile, there would be no randomization at all.Instead, the sequences of cards resulting from a series of perfect riffle shuffles cycle through a fixed number of permutations leading back to the original card order.
For example, a pack of 52 cards recycles after only 8 perfect "out-shuffles" (i.e. where the top card remains on top) [20].However, under ordinary circumstances Figure 1.Motor-driven mechanical card shuffler used to generate auto-shuffled card sequences.Two piles of cards placed as shown are displaced from below by rotating wheels so as to drop sequentially into the central chamber.
where shuffles are not perfect, the order of the cards from each pile is degraded with each successive riffle shuffle.
The central question comprising the card randomization problem is this: How many riffle shuffles are required to randomize a deck of cards?More accurately stated: After how many shuffles can one detect no evidence of non-randomness?
Various researchers have studied this question theoretically and arrived at statistically different answers, depending on the adopted measure of randomness.In the analysis of Bayer and Diaconis [1], the measure of randomness of the deck is the so-called variation distance (VD) [4] [21] between the probability density S of n distinct objects.In the limit of large n, the VD analysis predicted that ( ) ( ) shuffles should adequately randomize a deck of n cards.Thus

( )
VD 52 m is about 8 -9.According to [1], VD quantifies the mean rate at which a gambler could expect to win against a fair house by exploiting any residual pattern of the cards.The researchers also showed that the VD between for large n with m given by Equation (1).For complete randomness, the VD would equal 0.
In a numerical analysis by Trefethen and Trefethen [2], the adopted measure of randomness was based on the Shannon entropy of the deck in the sense of information theory [22] [23].If j p ( ) is the probability of the j th permutation of n S , then the Shannon entropy of the deck is given by and the information associated with the set of probabilities { } j p was defined as ( ) According to [2] n I in Equation (5) quantifies the rate at which an ideally competent coder could expect to transmit information if the signals were encoded in shuffled decks of cards.In the limit of large n, the information theoretic (IT) calculation predicted that ( ) ( ) shuffles should adequately randomize a deck of n cards.Thus ( ) . The numerically obtained results of [2] were subsequently proved theoretically by another research group [24].
The structure of relation ( 5) provides a mathematical definition of the word "information" consistent with its general vernacular use.If there is no uncertainty in the communication of any n-symbol message based on card sequence, then 1 j p = for each permutation j.In that case 0 H = and the information is maximum.If, however, every message received is completely uncertain as to card order, then 1 !j p n = for each permutation j, and therefore, by use of Equation ( 4), the information 0 n I = .Alternatively [25], physicists and other scientists usually associate the concept of information with entropy H, Equation (3).The rationale is that the greater the uncertainty (i.e.H) of a message or physical system, the more information one gains by a binary decision (or measurement) that reduces the uncertainty.In a system with perfect order, H = 0; the outcome of any measurement or decision is completely predictable, and therefore no new information is to be gained.Both definitions of information prove useful later in the paper (Section 3.4).
Although the two analyses [1] and [2] led to statistically different distributions of randomness as a function of shuffle number, they both started from the same mathematical model of shuffling, referred to as the GSR shuffle, named for Gilbert and Shannon [26] and, independently, for Reeds [27].The GSR shuffle involves the following steps.The deck is cut roughly in half according to a binomial distribution in which the probability that a pile contains k out of n cards is is the binomial combinatorial coefficient.The two halves are then riffled together such that the probability of a card being dropped from a pile is proportional to the number of cards in the pile.

Outline of Paper
The research literature on the randomization of cards by shuffling is vast.An extensive list of references that survey the development of the problem, of which virtually all papers are theoretical analyses or numerical modeling by computer simulation, can be found in [28].To the best of the author's knowledge, there has been no comprehensive, systematic experimental examination of the card ordering and patterns produced by manual shuffling to test whether the results conform to the GSR model or support the published theoretical predictions.
This paper reports on an extensive set of tests by which was measured the progression toward randomness of card sequences produced in multiple riffle shuffles manually and, for comparison, by a mechanical auto shuffler.
The basic theory and experimental outcomes of the following measures of randomness are discussed in Section 2: 1) runs with respect to the mean, 2) runs up/down, 3) rank ordering, 4) serial correlation (lag 1), and 5) theory of rising sequences.
Analysis of the data by information theory is discussed in Section 3.
Conclusions are presented in Section 4.

Experiment and Statistical Tests
Experiments were undertaken to examine the permutations of card order in a deck of n = 52 cards as a function of shuffle number m for For the experiments reported here, the number of shuffles per set is M = 19 and the number of sets is N = 12.In addition to manual shuffles, the experiments were also carried out with the mechanical auto shuffler of Figure 1.The cards used in manual shuffling were not new, but had already been flexed many times previously in play and were therefore more pliant than stiff new cards.This requirement was irrelevant for auto shuffling, since the cards were flat, not flexed, when distributed by the machine into two piles.A sample of the data obtained from one set of M shuffles is shown in Table 1.
The experiment began with an ordered deck (column m = 0, highlighted in red), with card values increasing from 1 (top card) to 52 (bottom card

Theory of Runs
A run is defined as a succession of similar events preceded and succeeded by a different event.For example, the sequence of   n n n = + symbols in all, it can be deduced that [29]: • the mean number of runs of a of length precisely k (where • the mean number of runs of a of length k or greater (i.e.inclusive runs) is • the mean number of total runs of both kinds is Expressions for kb r , kb R follow, mutatis mutandis, from Equation ( 9) and Equation (10).Proofs of these expressions are given in [30] [31].
Two methods were employed in this paper to generate runs of binary symbols from the experimentally recorded sequences of digital card values.

Target Runs
The card value i x ( ) at location i in the sequence resulting from a particular shuffle is compared with a target value X, here taken to be the mean which reduces as shown for the case 52 n = with set of card values Moreover, the set is equally partitioned: and the mean number of total runs, Equation (11), reduces to where the numerical value again applies to the case of 52 n = .
The associated variance (with corresponding standard deviation) is given by [29] 2 mean mean with numerical evaluation for 52 n = .It can also be shown that the test statistic ( ) for the observed total number of runs is approximately Gaussian for sufficiently large n.The symbol The resulting binary series with target taken to be the mean ( 12) is then which comprises the following set of target runs 2 runs of 0 of length 1 2 runs of 1 of length 4 for a total of 4 runs with respect to the mean.
For a long equipartitioned sequence ( 1 0 1 n n =  ), the contribution of runs at the start or end of a sequence becomes negligible compared with the number of runs within the sequence, and Equation ( 9) and Equation ( 10) may be approx- Equation ( 19) and Equation ( 20) are illustrative of the general exact relation ( ) that follows from the definitions of ka r and ka R .

Runs Up/Down (or Difference Runs)
An alternative method of generating sequences of binary symbols that provides an independent test for non-random symbol patterns is to calculate sequential differences of the card values as follows ( ) and assign 1 to a positive difference ( ) ( The resulting binary difference series is then which comprises the following set of up/down runs 2 runs of 1 of length 1 2 runs of 0 of length 1 1 run of 1 of length 2 1 run of 0 of length 3 (25) for a total of 6 up/down runs.
Comparison of binary sequences (24), (17) and corresponding runs tabulations (25), (18) illustrates how the same decimal sequence ( 16) can lead to com-Open Journal of Statistics pletely different outcomes of up/down and target runs tests.Thus, the two kinds of runs procedures independently test the same decimal sequence for different symbol patterns.
A major difference between the target runs and the up/down runs is that variates in the former (e.g.series (17)) are realizations of Bernoulli random variables (i.e. the probability of occurrence is the same irrespective of location within the series), whereas the variates in the latter (e.g.series (24)) are not.For up/down runs, the greater the length of a run, the less probable is the occurrence of yet another symbol of the same kind.The expectation values of up/down runs, therefore, differ from those of target runs.Instead, the expressions corresponding to ( 9)-( 11) are [29]: • the mean number of up and down runs of length precisely k (where • the mean number of up and down runs of length k or greater (where • the mean total number of up and down runs is ( ) with associated variance and standard deviation ( ) Evaluations in Equation (28) and Equation ( 29) pertain to 52 n = .The statistic ( ) is again approximately normally distributed.

Runs Tests of Shuffled Cards
The total numbers of target runs and up/down runs were calculated as a function of shuffle number for each of the N sets of M shuffles, such as exemplified by Table 1.Note that the ascending sequences (yellow) and descending sequences (green) respectively correspond to examples of up and down runs.The mean of the N values for each shuffle number was then calculated and converted to standard normal forms expressed by ( 15) and (30).Examination of the figure shows that, when gauged by runs, the deck of cards becomes randomized after a threshold of about 7 -8 shuffles, where, by the definition adopted here, the point of randomization occurs when the standard normal

Rank Correlation (or Rank Order)
The Spearman rank correlation coefficient S r is a nonparametric measure of the association between two random variables X and Y as defined by their rank order in a sequence of n pairs [33] ( ) in which ( ) ( ) is the difference between the ranks assigned to samples i x and i y (When a distinction is necessary, lower case letters (e.g.x) represent realizations of the abstract random variable which is usually expressed by an upper case letter (e.g.

X)).
Values of S r range from −1 to +1, respectively signifying perfect an- ti-correlation (i.e.reverse rankings) and perfect correlation.It is 2 S r , however, rather than S r , that has a statistical interpretation; 2 S r is a measure of the variability of the data attributable to the correlation between variables X and Y [34].Thus a relatively high correlation coefficient such as S 0.7 r = , means that only 49% of the variability is accounted for by the association between X and Y.
For independent variables (and therefore uncorrelated ranks), the expectation value and variance are respectively and the test statistic follows a standard normal distribution to good approximation [35].
Applied to the shuffling of cards, the variable Y signifies the initial card se-  of the m th shuffle.Since the face values of the cards range from 1 to 52, the rank of a card is equal to its face value.Therefore an equivalent, but simpler, way to perform the rank correlation test is to calculate the cross correlation of ranks where the second equality in (36) pertains specifically to the sequence of cards in a deck of n cards.The expectation value and variance of rank C are respectively ( ) ( ) ( ) with numerical evaluations for 52 n = .The test statistic can be shown to be identical to that of Equation ( 35) [33].

Serial Correlation Lag-1
Serial correlation refers to the relationship between elements of the same series separated by a fixed interval.Given a sequence of elements { } where j k x + is to be replaced by j k n x + − for all values of j such that j k n + > .
For the purpose of testing correlations in card order following shuffling, the most useful serial coefficient is 1 ρ , which measures the correlations between pairs of consecutive cards.It can be shown, however, that a test based upon the simpler statistic [37] is equivalent to a test based on 1 ρ .The mean and variance of 1 c are given by the following expressions [36] [37] where For large n, the statistic follows a standard normal distribution to good approximation.
Figure 4 shows a plot of serial z , i.e.Equation (45) averaged over the N sets of data for each shuffle number m for both manually (blue) and auto (red) shuffled cards.The correlation between the card sequence of the m th shuffle and the initial card sequence (m = 0) is interpreted as statistically 0 (i.e. for serial 1 z ≤ ) starting at about m = 8 (manual) and m = 16 (auto).

Rising Sequences
A rising sequence, as defined in [1], is a maximal consecutively increasing subset of an arrangement of cards.For example, consider a hand of 8 cards with the sequence of face values: 1 6 2 3 7 8 4 5.By displaying the cards in the following way { } one sees that the hand consists of two rising sequences (1,2,3,4,5) and (6,7,8) interleaved together.Successive riffle shuffles tend to double the number of rising sequences up to a maximum number of ( ) n + in the limit of an infinite number of shuffles.Note that a rising sequence is different from an ascending sequence (i.e. a run up): 1) The elements of a run up merely ascend, but do not have to increment successively; 2) The elements of a rising sequence do not have to be contiguous (as in a run), but can be separated by other elements.
It is shown in [1] that the probability of a particular permutation following a riffle shuffle depends only on the deck size n and the number r of rising sequences in the permutation.Specifically, the probability that the m th riffle shuffle of an ordered deck has r rising sequences is ( ) The mean number of rising sequences in the permutation following m shuffles is then given by ( ) ( ) where the Eulerian number [38] ( ) ( ) is the number of permutations containing r rising sequences.Substitution of Equation (49) into Equation (48) leads to the simpler expression [39] (50) The sum of powers of an uninterrupted sequence of positive integers, such as contained in expression (50), is given by Faulhaber's formula [40] ( ) in which B k is a Bernoulli number, defined by the generating function [41] ( ) ( ) and given explicitly by where the Riemann zeta function is defined by (Ref.[41], pp.329-330) ( ) In the limit R → ∞ , the sum in the right side of Equation (51) becomes neg- ligible, and therefore as stated without proof at the start of this section.The numerical evaluation pertains to a deck with n = 52.The mean-square number of rising sequences for m shuffles can be calculated numerically from Equation (47) and Equation (49) from which follows, also numerically, the theoretical (i.e.population) variance The author was unable to determine an analytical closed-form expression for (57) or (58).• For 4 m < , the three curves (theory, manual shuffle, auto shuffle) yielded virtually identical results.For 5 m ≥ , the rising sequences due to manual shuffling were statistically coincident with theoretical predictions, whereas shuffling by machine yielded too few rising sequences at each shuffle number up to the asymptotic number A 13 m ≈ .This feature suggests one can randomize a deck better by shuffling it manually than by use of a mechanical auto shuffling device like that in Figure 1.

Entropy of Rising Sequences
As discussed briefly in Section 1.1, the Shannon entropy of a set of n symbols is given by where j p ( ) is the probability of the j th permutation of the !n to- tal number of ways to permute the symbols.By completeness, the set of probabilities { } j p satisfies Equation ( 4).Multiplied by a universal physical constant (Boltzmann's constant B k ), the Shannon entropy, usually expressed in terms of natural logarithms, provides the basis for deriving the partition function-and therefore all the thermodynamic potentials-of equilibrium statistical mechanics [42].From a physicist's perspective, H is a universal measure of the disorder of a system, maximum randomization occurring when all j p are equal.For a maximally randomized system of n = 52 symbols, Although Equation (59) yields the entropy of a sequence of n distinct uncorrelated symbols, it does not predict the entropy correctly when the permutations are constrained by rules that create correlations among the symbols.To chart the increasing disorder in a system of n cards as a function of the number m of riffle shuffles one can calculate the entropy of all configurations of a fixed number r of rising sequences and then sum that entropy over the total number of rising sequences produced in the shuffle.In this case, the relevant probability function is and Equation ( 47).This procedure leads to a much lower maximum entropy than Equation (59) because it respects the constraints imposed on possible orderings by the physical mechanism of the riffle shuffle.It has been shown that the possible outcomes to m riffle shuffles of an ordered deck are equivalent to the outcomes of cutting a deck into 2 m packets and interleaving the cards from different packets in such a way that the cards from each packet maintain their relative order among themselves [1] [39].
Figure 6 shows the variation in ( ) , n m p r as a function of r for various increasing values of m.In the limit of large m, which for all practical purposes

Conditional Entropy
Equation (61) yields the total entropy of a card deck subject to m riffle shuffles.
However, it does not provide information on the randomization of specific card associations, which is the kind of information that serious players might rely on for advantage in competition or gambling.For this purpose, the conditional entropy of pairs of ordered sequences was determined experimentally.
Let X and Y be two discrete random variables spanning the same range of n The conditional entropy of the sequence { } i x , given that the sequence { } i y is known, is defined by [43] ( ) where the condition probability (See also Ref. [22], pp 52-53.)The joint entropy of X and Y is then given by ( ) Equation (66) states that the entropy of a joint event, e.g.X and Y, is the entropy of the former plus the conditional entropy of the latter when the former is known.One may also define the quantity Open Journal of Statistics which is the decrease in entropy of the events X when it is known that events Y have occurred.Given the preceding interpretation, the function expressed by Equation ( 67) is taken to represent the information provided by knowledge of the events Y [43].
In the analysis of permuted card sequences in the following two sections, the which is particularly useful for calculation.

Entropy of Sequences of Card Pairs: Theoretical
To apply the preceding concepts to riffle shuffles, the experimental sequences of digital card values are transformed into two sets of binary values by the following procedure, schematically shown in Figure 9.
• Given a decimal sequence of card values • Transform the set { } in which ( ) count the number of events of the kinds represented respectively by panels A, B, C, D. To summarize, the statistic ( ) , n α β is the number of events of symbol α followed by symbol β , where both symbols can take on values of 0 or 1.
The statistics ( ) , n α β satisfy the sum rule ( ) evaluated numerically above for a deck of n = 52 cards.In this information theoretic analysis, it is useful to think of the α symbols as the realizations of a "message" variable A that represents a received signal of 1's and 0's, whereas the β symbols are the realizations of a following "prediction" variable B that represents a predicted signal of 1's and 0's.For each successive shuffle of the deck, the set of conditional probabilities ( ) p β α determines the conditional entropy ( ) H B A , which is the uncertainty in predicting B given knowledge of A.
It is straightforward to show that the conditional probabilities ( ) p β α can be estimated from the pair association statistics (71)-(74) as follows ( ) physics, where natural logarithms are usually used rather than logarithms to base 2, entropy and information are in units of nats.

Entropy of Sequences of Card Pairs: Experimental
An experiment was performed in which an initially ordered deck of n = 52 cards was subject to N = 11 sets of M = 19 riffle shuffles per set implemented by the auto shuffler in Figure 1, thereby generating M columns of card permutations for each set such as illustrated in Table 1.The cards were shuffled mechanically, rather than manually, so that the riffle shuffles would be executed as uniformly as possible.The pair association numbers ( ) , n α β for each of the M shuffles were then averaged over the N sets to yield the mean numbers of pair associations summarized in Table 3 and plotted in Figure 10 as a function of shuffle number m.
For a completely ordered deck prior to shuffling (m = 0), there are 2 50 n − = occurrences of 1 α = followed by 1 β = , as shown by the plot of ( ) 10.This number drops rapidly with increasing shuffle number, becoming effectively 0 by about 8 m ≈ .Correspondingly, the occurrence of 0 α =  The plots in panel A, which show the conditional probabilities of prediction variable β given received variable 0 α = , begin at m = 1 because there is no event 0 in a completely ordered deck (m = 0).As the shuffle number m increases, the number of ordered pairs decreases, and ( ) 0 0 p approaches 1 while ( ) 1 0 p approaches 0. In panel B, the probabilities are conditioned on a received variable 1.As the number of 0 events increase with m, it follows again that ( ) 0 1 p approaches 1 and ( )   4 and plotted in Figure 12.The plot of information (red curve) was multiplied by a factor 10 to enhance visibility.
The black double arrow marks the standard deviation of the information at shuffle number m = 12.As shown by Table 4, the information at all shuffle numbers is within 1 ± standard deviation of 0.
Since the randomness of a deck of cards is ordinarily expected to increase with the number of shuffles, as shown explicitly in Figure 8 for the entropy of rising sequences, the decrease of ( ) H B with shuffle number in Figure 12 calls for an explanation.In the initially ordered deck, all sequential pairs of cards are in order, and therefore both the message variable A and prediction variable B for any pair take the value 1 (as demonstrated in Figure 9).With each successive shuffle, successive pairs of cards become less and less ordered and variables B and A increasingly take the value 0. Thus, as shown in Figure 11, the conditional probabilities become increasingly predictable as they asymptotically approach either 1 (100% chance of an ordered pair occurring) or 0 (100% chance of an ordered   about the 6 th shuffle, whereas the runs test statistic z is close to 0 at about the 8 th shuffle.For the statistical variable of rising sequences, the manually shuffled cards met the criterion of complete mixing at about the 8 th shuffle, as predicted in [1], whereas the same criterion was met at about the 12 th shuffle for mechanically shuffled cards.Large differences in threshold values obtained from different test variables arose because the tests examined different aspects of the residual patterns embedded in the permutations of card order. However, so as not to misinterpret (or over-interpret) these results, the reader should bear in mind that the statistical tests in themselves do not indicate that any residual pattern would actually be useful to a card player.For example, Table 1 shows instances of ascending and descending sequences even up to the 19 th shuffle, at which point such patterns are almost assuredly uninformative.On the other hand, the residual order remaining at the 7 th shuffle, indicated by the conditional probability functions plotted in Figure 11, might possibly be useful to an astute and skillful player.The variable results of Table 5 notwithstanding, it is probably safe to say that 4 shuffles-which have been reported to be standard protocol at casinos [44]-are too few (as suggested by the plots of runs in Figure 2 and rising sequences in Figure 5).
Of the various statistical measures applied to the experimentally generated card sequences, the author is aware of only one measure-mean number of ris-

( 3 )
Open Journal of Statistics where, by completeness, 12 symbols b b a a a b b b a b a b contains: Open Journal of Statistics of 7 runs.If a sequence is random, then all permutations of symbol order should have the same probability of occurrence.From this invariance principle, as applied to a sequence containing a n symbols of type a, b n symbols of type b, and a b

1 N( 16 )
designates the standard normal distribution of mean 0 and variance 1.As an example, consider the 10-card decimal sequence generated by a uniform random number generator (RNG) over the integer range (1 ... 52):{ } 29 47 45 32 6 34 44 36 38 5 x = Open Journal of Statistics Since there is no repeating integer in the set { } i x , the value 0 j y = cannot occur.Thus, a sequence of 52 card values is transformed into a sequence of 51 binary difference values.For example, consider again the 10-card decimal sequence (16):

Figure 2
shows plots of mean z in frame A and u/d z in frame B as a function of shuffle number.

Figure 2 . 1 z
Figure 2. Runs statistics as a function of number of shuffles obtained by hand (blue curve) and machine (red curve) for (A) runs relative to the mean and (B) runs up/down.Values within about ±1 standard deviation of the expected value 0 can be taken to indicate a randomly ordered deck.

Figure 3
Figure 3 shows a plot of

Figure 3 .
Figure 3. Rank ordering statistics as a function of shuffle number for manually (blue) and auto (red) shuffled cards.Values within about ±1 standard deviation of the expected value 0 can be taken to indicate a randomly ordered deck.


, the serial correlation coefficient lag-k is defined by[36]

Figure 4 .
Figure 4. Serial correlation lag-1 as a function of shuffle number for manually (blue) and auto (red) shuffled cards.Values within about ±1 standard deviation of the expected value 0 can be taken to indicate a randomly ordered deck.
number of rising sequences after an infinite number of riffle shuffles ( )

Figure 5 .
Figure 5. Mean number of rising sequences for manual (blue) and auto (burgundy) shuffling as a function of shuffle number.Superposed is the theoretical (red) mean and uncertainty (±1 standard deviation) predicted for the GSR model of the riffle shuffle.
the observed numbers obtained by manually and auto shuffled cards averaged over the N data sets.Several features are to be noted: • In contrast to the statistical behavior graphically displayed in preceding figures which showed gradual randomization with increasing shuffle number m, the mean number of rising sequences underwent a relatively abrupt transition from a non-random state to the asymptotically random state at a threshold shuffle number m = 7 or 8 for manual shuffles and m = 11 or 12 for auto shuffles.

Figure 7 .
Figure 7. Probability distribution (solid black curve with circle markers) of number of rising sequences in shuffle m = 10 of a 52 card deck.Superposed is a Gaussian distribution (dashed red curve) of asymptotic mean 26.5 and standard deviation 2.10.

Figure 8 .
Figure 8. Shannon Entropy (in bits) of the card sequences arising from m shuffles of an ordered deck of n cards for n = 14 (green), 26 (blue), 52 (red).The entropy function is discrete; connecting lines serve only to facilitate visualization.
completeness relation.The entropy (mean uncertainty) in receipt of n transmitted symbols { }

Figure 9 .
Figure 9. Schematic of procedure for transformation of digital sequence { } i x into bi-

Figure 9
Figure 9 illustrates the significance of the four symbols: Panel A: 1 2 c = + signifies that a 1 follows a 1. Panel B: 1 2 c = − signifies that a 0 follows a 1. Panel C: 1 c = signifies that a 1 follows a 0. Panel D: 0 c = signifies that a 0 follows a 0. Given the set { } k c , the following four pair-association statistics ( ) ( ) 2 0 1

Figure 12 .
Figure 12.Total entropy (blue) in bits of "prediction" events as a function of number of shuffles.Information (red) in bits-multiplied by 10 for visibility-due to knowledge of preceding "message" events.The black double arrow marks the sample standard deviation of ( ) 0.014 10 ≈ × for the 12 th shuffle.The entire information curve lies within ±1 standard deviation, signifying that uncertainty of card pairs was not significantly reduced by knowledge of preceding pairs.
ing sequences-for which a theoretical distribution function pertaining to a particular shuffle model is known.The probability function of this distribution, Equation (60), is based on the GSR model of riffle shuffling.Although there are many references in the statistical literature and on the internet to the theory of riffle shuffling (such as those cited in the References to this paper), the author knows of no previously published experimental test with actual cards, rather than simulations by computer.In this regard, the nearly exact match of the theoretically predicted and experimentally measured mean number of rising sequences shown in Figure5for manually shuffled cards provides an experimental confirmation of the distribution (60) and therefore evidence in support of the GSR model as a satisfactory description of how humans actually perform riffle

Table 1 .
Card sequences after 19 riffle shuffles of an initially ordered deck.

Table 2
summarizes the relevant statistics of rising sequences based on the GSR model as a function of shuffle number m for a deck of 52 cards.It is seen that about 13 shuffles are required to achieve the asymptotic result of Equation (56).In Figure5the theoretically predicted mean number of rising sequences

Table 2 .
Statistics of Rising Sequences in a deck of 52 cards.

Table 3 .
Mean pair association numbers for a 52-Card Deck.

Table 4 .
Entropy and Information of Auto-Shuffled 52-Card Deck.

Table 5 .
Number of shuffles to achieve satisfactory mixing.