蹩脚的随机数发生器随机数、蹩脚、发生器

2023-09-11 22:55:39 作者:没心没肺活着不累

这听起来像一个奇怪的问题,但我在哪里可以找到一个随机数生成器,在C或C ++,是不是很好的作品?

This may sound like an odd question, but where can I find a random number generator that works in C or C++ that is not very good?

上下文:我创造了一些树图绘制软件,并使用多位数的随机数测试它(所以每个数字变成了树中的节点)。随机数发生器我一直在使用 - 它是自带的GNU C ++编译器之一 - 给了我价值的一个很好的小号$ P $垫。这是很好的,但我想看看表格的外观,当数字聚集在一起,而且不太均匀。

Context: I'm creating some tree graph plotting software and testing it by using multi-digit random numbers (so each digit becomes a node in the tree). The random number generator I've been using - which is the one that comes with the GNU C++ compiler - gives me a nice spread of values. That's good, but I want to see how the table looks when the numbers clump together and are less homogenous.

任何人都可以表明,已被证明是不那么随机的?一个随机数发生器

Can anyone suggest a random number generator that has been proven to be not-so-random?

(呵呵,谁链接的任何人到XKCD和/或建议我只返回4将得到讥讽回应)。

(Oh, any anyone who links to xkcd and/or suggests I just return 4 will get sarcasm in response).

推荐答案

我一直认为的 RANDU 作为不良随机数发生器的教父。

I've always thought of randu as the godfather of bad random number generators.