# Riffle Shuffle

A Riffle Shuffle (known in the USA as a Faro shuffle) is a card shuffle in which the pack of cards is divided into two roughly equal piles, and cards from the two piles are then dropped alternately from the two piles to create an interleaved pack. This form of shuffle is used by serious players in most card games as it is one of the fastest and most effective ways of mixing up - and ultimately randomising - a pack.

The mathematics of riffle-shuffling is of interest to both mathematicians and magicians, because it can generate suprising patterns, and has connections with modular arithmetic and randomness. Of particular interest is the 'perfect' riffle shuffle, in which the pack of cards is divided exactly in half (for a normal pack this means two piles of 26 cards) and the cards are then interleaved alternately from the two piles. There are two types of perfect shuffle:

• Out-shuffle. In this shuffle, the card originally on the bottom of the pack is released first while the original top card is released last, so in the shuffled pack the top and bottom cards are unchanged. If the original order of the pack was 1 2 3 4 5 6.....51 52, the shuffled pack order becomes 1 27 2 28 3 29 ....51 26 52.
• In-shuffle. In this shuffle, the card originally on the bottom of the pack is released second and in the shuffled pack the top and bottom cards are those originally in positions 27 and 26 respectively. The shuffled pack order becomes 27 1 28 2 29 3 30 .... 25 52 26.
If a card starts in position n in the pack, it is sent to position 2n-1 (modulo 51) in an out-shuffle and position 2n (modulo 53) in an in-shuffle.

Thanks to work by Persi Diaconis and others, it is now understood that seven almost perfect riffle shuffles are enough to effectively randomise a pack. However, somewhat confusingly, eight perfect out-shuffles will restore a pack precisely to its original order.