Shuffling is a procedure used to
randomize Randomization is the process of making something random. Randomization is not haphazard; instead, a random process is a sequence of random variables describing a process whose outcomes do not follow a deterministic pattern, but follow an evolution d ...
a deck of
playing card
A playing card is a piece of specially prepared card stock, heavy paper, thin cardboard, plastic-coated paper, cotton-paper blend, or thin plastic that is marked with distinguishing motifs. Often the front (face) and back of each card has a fi ...
s to provide an element of chance in
card game
A card game is any game using playing cards as the primary device with which the game is played, be they traditional or game-specific.
Countless card games exist, including families of related games (such as poker). A small number of card ...
s. Shuffling is often followed by a
cut
Cut may refer to:
Common uses
* The act of cutting, the separation of an object into two through acutely-directed force
** A type of wound
** Cut (archaeology), a hole dug in the past
** Cut (clothing), the style or shape of a garment
** Cut (ea ...
, to help ensure that the shuffler has not manipulated the outcome.
__TOC__
Techniques
Overhand
One of the easiest shuffles to accomplish after a little practice is the overhand shuffle. Johan Jonasson wrote, "The overhand shuffle... is the shuffling technique where you gradually transfer the deck from, say, your right hand to your left hand by sliding off small packets from the top of the deck with your thumb." In detail as normally performed, with the pack initially held in the left hand (say), most of the cards are grasped as a group from the bottom of the pack between the thumb and fingers of the right hand and lifted clear of the small group that remains in the left hand. Small packets are then released from the right hand a packet at a time so that they drop on the top of the pack accumulating in the left hand. The process is repeated several times. The randomness of the whole shuffle is increased by the number of small packets in each shuffle and the number of repeat shuffles performed.
The overhand shuffle offers sufficient opportunity for sleight of hand techniques to be used to affect the ordering of cards, creating a stacked deck. The most common way that players cheat with the overhand shuffle is by having a card at the top or bottom of the pack that they require, and then slipping it to the bottom at the start of a shuffle (if it was on top to start), or leaving it as the last card in a shuffle and just dropping it on top (if it was originally on the bottom of the deck).
Riffle
A common shuffling technique is called the ''riffle,'' or ''dovetail'' shuffle or ''leafing the cards'', in which half of the deck is held in each hand with the thumbs inward, then cards are released by the thumbs so that they fall to the table interleaved. Many also lift the cards up after a riffle, forming what is called a bridge which puts the cards back into place; it can also be done by placing the halves flat on the table with their rear corners touching, then lifting the back edges with the thumbs while pushing the halves together. While this method is more difficult, it is often used in
casino
A casino is a facility for certain types of gambling. Casinos are often built near or combined with hotels, resorts, restaurants, retail shopping, cruise ships, and other tourist attractions. Some casinos are also known for hosting live entertai ...
s because it minimizes the risk of exposing cards during the shuffle. There are two types of perfect riffle shuffles: if the top card moves to be second from the top then it is an
in shuffle
The faro shuffle (American), weave shuffle (British), or dovetail shuffle is a method of shuffling playing cards, in which half of the deck is held in each hand with the thumbs inward, then cards are released by the thumbs so that they fall to th ...
, otherwise it is known as an
out shuffle
The faro shuffle (American), weave shuffle (British), or dovetail shuffle is a method of shuffling playing cards, in which half of the deck is held in each hand with the thumbs inward, then cards are released by the thumbs so that they fall to th ...
(which preserves both the top and bottom cards).
The
Gilbert–Shannon–Reeds model In the mathematics of shuffling playing cards, the Gilbert–Shannon–Reeds model is a probability distribution on riffle shuffle permutations that has been reported to be a good match for experimentally observed outcomes of human shuffling, and th ...
provides a mathematical model of the random outcomes of riffling that has been shown experimentally to be a good fit to human shuffling and that forms the basis for a recommendation that card decks be riffled seven times in order to randomize them thoroughly. Later, mathematicians
Lloyd M. Trefethen
Lloyd MacGregor Trefethen (March 15, 1919 – November 6, 2001) was an American expert in fluid dynamics known for his invention of the heat pipe and his research on the Coriolis effect and card shuffling. He worked for many years as a professor ...
and
Lloyd N. Trefethen
Lloyd Nicholas Trefethen (born 30 August 1955) is an American mathematician, professor of numerical analysis and head of the Numerical Analysis Group at the Mathematical Institute, University of Oxford.
Education
Trefethen was born 30 August 19 ...
authored a paper using a tweaked version of the Gilbert–Shannon–Reeds model showing that the minimum number of riffles for total randomization could also be six, if the method of defining randomness is changed.
Hindu
Also known as the "Indian", "Kattar", "Kenchi" (
Hindi
Hindi (Devanāgarī: or , ), or more precisely Modern Standard Hindi (Devanagari: ), is an Indo-Aryan language spoken chiefly in the Hindi Belt region encompassing parts of northern, central, eastern, and western India. Hindi has been de ...
for scissor) or "Kutti Shuffle". The deck is held face down, with the middle finger on one long edge and the thumb on the other on the bottom half of the deck. The other hand draws off a packet from the top of the deck. This packet is allowed to drop into the palm. The maneuver is repeated over and over, with newly drawn packets dropping onto previous ones, until the deck is all in the second hand. Indian shuffle differs from stripping in that all the action is in the hand ''taking'' the cards, whereas in stripping, the action is performed by the hand with the original deck, ''giving'' the cards to the resulting pile. This is the most common shuffling technique in Asia and other parts of the world, while the overhand shuffle is primarily used in Western countries.
Pile
Cards are simply dealt out into a number of piles, then the piles are stacked on top of each other. Though this is deterministic and does not randomize the cards at all, it ensures that cards that were next to each other are now separated. Some variations on the pile shuffle attempt to make it slightly random by dealing to the piles in a random order each circuit.
Corgi
Also known as the Chemmy, Irish, wash, scramble, beginner shuffle, smooshing, schwirsheling, or washing the cards, this involves simply spreading the cards out face down, and sliding them around and over each other with one's hands. Then the cards are moved into one pile so that they begin to intertwine and are then arranged back into a stack. This method is useful for beginners, but the shuffle requires a large surface for spreading out the cards. Statistically random shuffling is achieved after approximately one minute of smoothing. Smooshing has been largely popularized by Simon Hofman.
Mongean
The Mongean shuffle, or Monge's shuffle, is performed as follows (by a right-handed person): Start with the unshuffled deck in the left hand and transfer the top card to the right. Then repeatedly take the top card from the left hand and transfer it to the right, putting the second card at the top of the new deck, the third at the bottom, the fourth at the top, the fifth at the bottom, etc. The result, if one started with cards numbered consecutively
, would be a deck with the cards in the following order:
.
For a deck of given size, the number of Mongean shuffles that it takes to return a deck to starting position, is known . Twelve perfect Mongean shuffles restore a 52-card deck.
Faro
Weaving is the procedure of pushing the ends of two halves of a deck against each other in such a way that they naturally intertwine. Sometimes the deck is split into equal halves of 26 cards which are then pushed together in a certain way so as to make them perfectly interweave. This is known as a ''Faro Shuffle''.
The
faro shuffle
The faro shuffle (American), weave shuffle (British), or dovetail shuffle is a method of shuffling playing cards, in which half of the deck is held in each hand with the thumbs inward, then cards are released by the thumbs so that they fall to the ...
is performed by cutting the deck into two, preferably equal, packs in both hands as follows (right-handed):
The cards are held from above in the right and from below in the left hand. Separation of the deck is done simply lifting up half the cards with the right hand thumb slightly and pushing the left hand's packet forward away from the right hand. The two packets are often crossed and slammed into each other as to align them. They are then pushed together by the short sides and bent (either up or down). The cards then alternately fall into each other, much like a
zipper
A zipper, zip, fly, or zip fastener, formerly known as a clasp locker, is a commonly used device for binding together two edges of textile, fabric or other flexible material. Used in clothing (e.g. jackets and jeans), luggage and other Bag, ba ...
. A flourish can be added by springing the packets together by applying pressure and bending them from above, as called the bridge finish. The faro is a controlled shuffle which does not randomize a deck when performed properly.
A perfect faro shuffle, where the cards are perfectly alternated, is considered one of the most difficult sleights by card magicians, simply because it requires the shuffler to be able to cut the deck into two equal packets and apply just the right amount of pressure when pushing the cards into each other. Performing eight perfect faro shuffles in a row restores the order of the deck to the original order only if there are 52 cards in the deck and if the original top and bottom cards remain in their positions (1st and 52nd) during the eight shuffles. If the top and bottom cards are weaved in during each shuffle, it takes 52 shuffles to return the deck back into original order (or 26 shuffles to reverse the order).
Mexican spiral
The Mexican spiral shuffle is performed by cyclic actions of moving the top card onto the table, then the new top card under the deck, the next onto the table, next under the deck, and so on until the last card is dealt onto the table. It takes quite a long time, compared with riffle or overhand shuffles, but allows other players to fully control cards which are on the table. The Mexican spiral shuffle was popular at the end of the 19th century in some areas of
Mexico
Mexico (Spanish: México), officially the United Mexican States, is a country in the southern portion of North America. It is bordered to the north by the United States; to the south and west by the Pacific Ocean; to the southeast by Guatema ...
as a protection from gamblers and con men arriving from the United States.
Faking
Magicians
Magician or The Magician may refer to:
Performers
* A practitioner of magic (supernatural)
* A practitioner of magic (illusion)
* Magician (fantasy), a character in a fictional fantasy context
Entertainment
Books
* ''The Magician'', an 18th-ce ...
,
sleight-of-hand artists, and
card cheats employ various methods of shuffling whereby the deck appears to have been shuffled fairly, when in reality one or more cards (up to and including the entire deck) stays in the same position. It is also possible, though generally considered very difficult, to "stack the deck" (place cards into a desirable order) by means of one or more riffle shuffles; this is called "riffle stacking".
Both performance magicians and card sharps regard the
Zarrow shuffle Zarrow shuffle is a sleight of hand technique that gives the appearance of being a normal riffle shuffle, but in fact leaves the cards in exactly the same order. This is an example of a false shuffle. It was invented by magician Herb Zarrow c. 1 ...
and the Push-Through-False-Shuffle as particularly effective examples of the false shuffle. In these shuffles, the entire deck remains in its original order, although spectators think they see an honest riffle shuffle.
Machines
Casino
A casino is a facility for certain types of gambling. Casinos are often built near or combined with hotels, resorts, restaurants, retail shopping, cruise ships, and other tourist attractions. Some casinos are also known for hosting live entertai ...
s often equip their tables with
shuffling machine
A shuffling machine is a machine for randomly shuffling packs of playing cards.
Because standard shuffling techniques are seen as weak, and in order to avoid "inside jobs" where employees collaborate with gamblers by performing inadequate shuff ...
s instead of having
croupier
A croupier or dealer is someone appointed at a gambling table to assist in the conduct of the game, especially in the distribution of bets and payouts. Croupiers are typically employed by casinos.
Origin of the word
Originally a "croupier" meant ...
s shuffle the cards, as it gives the casino a few advantages, including an increased complexity to the shuffle and therefore an increased difficulty for players to make predictions, even if they are collaborating with croupiers. The shuffling machines are carefully designed to avoid biasing the shuffle and are typically computer-controlled. Shuffling machines also save time that would otherwise be wasted on manual shuffling, thereby increasing the profitability of the table. These machines are also used to lessen repetitive-motion-stress injuries to a dealer.
Players with superstitions often regard with suspicion any electronic equipment, so casinos sometimes still have the croupiers perform the shuffling at tables that typically attract those crowds (e.g.,
baccarat
Baccarat or baccara (; ) is a card game played at casinos. It is a comparing card game played between two hands, the "player" and the "banker". Each baccarat coup (round of play) has three possible outcomes: "player" (player has the higher score ...
tables).
Randomization
There are exactly 52
factorial
In mathematics, the factorial of a non-negative denoted is the product of all positive integers less than or equal The factorial also equals the product of n with the next smaller factorial:
\begin
n! &= n \times (n-1) \times (n-2) \t ...
(expressed in shorthand as 52
!) possible orderings of the cards in a
52-card deck
The standard 52-card deck of French-suited playing cards is the most common pack of playing cards used today. In English-speaking countries it is the only traditional pack used for playing cards; in many countries of the world, however, it is used ...
. In other words, there are 52 × 51 × 50 × 49 × ··· × 4 × 3 × 2 × 1 possible combinations of card sequence. This is approximately (80,658
vigintillion) possible orderings, or specifically 80,658,175,170,943,878,571,660,636,856,403,766,975,289,505,440,883,277,824,000,000,000,000. The
magnitude of this number means that it is exceedingly improbable that two randomly selected, truly randomized decks will be the same. However, while the exact sequence of all cards in a randomized deck is unpredictable, it may be possible to make some probabilistic predictions about a deck that is not sufficiently randomized.
Sufficiency
The number of shuffles that are sufficient for a "good" level of randomness depends on the type of shuffle and the measure of "good enough randomness", which in turn depends on the game in question. For most games, four to seven riffle shuffles are sufficient: for
unsuited games such as
blackjack
Blackjack (formerly Black Jack and Vingt-Un) is a casino banking game. The most widely played casino banking game in the world, it uses decks of 52 cards and descends from a global family of casino banking games known as Twenty-One. This fami ...
, four riffle shuffles are sufficient, while for suited games, seven riffle shuffles are necessary. There are some games, however, for which even seven riffle shuffles are insufficient.
In practice the number of shuffles required depends both on the quality of the shuffle and how significant non-randomness is, particularly how good the people playing are at noticing and using non-randomness. Two to four shuffles is good enough for casual play. But in club play, good
bridge
A bridge is a structure built to span a physical obstacle (such as a body of water, valley, road, or rail) without blocking the way underneath. It is constructed for the purpose of providing passage over the obstacle, which is usually somethi ...
players take advantage of non-randomness after four shuffles,
and top blackjack players supposedly track aces through the deck; this is known as "ace tracking", or more generally, as "
shuffle track
Shuffle tracking is an advantage gambling technique where a player tracks certain cards or sequences of cards through a series of shuffles. Shuffle tracking is typically done in blackjack games, although it can be done in other card games. Games wi ...
ing".
Research
Following early research at
Bell Labs
Nokia Bell Labs, originally named Bell Telephone Laboratories (1925–1984),
then AT&T Bell Laboratories (1984–1996)
and Bell Labs Innovations (1996–2007),
is an American industrial research and scientific development company owned by mult ...
, which was abandoned in 1955, the question of how many shuffles was required remained open until 1990, when it was convincingly solved as ''seven shuffles,'' as elaborated below.
Some results preceded this, and refinements have continued since.
A leading figure in the mathematics of shuffling is
mathematician
A mathematician is someone who uses an extensive knowledge of mathematics in their work, typically to solve mathematical problems.
Mathematicians are concerned with numbers, data, quantity, structure, space, models, and change.
History
On ...
and
magician Persi Diaconis
Persi Warren Diaconis (; born January 31, 1945) is an American mathematician of Greek descent and former professional magician. He is the Mary V. Sunseri Professor of Statistics and Mathematics at Stanford University.
He is particularly known f ...
, who began studying the question around 1970,
and has authored many papers in the 1980s, 1990s, and 2000s on the subject with numerous co-authors. Most famous is , co-authored with mathematician
Dave Bayer
David Allen Bayer (born November 29, 1955) is an American mathematician known for his contributions in algebra and symbolic computation and for his consulting work in the movie industry. He is a professor of mathematics at Barnard College, Columbi ...
, which analyzed the
Gilbert–Shannon–Reeds model In the mathematics of shuffling playing cards, the Gilbert–Shannon–Reeds model is a probability distribution on riffle shuffle permutations that has been reported to be a good match for experimentally observed outcomes of human shuffling, and th ...
of random riffle shuffling and concluded that the deck did not start to become random until five good riffle shuffles, and was truly random after seven, in the precise sense of
variation distance described in
Markov chain mixing time In probability theory, the mixing time of a Markov chain is the time until the Markov chain is "close" to its steady state distribution.
More precisely, a fundamental result about Markov chains is that a finite state irreducible aperiodic chain has ...
; of course, you would need more shuffles if your shuffling technique is poor.
Recently, the work of Trefethen et al. has questioned some of Diaconis' results, concluding that six shuffles are enough. The difference hinges on how each measured the randomness of the deck. Diaconis used a very sensitive test of randomness, and therefore needed to shuffle more. Even more sensitive measures exist, and the question of what measure is best for specific card games is still open. Diaconis released a response indicating that you only need four shuffles for un-suited games such as
blackjack
Blackjack (formerly Black Jack and Vingt-Un) is a casino banking game. The most widely played casino banking game in the world, it uses decks of 52 cards and descends from a global family of casino banking games known as Twenty-One. This fami ...
.
On the other hand, variation distance may be too forgiving a measure and seven riffle shuffles may be many too few. For example, seven shuffles of a new deck leaves an 81% probability of winning
New Age Solitaire
New is an adjective referring to something recently made, discovered, or created.
New or NEW may refer to:
Music
* New, singer of K-pop group The Boyz
Albums and EPs
* ''New'' (album), by Paul McCartney, 2013
* ''New'' (EP), by Regurgitator ...
where the probability is 50% with a uniform random deck.
One sensitive test for randomness uses a standard deck without the
jokers divided into suits with two suits in ascending order from ace to king, and the other two suits in reverse. (Many decks already come ordered this way when new.) After shuffling, the measure of randomness is the number of rising sequences that are left in each suit.
Algorithms
If a computer has access to purely random numbers, it is capable of generating a "perfect shuffle", a
random permutation
A random permutation is a random ordering of a set of objects, that is, a permutation-valued random variable. The use of random permutations is often fundamental to fields that use randomized algorithms such as coding theory, cryptography, and sim ...
of the cards; beware that this terminology (an algorithm that perfectly randomizes the deck) differs from "a perfectly executed single shuffle", notably a perfectly interleaving
faro shuffle
The faro shuffle (American), weave shuffle (British), or dovetail shuffle is a method of shuffling playing cards, in which half of the deck is held in each hand with the thumbs inward, then cards are released by the thumbs so that they fall to the ...
. The
Fisher–Yates shuffle
The Fisher–Yates shuffle is an algorithm for generating a random permutation of a finite sequence—in plain terms, the algorithm shuffling, shuffles the sequence. The algorithm effectively puts all the elements into a hat; it continually deter ...
, popularized by
Donald Knuth
Donald Ervin Knuth ( ; born January 10, 1938) is an American computer scientist, mathematician, and professor emeritus at Stanford University. He is the 1974 recipient of the ACM Turing Award, informally considered the Nobel Prize of computer sc ...
, is simple (a few lines of code) and efficient (
O(''n'') on an ''n''-card deck, assuming constant time for fundamental steps) algorithm for doing this. Shuffling can be seen as the opposite of
sorting
Sorting refers to ordering data in an increasing or decreasing manner according to some linear relationship among the data items.
# ordering: arranging items in a sequence ordered by some criterion;
# categorizing: grouping items with similar pro ...
.
There are other, less-desirable algorithms in common use. For example, one can assign a random number to each card, and then sort the cards in order of their random numbers. This will generate a random permutation, unless any of the random numbers generated are the same as any others (i.e. pairs, triplets etc.). This can be eliminated either by adjusting one of the pair's values randomly up or down by a small amount, or reduced to an arbitrarily low probability by choosing a sufficiently wide range of random number choices. If using efficient sorting such as
mergesort
In computer science, merge sort (also commonly spelled as mergesort) is an efficient, general-purpose, and comparison-based sorting algorithm. Most implementations produce a stable sort, which means that the order of equal elements is the same i ...
or
heapsort
In computer science, heapsort is a comparison-based sorting algorithm. Heapsort can be thought of as an improved selection sort: like selection sort, heapsort divides its input into a sorted and an unsorted region, and it iteratively shrinks the ...
this is an
O(''n'' log ''n'') average and worst-case algorithm.
Online gambling
These issues are of considerable commercial importance in
online gambling
Online gambling is any kind of gambling conducted on the internet. This includes virtual poker, casinos and sports betting. The first online gambling venue opened to the general public was ticketing for the Liechtenstein International Lottery in ...
, where the randomness of the shuffling of packs of simulated cards for online card games is crucial. For this reason, many online gambling sites provide descriptions of their shuffling algorithms and the sources of randomness used to drive these algorithms, with some gambling sites also providing auditors' reports of the performance of their systems.
See also
*
Card manipulation
Card manipulation is the branch of magic that deals with creating effects using sleight of hand techniques involving playing cards. Card manipulation is often used in magical performances, especially in close-up, parlor, and street magic. Some ...
*
Mental poker
Mental poker is the common name for a set of cryptographic problems that concerns playing a fair game over distance without the need for a trusted third party. The term is also applied to the theories surrounding these problems and their possible ...
*
Solitaire (cipher)
The Solitaire cryptographic algorithm was designed by Bruce Schneier at the request of Neal Stephenson for use in his novel '' Cryptonomicon'', in which field agents use it to communicate securely without having to rely on electronics or having to ...
References
*
*
*
*
*
*
*
*
Footnotes
External links
Physical card shuffling:
Illustrated guide to several shuffling methodsMagician's tool with much shuffling simulationMathematics of shuffling:
Real World Shuffling In Practice*Ivars Peterson's MathTrek
Real world (historical) application:
How We Learned to Cheat at Online Poker: A Study in Software Security
{{Non trick-taking card games
Card game terminology
Card shuffling