TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

History of Uniform Random Number Generation (2017) [pdf]

58 点作者 pncnmnp大约 1 年前

5 条评论

pixelpoet大约 1 年前
For enjoyers of French-Canadian random number generation papers&#x2F;books, there&#x27;s also this excellent book on non-uniform random variate generation by Luc Devroye: <a href="http:&#x2F;&#x2F;luc.devroye.org&#x2F;rnbookindex.html" rel="nofollow">http:&#x2F;&#x2F;luc.devroye.org&#x2F;rnbookindex.html</a>
camel-cdr大约 1 年前
I like how the earliest and easiest PRNGs are making a comeback:<p>First middle square method, just add a weyl sequence to it, and all statistical tests stop failing [0]<p><pre><code> uint64_t x, weyl; uint32_t msws(void) { x = x * x + (weyl += 0xB5AD4ECEDA1CE2A9); return x = (x &gt;&gt; 32) | (x &lt;&lt; 32); } </code></pre> And now Collatz, just add a weyl sequence to it, and all statistical tests stop failing [1]<p><pre><code> __uint128_t x; uint64_t a, weyl; __uint128_t CWG128_64(void) { x = (x | 1) * ((a += x) &gt;&gt; 1) ^ (weyl += 0xB5AD4ECEDA1CE2A9); return a &gt;&gt; 48 ^ x; } </code></pre> The fun part is that the constant used in the weyl sequence is pretty much arbitrary, it just needs to be odd and not too regular.<p>The more state of the art xoshiro, pcg, Romu, sfc64, tylo64, ... are still faster and probably safer tp use, but I like how especially the middle square weyl sequence PRNG can be very easily memorized: Square + weyl sequence, swap upper and lower bits, and return the truncated result. The weyl sequemce constant can be created with a rule of thumb: try choosing mostly destinct hex digits and make it odd.<p>[0] <a href="https:&#x2F;&#x2F;arxiv.org&#x2F;abs&#x2F;1704.00358" rel="nofollow">https:&#x2F;&#x2F;arxiv.org&#x2F;abs&#x2F;1704.00358</a><p>[1] <a href="https:&#x2F;&#x2F;arxiv.org&#x2F;abs&#x2F;2312.17043" rel="nofollow">https:&#x2F;&#x2F;arxiv.org&#x2F;abs&#x2F;2312.17043</a>
评论 #39745561 未加载
评论 #39751846 未加载
评论 #39740417 未加载
marcle大约 1 年前
The article references the SSJ Java package which is developed by the author and his colleagues. This provides implementations for many RNGs -- and some nice tools for simulations: <a href="https:&#x2F;&#x2F;github.com&#x2F;umontreal-simul&#x2F;ssj">https:&#x2F;&#x2F;github.com&#x2F;umontreal-simul&#x2F;ssj</a>
chunkyks大约 1 年前
I developed an unhealthy obsession with the RAND book in 2020,which culminated in an article on the front page of the wsj. <a href="https:&#x2F;&#x2F;www.wsj.com&#x2F;articles&#x2F;rand-million-random-digits-numbers-book-error-11600893049" rel="nofollow">https:&#x2F;&#x2F;www.wsj.com&#x2F;articles&#x2F;rand-million-random-digits-numb...</a><p>RAND used to cut copies of the punch card deck for anyone who asked, but I&#x27;m sadly unable to find anyone who&#x27;s still got a copy.
nyrikki大约 1 年前
Implementing the Blum Blum Shub algorithm was my first real programming task for a gaming website in 95.<p>Way too slow on Alphas at the time for primary use but OK for seed at the time.<p>I still remember SGI publishing LavaRand, using lava lamps and cc&#x27;d cameras as an entropy source around the same time.