←back to thread

97 points indigodaddy | 1 comments | | HN request time: 0.208s | 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 #
alexey-salmin ◴[] No.45155261[source]
> In the late 1990s the development platform ASF Software supplied several online poker providers, such as Planet Poker, with card-shuffling algorithms. The platform even posted the algorithm on its website as proof that the game was reliably programmed.

What amazes me is the level of overconfidence the developers of the broken algorithm had to post it online. I mean it's not that the probability theory was a novel and unexplored field at the time.

replies(2): >>45156446 #>>45161807 #
48terry ◴[] No.45161807[source]
...They posted their algorithm as a way to prove it was reliable. Someone pointed out it wasn't reliable. They revised the algorithm. What's the problem here?
replies(1): >>45165436 #
1. alexey-salmin ◴[] No.45165436[source]
They were selling this algorithm for money and evidently didn't use any of that money to hire a single statistician to validate it. The mistake they've made isn't obscure and doesn't require a thousand pairs of eyes to catch, just one.

Imagine paying to a professional plumber, he installs the toilet upside down and then posts the photos online for the community to check his work.