Most active commenters
  • awesome_dude(5)
  • kerkeslager(3)

←back to thread

97 points indigodaddy | 22 comments | | HN request time: 0.4s | source | bottom
1. 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 #
2. 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 #
3. indigodaddy ◴[] No.45154777[source]
Maybe they mean that computers can't replicate the imperfections/shortcomings that might define human/hand shuffling? That's kind of how I took it.
replies(2): >>45154877 #>>45154986 #
4. 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 #
5. genghisjahn ◴[] No.45154868{3}[source]
It’s comments like this that keep me coming back to HN. I’d never heard of this before.
replies(1): >>45155096 #
6. evrydayhustling ◴[] No.45154877[source]
Those human imperfections likely decrease randomness - for example leaving cards that started adjacent more likely to remain adjacent han by strict chance.
replies(1): >>45154926 #
7. harrall ◴[] No.45154926{3}[source]
They most definitely decrease randomness.

But I guess the article’s point is that human imperfections offset that with lower correlated failure modes.

8. namibj ◴[] No.45154955{3}[source]
As a sort of TL;DR: it's basically like selection sort but instead of selecting the sort-compliant choice among the remaining ones, you ask the RNG and pick a random one.
replies(1): >>45155028 #
9. dwattttt ◴[] No.45154986[source]
Given

> an algorithm would randomly select an arrangement from the 52! possible decks. But no computer has enough memory to evaluate all of these possibilities

It sounds more like they don't understand how a computer can shuffle something.

10. duskwuff ◴[] No.45155028{4}[source]
However, note that using a random function as the comparator for a sort function does not generally result in an unbiased shuffle.
11. andrewflnr ◴[] No.45155096{4}[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 #
12. awesome_dude ◴[] No.45155213{5}[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 #
13. vesche ◴[] No.45155420{3}[source]
Python's random.shuffle also uses Fisher-Yates
replies(1): >>45156094 #
14. Sanzig ◴[] No.45155457[source]
Do you? Modern CPUs have had built-in TRNGs for years.
15. kerkeslager ◴[] No.45155458{6}[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 #
16. awesome_dude ◴[] No.45155499{7}[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 #
17. kerkeslager ◴[] No.45155614{8}[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 #
18. awesome_dude ◴[] No.45155893{9}[source]
More snark, thus proving the initial assessment.
replies(1): >>45207131 #
19. awesome_dude ◴[] No.45156094{4}[source]
I wonder how many other languages have it implemented as their shuffle algorithm
20. mistercow ◴[] No.45156509[source]
There’s an almost mystical belief among certain tech and science journalists that computers are bad at randomness, and it’s really bizarre, and in my opinion, pretty harmful.
21. andrewflnr ◴[] No.45158103{6}[source]
> I wouldn't be surprised if it's being used for the shuffle.

That would certainly be a good thing to check before using Go's shuffle for real-money poker games. I wouldn't take it for granted.

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

There are not and cannot be any such algorithms. That's the entire point of this thread. Fisher-Yates is necessary but not sufficient. You either have sufficient random bits for your shuffle or not.

22. kerkeslager ◴[] No.45207131{10}[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.