Live data from Hacker News

52 Factorial

czep.net

11–20 of 65 posts

Re: 52 Factorial

#12
post #8
post #2

So if I want a collection of card decks in every possible combination I should start collecting now, got it.

mass of Earth is 6×10^27 kg mass of the Milky Way is 6x10^42 kg mass of the visible Universe is 1.5×10^53 kg Quality deck of cards weighs 0.3 kg. All deck combinations would weigh 2.4×10^67 kg. = 10^14 times the mass of the visible Universe. You need many multiverses to store all those cards.

Or just make each deck 10^14 times smaller

Re: 52 Factorial

#13
I remember reading once that every time you shuffle a deck of cards, it's almost certainly the first time any deck of cards has ever been in that configuration. Seeing how outrageously large 52! is puts this into perspective.

Re: 52 Factorial

#14
post #8
post #2

So if I want a collection of card decks in every possible combination I should start collecting now, got it.

mass of Earth is 6×10^27 kg mass of the Milky Way is 6x10^42 kg mass of the visible Universe is 1.5×10^53 kg Quality deck of cards weighs 0.3 kg. All deck combinations would weigh 2.4×10^67 kg. = 10^14 times the mass of the visible Universe. You need many multiverses to store all those cards.

That would be a serious magic trick, as that's the explanation given to the rubes.

Some sort of auto-shuffling machine with some computer vision to match the shuffling in real time... still a magic trick, a different kind of impressive. But that guy who makes robots at home and does videos would love a project like this. I seriously doubt it would work.

Re: 52 Factorial

#15
Combinatorial problems are hard. The number of ways to arrange N guests in N seats at a seated event (such as a wedding or gala) is N!. Even with only 60 guests, there are already more possible seating permutations that there are believed to be atoms in the observable universe. The solution space for hundreds of guests is mind boggling large. I sometimes try to explain this to customers of my seating planning software (PerfectTablePlan) when they complain that the auto seating algorithm has separated 2 people in a 500 seat event, but I don't think many of them understand!

Re: 52 Factorial

#17

In terms of actually playing games with cards, the effective number of permutations can be much smaller (though still large enough to be going on with). In many card games, the suits are distinct but functionally identical; you could swap spades rank-for-rank with hearts and get a functionally equivalent deck. In Klondike solitaire, the tableau is concerned with red cards and black cards, not all four suits. I imagin…

Those interested can read Mark Conger's thesis to learn about the mathematics of repeated cards: https://websites.umich.edu/~mconger/thesis.pdf

Re: 52 Factorial

#18
post #5

Is it safe to say that it's almost certain that no two people have ever shuffled a deck of cards in the exact same order?

No, due to suboptimal shuffling strategies. If you shuffle exactly the wrong way, you can even end up with the cards in their original order.

Yep, this. Matt Parker makes a convincing argument that multiple people have accidently performed a perfect Faro shuffle when trying to randomize a new deck of cards

https://www.youtube.com/watch?v=s9-b-QJZdVA

Re: 52 Factorial

#19
And despite the huge size of 52!, it is possible with basic motor skills to produce a random deck. For those with the background and interest, there is a great book: The Mathematics of Shuffling Cards by Diaconis and Fulman, published 2023.

Re: 52 Factorial

#20

In terms of actually playing games with cards, the effective number of permutations can be much smaller (though still large enough to be going on with). In many card games, the suits are distinct but functionally identical; you could swap spades rank-for-rank with hearts and get a functionally equivalent deck. In Klondike solitaire, the tableau is concerned with red cards and black cards, not all four suits. I imagin…

I remember looking at some early Draw Poker machines in Las Vegas back in the late 80's/early 90's, and thinking about pseudo-random number generation (as it existed at that time). If it was using a standard linear-congruential RNG with a 16 bit value, there would be only 65536 possible seeds, and hence only that many distinct sequences of random numbers, and hence only that many possible shuffles. Even a 64-bit RNG…

ln(52!)/ln(2)≈226 bits. You don't have to depend on a single random 64-bit number: https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle
Post reply on HN