Starting with three cards
Take three cards, say the ace, king and queen of spades, and ask how many different orders they can be placed in. The top position can hold any of the 3 cards. Once that is chosen, the middle position can hold either of the 2 that remain, and the bottom position gets the last card. By the multiplication principle the total is
3 × 2 × 1 = 6.
You can list them: AKQ, AQK, KAQ, KQA, QAK, QKA. Six orders, no repeats, none missing.
The definition
For a whole number n, the factorial n! is the product of every whole number from n down to 1:
n! = n × (n − 1) × (n − 2) × … × 2 × 1.
It counts the ways to put n distinct things in a row. A few values:
| n | n! |
|---|---|
| 1 | 1 |
| 2 | 2 |
| 3 | 6 |
| 4 | 24 |
| 5 | 120 |
| 6 | 720 |
| 10 | 3,628,800 |
Each step multiplies by a bigger number than the one before, which is why the table speeds up. Going from 5! to 6! multiplies by 6; from 9! to 10! multiplies by 10. A handy relationship: n! = n × (n − 1)!.
The value 0! is defined to be 1. There is exactly one way to arrange nothing, and defining it this way keeps formulas for combinations and permutations working in the edge cases.
Applying it to a full deck
A standard deck has 52 different cards. Arrange them in a row: 52 choices for the top card, 51 for the next, 50 for the next, and so on down to 1 for the last. The number of possible orders is
52! = 52 × 51 × 50 × … × 2 × 1.
Written out, this is approximately 8.07 × 10⁶⁷, a number with 68 digits. Nobody computes it by hand, but you can estimate its size by checking how it grows:
- 10! is about 3.6 million (7 digits)
- 13! is 6,227,020,800 (10 digits), already in the billions
- 20! is 2,432,902,008,176,640,000, about 2.4 × 10¹⁸
- 52! is about 8.07 × 10⁶⁷
So going from 20 cards to 52 cards turns a number with 19 digits into one with 68.
Why a shuffled deck is almost certainly new
If a deck is shuffled well enough that every ordering is about equally likely, then the chance of any specific ordering is 1 in 52!. Even if a very large number of shuffles has been performed across history, that is a minuscule fraction of 52!. So it is almost certain that a thoroughly shuffled deck is in an order that has never occurred before and will probably never occur again. “Almost certain” is the right phrase: it is a statement about probability, not a guarantee, and it assumes a good shuffle. Real hand shuffles in casual play are often not thorough, which is a separate matter from the counting.
This is also why a properly randomised shuffle in software needs care. A random number generator that starts from a small seed can produce only a limited number of different sequences. For example, a 32-bit seed allows at most 2³² = 4,294,967,296 starting points, which is a tiny share of 52!. The method itself matters too, as covered in the discussion of the Fisher-Yates shuffle, and the quality of the underlying source is discussed under pseudo-random generators.
Factorials inside other counts
Factorials rarely appear alone. Often you divide by them to remove orderings you do not care about.
Hands of cards. Dealing 5 cards in order from 52 gives 52 × 51 × 50 × 49 × 48 = 311,875,200 sequences. Since the order within a hand is irrelevant, divide by 5! = 120, giving 2,598,960 distinct hands. Working that out in detail belongs to the neighbouring article on five card hands.
Repeated items. If some objects are identical, orderings that only swap identical objects are not different. The word “ABBA” uses 2 A’s and 2 B’s, so its letters can be arranged in 4! ÷ (2! × 2!) = 24 ÷ 4 = 6 distinct ways: AABB, ABAB, ABBA, BAAB, BABA, BBAA.
Partial arrangements. Choosing and ordering only the top 3 cards from a deck gives 52 × 51 × 50 = 132,600, which can be written 52! ÷ 49!. The long tail of the factorial cancels, which is why you almost never need to calculate 52! itself. The difference between ordered and unordered selection is the subject of permutations versus combinations, and it ties into the wider family of counting principles.
A common misunderstanding
A very large number of orderings does not mean outcomes are “due”. If you shuffle a deck and then deal, the result of one shuffle gives no information about the next, and a run of one colour in a deal does not make the opposite colour more likely to come next in a fresh shuffle. People sometimes cite the gambler’s fallacy in exactly this situation. Counting orderings tells you how many arrangements exist; it does not change the chance of any outcome in a fair, independent shuffle.
Card games involving money carry a built-in disadvantage for the player in many casino formats, and gambling can be harmful. If you or someone you know is struggling, a local support service can help.