*** Welcome to piglix ***

Gilbreath permutation


A Gilbreath shuffle is a way to shuffle a deck of cards, named after mathematician Norman L. Gilbreath (also known for Gilbreath's conjecture). Gilbreath's principle describes the properties of a deck that are preserved by this type of shuffle, and a Gilbreath permutation is a permutation that can be formed by a Gilbreath shuffle.

A Gilbreath shuffle consists of the following two steps:

It differs from the more commonly used procedure of cutting a deck into two piles and then riffling the piles, in that the first step of dealing off cards reverses the order of the cards in the new pile, whereas cutting the deck would preserve this order.

Although seemingly highly random, Gilbreath shuffles preserve many properties of the initial deck. For instance, if the initial deck of cards alternates between black and red cards, then after a single Gilbreath shuffle the deck will still have the property that, if it is grouped into consecutive pairs of cards, each pair will have one black card and one red card. Similarly, if a deck of cards is initially arranged so that every card has the same suit as the card four positions earlier, it is given a Gilbreath shuffle, and the resulting deck is grouped into consecutive sets of four cards, then each set will have one card of each suit. This phenomenon is known as Gilbreath's principle and is the basis for several card tricks.

Mathematically, Gilbreath shuffles can be described by Gilbreath permutations, permutations of the numbers from 1 to n that can be obtained by a Gilbreath shuffle with a deck of cards labeled with these numbers in order. Gilbreath permutations can be characterized by the property that every prefix contains a consecutive set of numbers. For instance, the permutation (5,6,4,7,8,3,2,9,1,10) is a Gilbreath permutation for n = 10 that can be obtained by dealing off the first four or five cards and riffling them with the rest. Each of its prefixes (5), (5,6), (5,6,4), (5,6,4,7), etc. contain a set of numbers that (when sorted) form a consecutive subsequence of the numbers from 1 to 10. Equivalently, in terms of permutation patterns, the Gilbreath permutations are the permutations that avoid the two patterns 132 and 312.

A Gilbreath shuffle may be uniquely determined by specifying which of the positions in the resulting shuffled deck are occupied by cards that were dealt off into the second pile, and which positions are occupied by cards that were not dealt off. Therefore, there are 2n possible ways of performing a Gilbreath shuffle on a deck of n cards. However, each Gilbreath permutation may be obtained from two different Gilbreath shuffles (the first position of the permutation may have come from either of the two piles) so there are 2n − 1 distinct Gilbreath permutations.


...
Wikipedia

...