论文标题
随机数发生器会产生碰撞:为什么,多少
Random number generators produce collisions: Why, how many and more
论文作者
论文摘要
令人惊讶的是,应用广泛使用的随机数发生器在现代体系结构上生成100万个随机数时,平均而言,大约有116次碰撞。本文解释了为什么如何数学上计算这样的数字,为什么通常无法直接地获得它们,如何以鲁棒的方式在数值上计算它们,除其他外,还需要更改以使该数字以下1以下。至少要解决一个碰撞的可能性,至少解决了一个碰撞,这也是短暂地解决的,事实证明,事实证明,这再次需要仔细的数值处理。总体而言,本文介绍了计算机上浮点数的表示以及在统计和仿真中的相应含义。所有计算均在R中进行,并且可与本文中包含的代码重现。
It seems surprising that when applying widely used random number generators to generate one million random numbers on modern architectures, one obtains, on average, about 116 collisions. This article explains why, how to mathematically compute such a number, why they often cannot be obtained in a straightforward way, how to numerically compute them in a robust way and, among other things, what would need to be changed to bring this number below 1. The probability of at least one collision is also briefly addressed, which, as it turns out, again needs a careful numerical treatment. Overall, the article provides an introduction to the representation of floating-point numbers on a computer and corresponding implications in statistics and simulation. All computations are carried out in R and are reproducible with the code included in this article.