Orders so far
Cards placed
Shuffles in history
Orders ever seen
Any repeat ever
History
Playback
View

More information about 52 factorial and why every shuffle is unique

52 factorial: every shuffled deck is one of a kind

Shuffle a deck of cards, and you have probably made an order that has never existed, ever. There are 52 cards: the first spot has 52 choices, the next has 51, then 50, and so on down to 1. Multiply them all and you get 52 factorial, 52!, an 8 followed by 67 more digits. If every human who ever lived had shuffled a deck once a second since the Big Bang, we still would not have seen even one in a trillion trillion trillion of all the orders. Watch a deck shuffled spot by spot, and see the number of orders climb past the grains of sand, the stars and every shuffle in history. Shuffle a deck of cards and you have almost certainly made an order that has never existed before. Press Play to watch the deck shuffled the fair way, one spot at a time: the first spot has 52 choices, the next 51, then 50, and each card lifts out of the face-down deck, turns over and lands in its spot. Multiply all the choices and you get 52 factorial, 52! ≈ 8.07 × 10⁶⁷: an 8 followed by 67 more digits. The scale beside the cards climbs with every card, past the seconds since the Big Bang, the stars and the atoms of the Earth, and past the line of all shuffles in history: if everyone who ever lived had shuffled a deck once a second since the Big Bang, that would be about 5 × 10²⁸ shuffles. After only 18 cards the orders outnumber them, and the bar turns from teal (orders that could have been seen) to purple (orders nobody has ever seen). With the whole deck, history has seen less than one in a trillion trillion trillion of all the orders, so the deck in your hands is one of a kind. Change who shuffles, how fast and for how long, or try a smaller deck: a euchre deck of 24 cards has been shuffled into every one of its orders many times over. Step and Back move one card, a click on the deck deals the next one, and New shuffle or Play after the last card shuffles again. Save image, record a video with a snap for every card, or open the picture in the photo editor with the pencil, where every card and every part of the scale is a layer of its own.

Як це працює

  1. Press Play: the deck is shuffled one spot at a time, each empty spot showing its number of choices, 52, 51, 50 and down to 1, and each card lifts out of the face-down deck, turns over and lands in its spot.
  2. Watch the scale beside the cards: the orders so far climb past the seconds since the Big Bang and the stars, and after 18 cards past every shuffle in history.
  3. Change who shuffles, how fast and for how long, from one person for a day to everyone alive with a supercomputer since the Big Bang, and read in the tiles how much of all the orders history could have seen.
  4. Try a smaller deck: a euchre deck of 24 cards has been through every one of its orders many times over, while one suit of 13 cards takes a lifetime of shuffling to see about a third of them.

52 × 51 × 50 × … × 1

To put a deck in order, choose a card for the first spot: there are 52 to choose from. Whichever you picked, 51 are left for the second spot, so the first two spots can be filled in 52 × 51 = 2,652 ways. The third spot adds a factor of 50, the fourth 49, and so on until the last card, which has no choice at all. The product of all the whole numbers from 1 to n is written n! and called n factorial. 52! is 80,658,175,170,943,878,571,660,636,856,403,766,975,289,505,440,883,277,824,000,000,000,000, about 8.07 × 10⁶⁷: an 8 followed by 67 more digits. A fair shuffle, the Fisher–Yates shuffle that the app uses, picks each of those orders with the same chance by picking each spot's card at random from the cards that are left.

How big is 8 × 10⁶⁷?

Numbers this large stop meaning anything, so the app sets 52! on a ladder of powers of ten beside some others. About 117 billion people have ever lived. About 4.4 × 10¹⁷ seconds have passed since the Big Bang. There are perhaps 7.5 × 10¹⁸ grains of sand on the world's beaches and around 10²³ stars in the observable universe. Your body holds about 7 × 10²⁷ atoms, the Earth about 1.3 × 10⁵⁰ and the Sun about 10⁵⁷. 52! is tens of billions of times larger still. Each step up the ladder multiplies by ten, so the bar of the orders climbs quickly at first, by almost two steps for each of the first cards, and more slowly as the choices run out.

Every shuffle in history

