生成“太完美"随机数 [英] Generating "too perfect" random numbers

查看:59
本文介绍了生成“太完美"随机数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一个好的 RNG 应该通过多项随机性统计测试.例如,可以将 0 到 1 范围内的均匀真实值分箱到直方图中,每个分箱中的计数大致相等,由于统计波动而给出或取一些.这些计数服从某种分布,我不记得是泊松分布还是二项分布,但无论如何这些分布都有尾部.同样的想法适用于相关性、微妙周期性等的测试.

A good RNG ought to pass several statistical tests of randomness. For example, uniform real values in the range 0 to 1 can be binned into a histogram with roughly equal counts in each bin, give or take some due to statistical fluctuations. These counts obey some distribution, I don't recall offhand if it's Poisson or binomial or what, but in any case these distributions have tails. Same idea applies to tests for correlations, subtle periodicities etc.

高质量的 RNG 偶尔会在统计测试中失败.对看起来完美的 RNG 持怀疑态度是个好建议.

A high quality RNG will occasionally fail a statistical test. It is good advice to be suspicious of RNGs that look to perfect.

好吧,我疯了,想生成(可重复的)过于完美"的随机数,这些随机数在统计测量中的那些随机波动中可疑地缺乏.直方图太平坦,移动框平均值的方差太小,相关性可疑地接近于零,等等.寻找太干净地通过所有统计测试的 RNG.哪些已知的 RNG 是这样的?是否有关于此想法的已发表研究?

Well, I'm crazy and would like to generate (reproducibly) "too perfect" random numbers, ones suspiciously lacking in those random fluctuations in statistical measures. Histograms come out too flat, variances of moving-box averages come out too small, correlations suspiciously close to zero, etc. Looking for RNGs that pass all statistical tests too cleanly. What known RNGs are like this? Is there published research on this idea?

一个不可接受的答案:一些较差的线性同余计数器生成器的分布过于平坦,但完全没有通过大多数随机性测试.

One unacceptable answer: some of the poorer linear congruential counter generators have too flat a distribution, but totally flunk most tests of randomness.

与此相关的是生成具有已知校准缺陷量的随机数流.分布中的一个块很容易 - 只需生成一个近似于该想法的非均匀分布(例如,参见 Generating non-均匀随机数)但是如何在保持正确或过于完美的分布的同时引入校准量的高阶相关性呢?

Related to this is the generation of random number streams with a known calibrated amount of imperfection. A lump in the distribution is easy - just generate a nonuniform distribution approximating the idea (e.g see Generating non-uniform random numbers) but what about introducing calibrated amounts of higher order correlations while maintaining a correct, or too perfect, distribution?

推荐答案

显然,常用的随机数生成器 Mersenne Twister 失败了 DieHarder 通过太随机"进行测试.换句话说,某些测试在真正的随机性下始终过于接近其预期值.

Apparently the Mersenne Twister, a commonly used random number generator, fails the DieHarder tests by being "too random". In other words, certain tests consistently come too close to their expected value under true randomness.

这篇关于生成“太完美"随机数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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