←back to thread

97 points indigodaddy | 1 comments | | HN request time: 0s | source
Show context
sneak ◴[] No.45154725[source]
> Card dealers create a unique deck with each shuffle, something computers cannot replicate

This is entirely, unequivocally false.

Shuffling as an algorithm to implement is easy to fuck up, but if you use a good one and a true RNG source, computers can shuffle better than humans - just as randomly, and many orders of magnitude faster.

replies(3): >>45154759 #>>45154777 #>>45156509 #
smallerize ◴[] No.45154759[source]
I think the RNG source is the point here. It's not as impossible as stated, but you have to put some work in to get a good one.
replies(2): >>45154786 #>>45155457 #
awesome_dude ◴[] No.45154786[source]
Go (and probably other languages) has the Fisher-Yates algorithm for shuffling

https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle

replies(3): >>45154868 #>>45154955 #>>45155420 #
genghisjahn ◴[] No.45154868[source]
It’s comments like this that keep me coming back to HN. I’d never heard of this before.
replies(1): >>45155096 #
andrewflnr ◴[] No.45155096[source]
Really? It repeats a point from the article, and in so doing utterly misses the point of the comment it's replying to. Fisher-Yates is at least not broken, but it can only be as good as the underlying RNG.
replies(1): >>45155213 #
awesome_dude ◴[] No.45155213[source]
Go has a cryptographically secure RNG now, I wouldn't be surprised if it's being used for the shuffle.

Also, I'm keen to see what shuffle algorithms you know of that aren't susceptible to RNG issues

replies(2): >>45155458 #>>45158103 #
kerkeslager ◴[] No.45155458[source]
1. Every remotely competent language has a secure (P)RNG and is using it to Fisher-Yates shuffle. Go is not special in this regard.

2. Nobody in this thread is criticizing Fisher-Yates, because in all likelihood all of us are using Fisher-Yates. We're discussing the failure of the algorithm used in the article.

3. Please take the time to read and understand the posts you respond to before you respond to them.

replies(1): >>45155499 #
awesome_dude ◴[] No.45155499[source]
In case anyone is following along, the hostility the above poster is demonstrating is because there isn't any shuffling algorithm that isn't susceptible to the RNG issue, and he didn't think about the cryptographically secure RNGs in use today.
replies(1): >>45155614 #
kerkeslager ◴[] No.45155614[source]
My friend, I am not hostile. I'm merely pointing out that you have not understood a single post you've responded to. Including the one you responded to just now.

The following algorithm is not susceptible to RNG issues (in Rust, since I've been playing around with it):

    fn shuffle(vec: &Vec) -> () {
    }
And I'm sure since you're reading all these posts so carefully you'll totally understand why this is both a joke and a proof that you don't know what you're talking about.
replies(1): >>45155893 #
awesome_dude ◴[] No.45155893[source]
More snark, thus proving the initial assessment.
replies(1): >>45207131 #
1. kerkeslager ◴[] No.45207131[source]
A smart move, not responding on topic, since you clearly don't understand the topic. Instead, just accuse me of being snarky! Guilty as charged, I guess, but at least I can read and understand what I'm responding to.