How many ways can a deck of cards be arranged? It is very easy to calculate the answer, but very difficult to grasp its significance.
There are 52 cards. Thus, the first one may be chosen in 52 ways. The next one can be any of the remaining 51 cards. For the third, there are 50 choices, and so on until just one card remains, leaving only the option to put it last.
Therefore, the total number of possibilities is
This number is called factorial 52. To say that it is a large number is an understatement. The program Mathematica can compute to arbitrary precision and entering the command Factorial[52] yields the following result:
In more compressed notation, this is , or, to just a single figure of accuracy,
; that is, 1 followed by 68 zeros.
Describing 52!
It is difficult to illustrate the size of in terms of anything practical. People have talked about the number of drops in the ocean or how many grains of sand would fill the Grand Canyon. These numbers come nowhere close to
.
The number of atoms in the observable universe is estimated to be about , which is a trillion times bigger than
. But does this really help us to visualise what either of these numbers is like? The Wikipedia article on Names of Large Numbers describes
as an unvigintillion. Thus,
is about eighty unvigintillion. But this is just a name.
The Universe is seconds old. If a random arrangement of cards were chosen each second during the entire life of the Universe, only a tiny fraction of all possible orderings would be selected. The chance of the same ordering being chosen twice is utterly negligible. Even if a billion arrangements were chosen every second, there would still be no real chance of a duplicate.
For an amusing description of the astounding magnitude of , see http://czep.net/weblog/52cards.html
Stirling’s Approximation
The calculation of the number is simple. Just multiply 52 by 51, the result by 50 and so on until you reach 1. But how tedious this is, and how error-prone!
There is a beautiful expression giving an approximation to any factorial, named for James Stirling (1692–1770), a Scottish mathematician (although it seems that the result was stated earlier by Abraham de Moivre). The approximation is
This is actually the first term in an asymptotic expansion. Taking the next term we have
Plugging in the argument , the first formula gives
which is correct to 2 decimal places. The second formula gives
, with relative error of only one part in a million.
Another approximation was found among the papers of the Indian mathematician Srinivasa Ramanujan and published in his Lost Notebook in 1988:
This gives to one part in a billion.
Shuffling and Repeated Orders
With such a vast number of possibilities, one might ask if any randomly-chosen order of a deck of cards occurs more than once. Making very reasonable assumptions, it is easy to argue that a particular ordering will never occur twice during the life of the Universe. Thus, when you thoroughly mix up the cards, you are bound to arrive at an ordering that has never been seen before and will never be seen again.
However, there is a big proviso here. The shuffling of the cards must be sufficiently thorough to ensure true randomization. Mathematical studies have indicated that a small number of effective shuffles suffice to mix up the pack to random order. Bayer and Diaconis (1992) showed that after seven random riffle shuffles, any of the 52! possible configurations is equally probable.
Sources
• Bayer, Dave and Persi Diaconis, 1992: Trailing the dovetail shuffle to its lair. Ann. Appl. Prob., 2, 2, 294-313.
• Wikipedia article on Names of Large Numbers.
http://www.wikipedia.org/