←back to thread

97 points indigodaddy | 8 comments | | HN request time: 0.928s | source | bottom
Show context
ajross ◴[] No.45154693[source]
Article goes through a mostly irrelevant discussion about "52 factorial is a really really big number" before getting to the computer science meat of the headline:

RNG was seeded with a millisecond time of day, leading to 86.4M possible decks. Oooph.

replies(4): >>45154722 #>>45154909 #>>45154962 #>>45154998 #
shagie ◴[] No.45154909[source]
The number 52! is absurdly large. While the article is behind a paywall and so I can't see its full discussion, I'm reminded of https://czep.net/weblog/52cards.html that has a bit on the "how large is the number"

> Start by picking your favorite spot on the equator. You're going to walk around the world along the equator, but take a very leisurely pace of one step every billion years. The equatorial circumference of the Earth is 40,075,017 meters. Make sure to pack a deck of playing cards, so you can get in a few trillion hands of solitaire between steps. After you complete your round the world trip, remove one drop of water from the Pacific Ocean. Now do the same thing again: walk around the world at one billion years per step, removing one drop of water from the Pacific Ocean each time you circle the globe. The Pacific Ocean contains 707.6 million cubic kilometers of water. Continue until the ocean is empty.

And it goes on.

Numbers like Tree(3) or Loader's number or the various "these are really big mathematical functions" ( relevant xkcd https://xkcd.com/207/ )... we know we can't comprehend them. But 52! - that's something that we think we can get our head around... and it's mind boggling large once you start doing the math and trying to relate it to real things that we can relate to (which are mind bogglingly large).

replies(2): >>45155008 #>>45155403 #
gucci-on-fleek ◴[] No.45155008[source]
52! < 2^226, so it's not that big in computer terms. It's smaller than a single AVX2 register, a ChaCha20/AES-256/Curve25519 key, a pair of IPv6 addresses, etc. Still mindbogglingly huge, but not uncommonly large.
replies(1): >>45155074 #
1. danielheath ◴[] No.45155074[source]
Right, but storing 52! distinct values isn’t something a computer is going to be able to do.
replies(3): >>45155152 #>>45155183 #>>45155237 #
2. zmgsabst ◴[] No.45155152[source]
So?

You’re only using one deck at a time; so you only need to generate 1 bit randomly 226 times — then use that deck.

replies(1): >>45155205 #
3. adastra22 ◴[] No.45155183[source]
A quantum computer can.
4. bobbylarrybobby ◴[] No.45155205[source]
Without a bunch of (unentangled) electrons you can observe, getting 226 truly random bits in quick succession doesn't seem all that easy.
replies(3): >>45155273 #>>45155417 #>>45155880 #
5. alexey-salmin ◴[] No.45155237[source]
Well neither can a human.

The whole premise of computers being unable to do shuffling as good as humans is ridiculous. 52! is huge but log(52!) is not.

If anything it's humans (unless specifically trained) who produce horribly biased shuffles. Whole chunks of sequences from the previous deal can show up, either directly or spaced 2x or 4x. Try ordering a deck first, then shuffle it, then open each card and see if you notice any patterns.

6. alexey-salmin ◴[] No.45155273{3}[source]
Depends on what you mean by "truly random" but if it's "cryptographically secure random" then it's not particularly hard.

There are strong monetary incentives to break all kinds of private keys but most of the time they hold pretty well.

7. Sanzig ◴[] No.45155417{3}[source]
RDRAND has a throughput of hundreds of megabytes per second on most processors. Getting 226 bits is pretty easy, even shuffling millions of decks per second you'd be bottlenecked elsewhere.

(That does sound like a fun optimization challenge: "write a program to fairly shuffle the most decks of cards per second possible.")

8. jdietrich ◴[] No.45155880{3}[source]
Quantum random number generators are commercially available, relatively inexpensive and can supply hundreds of megabits per second of truly random data from a single PCIe card.