686

I've never quite got this. Just say you write a small program in any language at all which rolls some dice (just using dice as an example). After 600,000 rolls, each number would have been rolled around 100,000 times, which is what I'd expect.

Why are there websites dedicated to 'true randomness'? Surely, given the observation above, the chances of getting any number are almost exactly 1 over how ever many numbers it can choose from.

I tried it in Python: Here's the result of 60 million rolls. The highest variation is like 0.15. Isn't that as random as it's going to get?

1 - 9997653 2347.0
2 - 9997789 2211.0
3 - 9996853 3147.0
4 - 10006533 -6533.0
5 - 10002774 -2774.0
6 - 9998398 1602.0
Peter
  • 1,095
  • 1
    Take a look at wikipedia article on hardware generated random numbers Also see this - http://stats.stackexchange.com/questions/32794/are-truncated-numbers-from-a-random-number-generator-still-random – steadyfish Feb 09 '14 at 04:53
  • 22
    What do you mean by "rolls some dice"? Does it have a robot arm and camera attached? – starblue Feb 09 '14 at 19:34
  • 3
    while i agree with the general gist of your tone, that we often worry about this too much, but it has been exploited in real life: http://en.wikipedia.org/wiki/Ronald_Dale_Harris – Grady Player Feb 10 '14 at 01:18
  • In the vein of this topic and the top/accepted answer: http://www.lauradhamilton.com/random-lessons-online-poker-exploit – WernerCD Feb 10 '14 at 15:08
  • 3
    See this article about an online poker game missing true randomness for why it matters. – Varaquilex Feb 10 '14 at 16:48
  • What happens when you run your program 100x? Do you usually get a slight overabundance of 4 and 5? Or is the error random? 2) Is there randomness to the odds of X followed by X+Y, where X,Y is member of {1...6} (and you are looping around)? You need randomness in the number that comes next, not just randomness in the distribution. 3) If you are generating a new seed each time, based on the clock, then you might actually have a truly-random (hardware-based) RNG. But I think that is cheating. A PRNG is supposed to be an algorithm that operates on a seed, if I understand it correctly.
  • – dmm Feb 10 '14 at 19:35
  • 1
    If you just keep a 0-5 counter and roll a dice accordingly, 666 gorillion times, you'd get an equal distribution as well. – jcora Feb 13 '14 at 20:49
  • @starblue, I think you're referring to the Dice-o-matic. http://hackaday.com/2009/05/26/dice-o-matic/ – JMD Feb 14 '14 at 20:07
  • Actually I wanted to highlight how hopelessly naive the question is, because it glosses over the most important aspect of randomness, the process by which the numbers are generated. – starblue Feb 16 '14 at 08:05
  • @Varaquilex Nice article! Look at the original report here, though. The problem is they used a weak PRNG with a predictable seed. At the end of the article, what the authors advise is using a stronger PRNG with an unpredictable seed. True randomness is required to provide a seed. There is little use for it once this is done. – Erwan Legrand Feb 19 '14 at 14:40
  • If your "pseudorandom number generator" just output the sequence 1-2-3-4-5-6-1-2-3-4-5-6-1-2-3-4-5-6-.... forever, your table would be even more uniform than the one you're showing here, but I doubt most people would have a very high opinion of such a PRNG. – Daniel McLaury Feb 14 '17 at 00:43