4 ms·
If the last 'n' generated numbers were also given to you, this seems like a fair task - to check the randomness of a sequence of numbers. Wikipedia has an artic
by xrisk 9y ago
If the last 'n' generated numbers were also given to you, this seems like a fair task - to check the randomness of a sequence of numbers. Wikipedia has an article about "randomness tests". [1]
An example algorithm could determine if a run of integers represents a random sequence with some probability 'p'.
[1]: https://en.m.wikipedia.org/wiki/Randomness_tests https://en.m.wikipedia.org/wiki/Randomness_tests
- hanbura 9y agoThose tests can "disprove" that a sequence is random (quotes because of course a true random generator will occasionally generate suspicious sequences of arbitrary length) But you can't prove that a sequence is indeed random: the sequence [sha256(1), sha256(2), sha256(3), ...] passes the usual tests and isn't even clever. For any set of tests you can write a pseudo random generator that passes them