top | item 12101190

(no title)

rohanprabhu | 9 years ago

So, I tried a simple python one-liner:

[os.urandom(1)[0] < 128 for x in xrange(0, 100)]

and typed 'd' for True and 'f' for False in the array, bringing the accuracy of the predictor down to 53%. Theoretically, I'm guessing doing it for large enough numbers should make it exactly 50%.

discuss

order

mikeash|9 years ago

If it doesn't come down to 50% for sufficiently large numbers, you've found a break in your OS's urandom and someone is about to be famous!