最佳伪随机数发生器 [英] best pseudo random number generator

查看:248
本文介绍了最佳伪随机数发生器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

到目前为止,哪个是最好的伪随机数生成器?最好的 我的意思是-

As of today which is the best pseudo random number generator? By best I mean the one that -

  1. 通过所有统计检验
  2. 即使在非常大的尺寸下也表现良好
  3. 有一个非常大的时期

我可以想到MT.有没有比MT更好的PRNG?哪种MT最好?

I can think of MT. Is there any PRNG that is better than MT? Which variant of MT is the best?

推荐答案

尝试MT的后继者:SFMT(http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT/index.html ).该首字母缩写代表面向SIMD的Fast Mersenne Twister . 它使用向量指令 例如SSE或AltiVec,以加快随机数生成.

Try MT's successor: SFMT ( http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT/index.html ). The acronym stands for SIMD-oriented Fast Mersenne Twister. It uses vector instructions, like SSE or AltiVec, to quick up random numbers generation.

此外,它显示的周期比原始MT的周期大:SFMT可以配置为使用最大2 216091 -1的周期.

Moreover it displays larger periods than the original MT: SFMT can be configured to use periods up to 2216091 -1.

最后,MT在初始化不正确时会遇到一些问题:它倾向于绘制很多0,从而导致质量差的随机数.在通过算法的重复进行补偿之前,此问题可能会持续进行多达700万次抽签.结果,SFMT还被设计为比其上级状态快得多地离开此零过量状态.

Finally, MT had some problems when badly initialized: it tended to draw lots of 0, leading to bad quality random numbers. This problem could last up to 700000 draws before being compensated by the recurrence of the algorithm. As a consequence, SFMT has also been designed to leave this zero-excess state much quicker than its elder.

检查我在本文开头提供的链接,以找到描述此算法的源代码和科学出版物.

Check the link I've given at the beginning of this post to find the source code and the scientific publications describing this algorithm.

为了明确地说服您,您可以在此处 http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT/speed.html 比较MT和SFMT生成速度的表格.在任何情况下,SFMT都比MT更快,同时提供更好的质量.

In order to definitely convince you, you can see here http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT/speed.html a table comparing generation speeds of both MT and SFMT. In any case, SFMT is quicker while laying out better qualities than MT.

-编辑以下评论-

更一般而言,在选择PRNG时,需要考虑正在开发的应用程序.实际上,某些PRNG更适合某些应用程序约束.例如,MT和WELL生成器不太适合加密应用,而在处理Monte Carlo Simulations时,它们是最佳选择.

More generally, when you're choosing a PRNG, you need to take into account the application you're developing. Indeed, some PRNGs fit better to some applications constraints. MT and WELL generators for instance aren't well suited for cryptographic applications, whereas they are the best choice when dealing with Monte Carlo Simulations.

就我们而言,由于WELL的均分布特性优于SFMT,因此WELL似乎是理想的.尽管如此,WELL的运行速度也慢得多,他无法显示SFMT那样大的周期.

In our case, WELL may seem ideal thanks to its better equidistribution properties than SFMT. Nonetheless, WELL is also far slower and he's not able to display periods as large as SFMT.

结论是,PRNG不能说对所有应用程序都是最好的,而是针对特定领域和特定情况.

As a conclusion, a PRNG cannot be stated as best for all the applications, but for a particular domain and in particular circumstances withal.

这篇关于最佳伪随机数发生器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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