Hacker News new | ask | show | jobs
by dilutedh2o 2542 days ago
Am just here to nitpick, but the 5 disk CD changer behavior that you just described is not true randomness (by definition).
4 comments

Nitpicking your nitpick, the difference is whether the random sampling is with replacement or without replacement. Wikipedia's definition of "simple random sample" defines it to include both ways:

[S]ampling is typically done "without replacement", i.e., one deliberately avoids choosing any member of the population more than once. Although simple random sampling can be conducted with replacement instead, this is less common and would normally be described more fully as simple random sampling with replacement.

Ref: https://en.wikipedia.org/wiki/Simple_random_sample

nitnitnitpick: GP is likely (and overly pedantically) referring to the use of a PRNG to implement the shuffle, rather than using a true random source.
It is in fact a random shuffling. Hence the name that was used for this function.
Which is why it was called "shuffle" and not "random".

Shuffle (mostly) used to do what you expected when you had a medium like CD with a small number of tracks.

As the number of available tracks grew, the definition became less and less obvious.

With a service like Spotify, you could design an entire multi-page specification to cover all the different possible "shuffle" options you could give users - all of which would be useful in at least some settings.

Instead of which users get one button and some guessing.

It is randomness if you are "playing N tracks in random order" and not "select the next track randomly from N choices in a loop".