一个良好的和简单的措施随机性 [英] A Good and SIMPLE Measure of Randomness

查看:131
本文介绍了一个良好的和简单的措施随机性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是最好的算法,需要很长的整数(说他们中的100,000)的序列,并返回如何随机序列是测量?

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?

该函数返回一个结果,说0,如果序列是不是所有的都随机的,最多,说1,如果完全随机的。它可以给一些在中间如果序列是有点乱,如0.95可能是一个合理的随机序列,而0.50可能具有一些非随机的部分和一些随机份

The function should return a single result, say 0 if the sequence is not all all random, up to, say 1 if perfectly random. It can give something in-between if the sequence is somewhat random, e.g. 0.95 might be a reasonably random sequence, whereas 0.50 might have some non-random parts and some random parts.

如果我是皮的前10万位数字传递给函数,它应该给一个数字非常接近1。如果我通过序列1,2,... 10万到它,它应该返回0。

If I were to pass the first 100,000 digits of Pi to the function, it should give a number very close to 1. If I passed the sequence 1, 2, ... 100,000 to it, it should return 0.

这样我可以轻松拍摄30序列号,确定如何随机的每一个都是,并返回有关其相对随机性的信息。

This way I can easily take 30 sequences of numbers, identify how random each one is, and return information about their relative randomness.

有没有这样的动物是什么?

Is there such an animal?

推荐答案

这是可以做到这样:

CACERT研究实验室做一个随机数发生器分析

CAcert Research Lab does a Random Number Generator Analysis.

他们的研究结果页面评估每个随机序列使用7测试(熵,生日间距,矩阵的行列,6×8矩阵秩,最小距离,任意大小的球,和挤压)。每个测试,结果是颜色codeD为无问题,潜在的确定性和Not随机。

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".

因此​​,一个函数可以写成一个接受随机序列并执行7测试。 如果任何7测试的是不随机,那么函数返回一个0。如果所有的7测试都是没有问题,则返回1。否则,它可以返回一些数字介于两者之间的基础上有多少测试进来作为潜在确定性。

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".

的唯一的事情,从这个解决方案缺少的是code为7的测试。

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

这篇关于一个良好的和简单的措施随机性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