The Impossible Shuffle

Home › The math behind the madness › 52 factorial

52 Factorial: How Big Is 52! Really?

Shuffle a deck of cards properly and you are almost certainly holding an order that no human has ever held before. The reason is one number: 52 factorial.

The short answer

52! = 52 × 51 × 50 × … × 3 × 2 × 1, which is

80,658,175,170,943,878,571,660,636,856,403,766,975,289,505,440,883,277,824,000,000,000,000

That's a 68-digit number, about 8.07 × 1067: the number of different orders a standard 52-card deck can be in.

Why 52 × 51 × 50 × …?

Lay the cards down one at a time. You have 52 choices for the first card, 51 for the second, 50 for the third, and so on, until a single card is left for the last spot. Multiply all those choices together and you get 52!, said "52 factorial".

It starts small and then gets out of hand very quickly:

CardsPossible orders
3 cards (A, B, C)6
4 cards24
10 cards3,628,800
13 cards (one suit)6,227,020,800
20 cards2,432,902,008,176,640,000
52 cards (a full deck)≈ 8.07 × 1067

With three cards you can write every order down: ABC, ACB, BAC, BCA, CAB, CBA. With 52 cards, you can't. Not today, not ever.

How to picture 52!

Numbers this big stop meaning anything, so here are a few ways to make 52! hurt a bit more:

  • More than the atoms on Earth. Earth is made of roughly 1.3 × 1050 atoms. 52! is about 600 quadrillion times bigger.
  • 226 coin flips. Guessing the exact order of a shuffled deck is about as likely as calling 226 coin flips in a row correctly.
  • The lottery, eight times. Winning the Powerball jackpot (1 in 292,201,338) eight times in a row is still about 1.5 times more likely than one shuffle matching a deck you chose in advance.
  • Seconds. 52! seconds is about 2.6 × 1060 years. The universe is 13.8 billion years old. Scott Czepiel turned this into a famous thought experiment (walk around the equator, one step every billion years…): read it here.
  • The fastest computers. A supercomputer doing 2 × 1018 operations per second, listing one deck per operation, would need about 1042 years to list them all.

Is 52! bigger than the number of atoms in the universe?

No, and this one gets mixed up a lot. The observable universe holds somewhere around 1078 to 1082 atoms, which is far more than 52! (about 1068). 52! beats the atoms on Earth by a mile, but not the whole universe. It's still the kind of number nobody will ever count to.

What if everyone on Earth shuffled?

Say all 8 billion people shuffled a deck once a second, starting at the Big Bang. By now that's about 3.5 × 1027 shuffles, which covers roughly 4 × 10-41 of all possible orders: a sliver too thin to write down sensibly.

And if the whole planet tried to hit one specific order, the expected wait would be around 3 × 1050 years, about 2 × 1040 times the current age of the universe.

That, more or less, is what The Impossible Shuffle is doing: one deck was shuffled once, and humanity is trying to shuffle that exact order again, together, one button press at a time.

Try it: shuffle a deck right here

This deck is shuffled by your browser's cryptographic random generator (the Fisher–Yates method). Cards that glow sit in the same spot as in the Holy Grail Sequence, the one deck the whole mission is chasing.

Your result appears here. Shuffles on this page are just for fun and don't count for the mission.

More questions about 52!

How many digits does 52! have?

68 digits. It ends in exactly 12 zeros, because the numbers 1 to 52 contain twelve factors of 5 (one each in 5, 10, 15 … 50, plus an extra one in 25 and 50), and each pairs with a 2 to make a 10.

How do you calculate 52 factorial?

Multiply 52 × 51 × 50 and keep going down to 1. A computer does it instantly (in Python: math.factorial(52)). For a quick estimate there's Stirling's approximation, n! ≈ √(2πn)·(n/e)n, which gives about 8.05 × 1067, only 0.16% off.

What about a deck with jokers?

Add two jokers and you have 54!, about 2.3 × 1071 orders: some 2,900 times more than without them.

So is every shuffled deck unique?

Almost certainly, if it was shuffled well. Whether two shuffles in history ever matched is its own fun question: has anyone ever shuffled the same deck twice?