Live data from Hacker News

52 Factorial

czep.net

31–40 of 65 posts

Re: 52 Factorial

#31

This thought experiment gets even wilder if you like to live dangerously and leave two jokers and the rules card in the deck. 55 factorial is even larger

The jokers are indistinguishable, so it's only 55 factorial divided by two.

Re: 52 Factorial

#32
post #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.

Most likely not true, since many shuffles are from a sorted deck (original buy, result of playing out some game, etc...). The 52! possibilities are certainly not uniformly spread in real life. With enough shuffles then you'll likely hit never before seen territory.

And once you get there, it is likely that further shuffles will stay there.

Re: 52 Factorial

#33

I sometimes wake up having an anxiety attack because my dream was attempting to play something like this out- always something to do with permutations of massive numbers. It was a little bit of a challenge to keep it together while reading this. No idea why that is, either. It's the only thing that has such an effect on me.

Have you ever dreamt of Graham's number?

Re: 52 Factorial

#35
post #20

Earlier quoted context omitted.

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

If the RNG has < 226 bits of state, such as most non cryptographic PRNGs, you cannot reach all shuffles even if you use multiple numbers.

Re: 52 Factorial

#36
post #11

You can use one deck to encode 225 bits of information.

Yeah, I actually implemented this some years ago here, for UTF-8 text: https://github.com/Michael-Zinn/cardfs Works for Poker, Skat, Tarot and Quartett decks.

A tarot deck has more than only trumps. It also has fourteen non-trumps in each of four suits (Latin-suited or French-suited depending on the deck), so the total number of cards (trumps and non-trumps) is 78.

Furthermore, if you can store bytes, then why should it need to be UTF-8? Not all data is text, and not all text is Unicode (and not all Unicode text is most efficient with UTF-8). As far as I can tell, the only part of the program that requires it to be UTF-8 is the "decode_array_to_string" function (although I think it will have to be a string without embedded null characters since that is how argv is working, and that could possibly allow you to store a few more bytes, if the data is required to not have null characters).

Re: 52 Factorial

#37

This thought experiment gets even wilder if you like to live dangerously and leave two jokers and the rules card in the deck. 55 factorial is even larger

The jokers are indistinguishable, so it's only 55 factorial divided by two.

Sometimes they are distinct, usually one is black & white and the other is color.. the solitaire cipher makes use of this distinction.

Re: 52 Factorial

#38
post #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.

Most likely not true, since many shuffles are from a sorted deck (original buy, result of playing out some game, etc...). The 52! possibilities are certainly not uniformly spread in real life. With enough shuffles then you'll likely hit never before seen territory.

This is a good Numberphile video about it - The Best (and Worst) Ways to Shuffle Cards: https://youtube.com/watch?v=AxJubaijQbI

Re: 52 Factorial

#39

Earlier quoted context omitted.

Yeah, I actually implemented this some years ago here, for UTF-8 text: https://github.com/Michael-Zinn/cardfs Works for Poker, Skat, Tarot and Quartett decks.

A tarot deck has more than only trumps. It also has fourteen non-trumps in each of four suits (Latin-suited or French-suited depending on the deck), so the total number of cards (trumps and non-trumps) is 78. Furthermore, if you can store bytes, then why should it need to be UTF-8? Not all data is text, and not all text is Unicode (and not all Unicode text is most efficient with UTF-8). As far as I can tell, the only…

Thanks for pointing this out, I did not know that there are other tarot decks (I only have this one https://steemit.com/software/@michaelzinn/store-text-in-a-de... )

I originally had planned to store other data as well (that's why it's called "CardFS"): With the bytes, there is another multiplier 3 in there, which is unused. My plan was to do 0=UTF-8 text, 1=raw bytes, 2=bitmap graphic, but I stopped working on it after I got the UTF-8 text working.

Excluding NUL characters would only up the byte count to floor(log_255(52!)), which is still 28 bytes (though it increases the unused multiplier from 2.99 to 3.1, which makes it possible to use all bytes in all three file types), but how would you then store texts that use fewer than the maximum number of characters? Fill it with spaces?

Re: 52 Factorial

#40

I sometimes wake up having an anxiety attack because my dream was attempting to play something like this out- always something to do with permutations of massive numbers. It was a little bit of a challenge to keep it together while reading this. No idea why that is, either. It's the only thing that has such an effect on me.

I have something similar but for lambda terms with huge normal forms, I always wake up exhausted when this happens
Post reply on HN