In the mathematics of permutations and the study of shuffling playing cards, a riffle shuffle permutation is a permutation of a set of ordered items that can be obtained by a single riffle shuffle, in which a sorted deck of 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 -shuffle, for numbers and with , is a riffle in which the first packet has cards and the second packet has cards. [1]
Considering a permutation as a bijective function from the set to itself, a riffle shuffle is defined as containing only 1 or 2 maximal rising sequences, meaning can be decomposed into two disjoint subsets and with
and . [2]
A permutation with only 1 maximal rising sequence is the identity permutation.
The inverse permutation of a riffle shuffle is known as Grassmannian permutation, defined by
having one descent , 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]
Since a -shuffle is completely determined by how its first elements are mapped, the number of -shuffles is
However, the number of distinct riffles is not quite the sum of this formula over all choices of and adding to (which would be ), because the identity permutation can be represented in multiple ways as a -shuffle for different values of and . Instead, the number of distinct riffle shuffle permutations of a deck of cards, for , is
More generally, the formula for this number is ; for instance, there are 4503599627370444 riffle shuffle permutations of a 52-card deck.
The number of bigrassmannian permutations is [4] For , this is
and for there are exactly 23427 bigrassmannian shuffles.
The Gilbert–Shannon–Reeds model describes a random probability distribution on riffle shuffles that is a good match for observed human shuffles. [5] In this model, the identity permutation has probability of being generated, and all other riffle permutations have equal probability of being generated. Based on their analysis of this model, mathematicians have recommended that a deck of 52 cards be given seven riffles in order to thoroughly randomize it. [6]
A pattern in a permutation is a smaller permutation formed from a subsequence of some values in the permutation by reducing these values to the range from 1 to while preserving their order. Several important families of permutations can be characterized by a finite set of forbidden patterns, and this is true also of the riffle shuffle permutations: they are exactly the permutations that do not have 321, 2143, and 2413 as patterns. [4] Thus, for instance, they are a subclass of the vexillary permutations, which have 2143 as their only minimal forbidden pattern. [7]
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. [8]
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 -form and a -form can be defined as a sum over -shuffles. [1]