A Good and SIMPLE Measure of Randomness

后端 未结 13 1547
情话喂你
情话喂你 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:37

    In Computer Vision when analysing textures, the problem of trying to gauge the randomness of a texture comes up, in order to segment it. This is exactly the same as your question, because you are trying to determine the randomness of a sequence of bytes/integers/floats. The best discussion I could find of image entropy is http://www.physicsforums.com/showthread.php?t=274518 .

    Basically, its the statistical measure of randomness for a sequence of values.

    I would also try autocorrelation of the sequence with itself. In the autocorrelation result, if there is no peaks other than the first value that means there is no periodicity to your input.

提交回复
热议问题