A Good and SIMPLE Measure of Randomness

后端 未结 13 1545
情话喂你
情话喂你 2020-12-14 00:17

What is the best algorithm to take a long sequence of integers (say 100,000 of them) and return a measurement of how random the sequence is?

The function should retu

13条回答
  •  半阙折子戏
    2020-12-14 00:26

    It can be done this way:

    CAcert Research Lab does a Random Number Generator Analysis.

    Their results page evaluates each random sequence using 7 tests (Entropy, Birthday Spacing, Matrix Ranks, 6x8 Matrix Ranks, Minimum Distance, Random Spheres, and the Squeeze). Each test result is then color coded as one of "No Problems", "Potentially deterministic" and "Not Random".

    So a function can be written that accepts a random sequence and does the 7 tests. If any of the 7 tests are "Not Random" then the function returns a 0. If all of the 7 tests are "No Problems", then it returns a 1. Otherwise, it can return some number in-between based on how many tests come in as "Potentially Deterministic".

    The only thing missing from this solution is the code for the 7 tests.

提交回复
热议问题