Suppose every person who ever lived had been shuffling a deck once a second for the whole age of the universe, 13.8 billion years. That is about 117 billion × 4.4 × 10¹⁷ ≈ 5.1 × 10²⁸ shuffles. Already after 18 cards, the orders of those 18 cards alone outnumber all of them, and the bar turns from teal, orders that could have turned up, to purple, orders that nobody can ever have seen. For the whole deck, the shuffles of history cover less than one in 10³⁹ of the orders, less than one in a trillion trillion trillion. The chance that any two of those 5 × 10²⁸ shuffles were the same is about 1.6 in a hundred billion. So when you shuffle a deck well, you are almost certainly holding an order that no one has ever held before and no one ever will again.

Smaller decks, and when repeats happen

Factorials grow so fast that the size of the deck matters enormously. Five cards have only 120 orders, which one person shuffling for a day sees hundreds of times each. A suit of 13 cards has 6.2 billion orders: one shuffle a second for a lifetime of 80 years covers about a third of them. A euchre deck of 24 cards has 6.2 × 10²³ orders, few enough that history's 5 × 10²⁸ shuffles would have shown each one about 82,000 times. Repeats also come far sooner than seeing every order, as in the birthday problem: among N random shuffles of a deck with P orders, the chance of two alike is about 1 − e^(−N²/2P), so it takes only about the square root of P shuffles. Even that is out of reach for 52 cards, unless all eight billion people alive had a computer shuffling a billion decks a second since the Big Bang.

Поширені запитання

What is 52 factorial?

52 factorial, written 52!, is the product of all the whole numbers from 1 to 52: 52 × 51 × 50 × … × 2 × 1. It equals 80,658,175,170,943,878,571,660,636,856,403,766,975,289,505,440,883,277,824,000,000,000,000, about 8.07 × 10⁶⁷, a number with 68 digits. It is the number of different orders a standard deck of 52 cards can be in.

Has my shuffled deck ever existed before?

Almost certainly not, if the deck was shuffled well. Even if every person who ever lived had shuffled a deck once a second since the Big Bang, about 5 × 10²⁸ shuffles, that would be less than one in 10³⁹ of all the orders, and the chance that any two of those shuffles had come out the same would be about one in 60 billion. A brand-new deck straight from the box, or one shuffled only once or twice, is a different matter: its order is far from random.

Why does it end in twelve zeros?

Every zero at the end of a number comes from a factor 10 = 2 × 5. Among the numbers 1 to 52 there are plenty of factors 2, so the fives decide: 5, 10, 15, … 50 give ten fives, and 25 and 50 give one more each, twelve in all. So 52! ends in exactly twelve zeros.

How many times do I need to shuffle a deck?

For riffle shuffles, about seven. Dave Bayer and Persi Diaconis showed in 1992 that after five or six riffles a deck is still noticeably ordered, and that around seven the order becomes close to random; more shuffles add little. Overhand shuffles mix much more slowly and need thousands. The app shuffles the ideal way, every order equally likely.

How does the app shuffle?

With the Fisher–Yates shuffle, described by Ronald Fisher and Frank Yates in 1938 and turned into a computer method by Richard Durstenfeld in 1964: for the first spot it picks one of the 52 cards at random, for the second one of the 51 left, and so on. Each order then has exactly the same chance, 1 in 52!. The random numbers come from a seeded generator, so a shuffle can be saved and shown again, and New shuffle draws a new seed.

Can I use the picture?

Yes. Save gives a PNG at the size you choose, Save JSON writes the deck, the shuffle and its order, 52! to the last digit and the numbers of the tiles, Record films the shuffle with a soft snap for every card, and the pencil opens the picture in the PictorX photo editor with every card, the spots, the deck and the parts of the scale on layers of their own. In the editor itself it is under Apps ▸ Science ▸ Mathematics ▸ 52 Factorial. Everything runs in your browser.

52 Factorial: як записати відео?

Натисніть червону кнопку «Запис» на панелі відтворення: вона знімає те, що показує сцена. Натисніть її ще раз, щоб зупинити, і відео збережеться на вашому пристрої. Запис безкоштовний, потрібно лише увійти. Без підписки на відео в куті буде невеликий логотип PictorX. Кнопка поруч із «Запис» відкриває параметри відео: формат (як показано, квадрат, сторіз 9:16 або широкий 16:9), тривалість (доки ви не зупините, або 5, 10, 15 чи 30 секунд для соцмереж) і файл: MP4, WebM або анімований GIF. Для звуку виберіть власні звуки застосунку або одну з трьох музичних доріжок: спокійну, яскраву чи ритмічну.

Готові спробувати?

Відкрийте PictorX у браузері — без встановлення і без кредитної картки.

Перейти до редактора