Riffle shuffle permutation

From HandWiki
Short description: Ordering obtained by a single shuffle

In the mathematics of permutations and the study of shuffling playing cards, a riffle shuffle permutation is a permutation of a set of n ordered items that can be obtained by a single riffle shuffle, in which a sorted deck of n cards (increasing top-to-bottom) is cut into two packets and then the two packets are interleaved (e.g. by moving cards one at a time from the bottom of one or the other of the packets to the top of the sorted deck). As a special case of this, a (p,q)-shuffle, for numbers p and q with p+q=n, is a riffle in which the first packet has p cards and the second packet has q cards.[1]

Considering a permutation as a bijective function

π

from the set

{1,2,,n}

to itself, a riffle shuffle is defined as containing only 1 or 2 maximal rising sequences, meaning

{1,2,,n}

can be decomposed into two disjoint subsets

{i1<<ip}

and

{j1<<jq}

with

π(i1)<π(i2)<<π(ip)

and

π(j1)<π(j2)<<π(jq)

.[2]

A permutation with only 1 maximal rising sequence is the identity permutation.

The inverse permutation

τ=π1

of a riffle shuffle is known as Grassmannian permutation, defined by

τ(1)<<τ(p)   and   τ(p+1)<<τ(p+q),

having one descent

τ(p)>τ(p+1)

, or zero descents if

τ

is the identity. In Schubert calculus, these index Schubert varieties in a Grassmannian space.

A permutation π which is both a riffle shuffle and Grassmannian (i.e. both π and its inverse are Grassmannian, or equivalently both are riffle shuffles), is called bigrassmannian or an invertible shuffle.[3]

Combinatorial enumeration

Since a (p,q)-shuffle is completely determined by how its first p elements are mapped, the number of (p,q)-shuffles is (p+qp).

However, the number of distinct riffles is not quite the sum of this formula over all choices of p and q adding to n (which would be 2n), because the identity permutation can be represented in multiple ways as a (p,q)-shuffle for different values of p and q. Instead, the number of distinct riffle shuffle permutations of a deck of n cards, for n=1,2,3,, is

1, 2, 5, 12, 27, 58, 121, 248, 503, 1014, ... (sequence A000325 in the OEIS)

More generally, the formula for this number is 2nn; for instance, there are 4503599627370444 riffle shuffle permutations of a 52-card deck.

The number of bigrassmannian permutations is[4] (n+13)+1. For n=1,2,3,, this is

1, 2, 5, 11, 21, 36, 57, 85, 121, 166, 221, ... (sequence A050407 in the OEIS)

and for n=52 there are exactly 23427 bigrassmannian shuffles.

Random distribution

The Gilbert–Shannon–Reeds model describes a random probability distribution on riffle shuffles that is a good match for observed human shuffles.Cite error: Closing </ref> missing for <ref> tag

Perfect shuffles

A perfect shuffle is a riffle in which the deck is split into two equal-sized packets, and in which the interleaving between these two packets strictly alternates between the two. There are two types of perfect shuffle, an in shuffle and an out shuffle, both of which can be performed consistently by some well-trained people. When a deck is repeatedly shuffled using these permutation

the basis of several magic tricks.[5]

Algebra

Riffle shuffles may be used to define the shuffle algebra. This is a Hopf algebra where the basis is a set of words, and the product is the shuffle product denoted by the sha symbol ш, the sum of all riffle shuffles of two words.

In exterior algebra, the wedge product of a p-form and a q-form can be defined as a sum over (p,q)-shuffles.[1]

See also

  • Gilbreath permutations, the permutations formed by reversing one of the two packets of cards before riffling them

References

  1. 1.0 1.1 Weibel, Charles (1994). An Introduction to Homological Algebra, p. 181. Cambridge University Press, Cambridge.
  2. "Shuffling cards and stopping times", The American Mathematical Monthly 93 (5): 333–348, 1986, doi:10.2307/2323590, https://statweb.stanford.edu/~cgates/PERSI/papers/aldous86.pdf 
  3. Lascoux, Alain; Schützenberger, Marcel-Paul (1996-02-01). "Treillis et bases des groupes de Coxeter". The Electronic Journal of Combinatorics 3 (2). doi:10.37236/1285. ISSN 1077-8926. https://doi.org/10.37236/1285. 
  4. "Restricted permutations", Discrete Mathematics 195 (1–3): 27–38, 1999, doi:10.1016/S0012-365X(98)00162-9 .
  5. "The mathematics of perfect shuffles", Advances in Applied Mathematics 4 (2): 175–196, 1983, doi:10.1016/0196-8858(83)90009-X .