Shuffle a deck of cards. The order you just created has almost certainly never existed before in the history of the universe — and almost certainly never will again. That is not a magic trick. It is a factorial.
Factorials look like a notation joke — an exclamation mark doing math — but they are the counting engine behind permutations, combinations, probability, and half of statistics. And they contain two of the best "wait, what?" moments in school math: 0! = 1, and 52! ≈ 8.066 × 10^67.
What a factorial actually is
The factorial of a whole number n, written n!, is the product of every positive integer from 1 up to n:
n! = n × (n − 1) × (n − 2) × … × 2 × 1
So 5! = 5 × 4 × 3 × 2 × 1 = 120. Four factorial is 4 × 3 × 2 × 1 = 24. Three factorial is 6, two factorial is 2, and one factorial is 1.
The idea behind the definition is counting arrangements. If you have 5 different books and 5 slots on a shelf, you have 5 choices for the first slot, 4 for the second, 3 for the third, 2 for the fourth, and 1 for the last. Multiply the choices: 5 × 4 × 3 × 2 × 1 = 120 different orders.
Why 0! = 1 (the proof that actually convinces people)
Zero factorial is the one that breaks brains. How can multiplying nothing give 1? There are three proofs, and the third one is the one that ends the argument.
Proof 1: the staircase. Write the factorials in a column and divide your way down: 4! = 24, 3! = 24 ÷ 4 = 6, 2! = 6 ÷ 3 = 2, 1! = 2 ÷ 2 = 1. Each step divides by the number you just left behind. The next step down is 0! = 1! ÷ 1 = 1. The pattern has nowhere else to go — and one more step would divide by zero, which is exactly why (−1)! has no value.
Proof 2: the counting argument. n! counts the ways to arrange n things. How many ways are there to arrange zero things? Exactly one — the empty arrangement. There is one way to do nothing. So 0! = 1.
Proof 3: the empty product. Multiplying a list of numbers starts from 1, the multiplicative identity — the number that changes nothing. Multiplying no numbers at all leaves you with 1, just as adding no numbers gives 0. This is the same reason 2^0 = 1. And the formulas demand it: the number of ways to choose all 3 items from 3 is 3! ÷ (3! × 0!), which only gives the correct answer of 1 if 0! = 1.
Factorial expressions: cancel before you compute
The most useful factorial skill is simplifying expressions like n!/(n−k)! without expanding everything. The trick is to stop expanding as soon as the terms cancel.
Take 6!/(6−3)! = 6!/3!. Expand only the top until it meets the bottom:
6! / 3! = (6 × 5 × 4 × 3 × 2 × 1) / (3 × 2 × 1) = 6 × 5 × 4 = 120
The 3 × 2 × 1 cancels entirely. That cancellation is not a shortcut — it is the permutation formula. 6!/(6−3)! counts the ways to arrange 3 items chosen from 6, in order: 6 choices, then 5, then 4. The factorial expression is just the counting argument written compactly.
The same move handles 7!/4! = 7 × 6 × 5 = 210, and 8!/5! = 8 × 7 × 6 = 336. Never expand a factorial fully when a smaller factorial sits in the denominator — expand down to it, cancel, and multiply what's left.
Permutations vs combinations: order is the whole difference
Factorials power two formulas students constantly mix up, and the difference is one question: does order matter?
Permutations (nPr) — order matters. The number of ways to arrange k items chosen from n, where the order counts:
nPr = n! / (n − k)!
For 10P3: 10! / 7! = 10 × 9 × 8 = 720. This is a race: 10 runners, 3 medal positions — gold, silver, bronze in that order — gives 720 possible podiums.
Combinations (nCr) — order does not matter. The number of ways to choose k items from n, where the order does not count:
nCr = n! / (k! × (n − k)!)
For 10C3: 10! / (3! × 7!) = (10 × 9 × 8) / (3 × 2 × 1) = 720 / 6 = 120. This is a team: 10 employees, pick any 3 for a project — the same 3 people in a different order is the same team, so you divide by 3! = 6 to remove the duplicate orderings.
Notice the relationship: 10P3 = 720 is exactly 6 times 10C3 = 120, and 6 is 3! — the number of ways to order the 3 chosen items. If you can remember that one sentence, you will never pick the wrong formula again.
The 52! shock — and the comparison that is actually true
Now the big one. A standard deck has 52 cards, and the number of possible orders is 52! = 52 × 51 × 50 × … × 1 ≈ 8.066 × 10^67. That is an 8 followed by 67 zeros.
You will sometimes hear that 52! is "more than the atoms in the observable universe." It is not — the atom count is roughly 10^80, about a trillion times larger. The honest comparison is even more startling in a different direction: the universe is about 13.8 billion years old, which is roughly 4.35 × 10^17 seconds since the Big Bang. 52! is about 1.85 × 10^50 times the number of seconds that have ever existed. If you had shuffled a deck once every second since the beginning of time, you would not have scratched the surface of the possible orders.
Check it with code
The whole topic in one Python block:
from math import factorial, perm, comb
print(factorial(5)) # 120
print(factorial(0)) # 1 — the empty product
print(factorial(6) // factorial(3)) # 120 — the 6!/(6-3)! cancellation
print(perm(10, 3)) # 720 — order matters
print(comb(10, 3)) # 120 — order does not matter
print(f"{factorial(52):.3e}") # 8.066e+67
The perm and comb functions are worth memorizing: perm(n, k) is n!/(n−k)!, comb(n, k) is n!/(k!(n−k)!), and the only difference between them is the division by k!.
A quick drill
- 7! = 7 × 6 × 5 × 4 × 3 × 2 × 1 = 5,040.
- 8!/5! = 8 × 7 × 6 = 336 (cancel, don't expand).
- 8P2 = 8 × 7 = 56; 8C2 = 56 / 2 = 28.
- 4 people, 4 chairs: 4! = 24 seating orders.
Want the steps shown instead of just the answers? A free factorial calculator handles all four modes — single factorials, factorial expressions, permutations, and combinations — with the full working displayed. If the 0! result still feels wrong, its why is 0 factorial 1 explainer walks through the staircase proof and the empty product, and the permutations mode flags the order-matters check that separates 10P3 = 720 from 10C3 = 120. Once the habit is automatic, this free factorial calculator becomes a 10-second check on your own arithmetic — not a crutch.
One symbol, three ideas: factorials count arrangements, 0! = 1 keeps the counting consistent, and permutations and combinations are the same formula with order switched on or off. Master that, and the exclamation mark stops looking like a joke — it starts looking like the most honest symbol in math.
Top comments (0)