52!

The maths behind 52!

Why one mode is impossible, and the other one you win most nights

This page explains the two numbers the game is built on. Both come from the same deck of cards, and they could hardly be more different: one is so large it has no useful comparison left in the universe, and the other says you will succeed about two nights in three. Everything below is worked out from scratch — no results are quoted without showing where they come from.

1. The number itself

Take a deck of 52 playing cards and shuffle it properly. How many orders could it have come out in? The first card can be any of 52. Whatever it was, the second can be any of the remaining 51. The third, any of 50. Multiply all the way down:

52 × 51 × 50 × … × 3 × 2 × 1

Mathematicians write that with an exclamation mark — 52 factorial, or 52! — which is where this game gets its name. Worked out, it is:

52! = 80 658 175 170 943 878 571 660 636 856 403 766 975 289 505 440 883 277 824 000 000 000 000
That is roughly 8.07 × 1067 — a 68-digit number.

2. How big is 8 × 1067, really?

Large numbers stop meaning anything past about a billion, so comparisons are the only honest way to describe this one. The problem is that 52! is large enough that the usual comparisons run out.

Quantity Roughly
People alive on Earth 8 × 109
Stars in the Milky Way 4 × 1011
Seconds since the dinosaurs died out 2 × 1015
Grains of sand on every beach on Earth 7 × 1018
Stars in the observable universe 1024
Orders of a shuffled deck (52!) 8 × 1067
Atoms in the Milky Way 1067

Read the last two rows again. The number of ways to arrange a deck of cards is roughly the number of atoms in our galaxy. Not stars — atoms. You could give every atom in the Milky Way its own unique shuffle and still have some orders left over.

There is a well-known consequence of this. If you shuffle a deck thoroughly, the order you are holding has, in all likelihood, never existed before in human history and never will again. Not because anyone arranged it that way — simply because there have not been anywhere near enough shuffles, by anyone, ever, to make a repeat likely.

3. Mode one: “Until you miss”

Two decks are shuffled independently. You turn one card from each and see whether they match. If they do, you keep going. The moment they do not, the run ends.

The first pair matches with probability 1/52. If it does, 51 cards remain in each deck, so the next matches with probability 1/51, and so on. To get a run of k cards you need all of them:

P(run of k) = 1/52 × 1/51 × … × 1/(53−k)

Run Odds Comparable to
1 card 1 in 52 about 1.4× rarer than rolling two sixes in a row
2 cards 1 in 2 652 being dealt four of a kind
3 cards 1 in 132 600 about 10× rarer than an amateur hole-in-one
5 cards 1 in 312 million more than twice as unlikely as the Euromillions jackpot
10 cards 1 in 5.7 × 1016 picking one exact second since the dinosaurs
52 cards 1 in 8.07 × 1067 picking one exact atom in the Milky Way

A full run of 52 means the two shuffles came out identical. That is the impossible case, and it is the point of the game: nobody is going to do it. Not you, not everyone who ever plays this site, not a computer running until the sun burns out. The game exists so you can feel how large that number is by failing against it.

4. Mode two: “All 52 pairs”, and a surprise

Now change one rule and nothing else. Instead of stopping at the first miss, turn over all 52 pairs and count how many happened to match — not in a row, just anywhere. How many matches should you expect?

Each of the 52 positions matches with probability 1/52, and there are 52 of them, so the expected number of matches is 52 × 1/52 = 1. Exactly one. And here is the part that catches people out: that answer does not depend on the deck size at all. Ten cards, a thousand cards, a million — the expected number of matches is always 1.

The real question is how often you get at least one. This is a classic problem in combinatorics, the problème des rencontres (“the matching problem”), first studied by Pierre Rémond de Montmort in 1708. Counting arrangements with no matches at all — derangements — gives:

P(no matches at all) = 1/0! − 1/1! + 1/2! − 1/3! + … ≈ 1/e ≈ 0.3679

So the chance of getting at least one match is 1 − 1/e ≈ 0.6321:

You match at least one card about 63% of the time — roughly two rounds in three. In the same game, with the same deck, where matching all 52 is a 1-in-1067 event.

The constant e = 2.71828… turning up here is not a coincidence or an approximation for large decks. The series above is the expansion of e−1, and it converges so fast that by 52 cards the answer is correct to more decimal places than anyone needs. It is already accurate to three decimals at n = 6.

At least… Odds
1 match 1 in 1.58 (happens more often than not)
2 matches 1 in 3.8
3 matches 1 in 12
4 matches 1 in 53
5 matches 1 in 273
6 matches 1 in 1 683
10 matches 1 in 9 million
All 52 1 in 8.07 × 1067

The two ladders start in completely different worlds — 63% against 2% — and meet at exactly the same impossible number at the end. They have to: matching all 52 anywhere and matching all 52 in a row are the same event.

5. Why the odds get worse so fast

In “Until you miss”, each extra card multiplies the difficulty by about 50. That is what exponential growth feels like from the inside: the step from 4 cards to 5 cards costs you more than every step before it put together. Most people who play this game a few hundred times end up somewhere between 2 and 4, and then stop improving — not through lack of skill, because there is no skill, but because the next rung of the ladder is fifty times higher than the one they are standing on.

6. There is no strategy

It is worth saying plainly, because every game like this attracts systems. The decks are shuffled independently and uniformly at random by the server before you touch anything. Nothing you do changes the outcome: not the order you pick, not how long you wait, not whether you switch modes, not how many rounds you have already lost. There is no hot streak and no due card. Every round is exactly as hard as the last one.

The only thing entirely in your control is how many rounds you play. That is why the leaderboards are what they are — a record of persistence meeting luck, honestly counted.

7. Checking it yourself

None of this asks you to take our word for it. The shuffle is committed cryptographically before you play and revealed afterwards, so you can verify that the deck was not changed to suit the result — see how the fair shuffle works. The odds shown in the game are computed from the formulas on this page.