←back to thread

97 points indigodaddy | 1 comments | | HN request time: 0.24s | source
Show context
ziofill ◴[] No.45154922[source]
“In an ideal world, an algorithm would randomly select an arrangement from the 52! possible decks. But no computer has enough memory to evaluate all of these possibilities, and a perfect random number generator doesn’t yet exist. Therefore, developers generally rely on algorithms that simulate card shuffling.”

You’ve got to be kidding me. What’s wrong with sampling each card independently and uniformly (without replacement)?

replies(2): >>45154979 #>>45155345 #
RainyDayTmrw ◴[] No.45154979[source]
If you do it correctly, you've reinvented Fisher-Yates[1]. If you do it wrong, you've reinvented this unnamed, broken algorithm[2], instead.

But the issue in the article isn't application of pseudorandom numbers. It's seeding the generator.

[1]: https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle [2]: https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle#N...

replies(2): >>45155261 #>>45155825 #
1. ◴[] No.45155825[source]