Top
Best
New

Posted by todsacerdoti 10/28/2025

A brief history of random numbers (2018)(crates.io)
214 points | 72 commentspage 2
jcynix 10/28/2025|
If you are so inclined, you can build your own random number generator in hardware, which uses a Geiger counter: https://www.instructables.com/Arduino-True-Random-Number-Gen...
buildbot 10/28/2025||
I did not realize xorshift no longer as favored! Permuted Congruential Generators seems very cool. https://en.wikipedia.org/wiki/Permuted_congruential_generato...
adgjlsfhk1 10/29/2025|
Xorshift variations (specifically xoshiro256++ and friends) are still really good.
gwbas1c 10/28/2025||
I've always wondered, if you started recording audio, can you treat the least significant bit as random? Perhaps as an alternative to a real hardware random number generator?
arch_btw 10/28/2025|
Yeah it would be fun to play with...

I gotta think there are going to be some periodics in there that will be toggling the LSB. Like some hum from some device far away will be at the right tiny amplitude to toggle it in a predictable way. Also the ADC hardware could concievably get stuck.

The whole system breaks because someone didn't set up their pulseaudio correctly?

and what if you need 1TB of random data? With 48kHz audio you would be waiting 5000 years haha. 1MB is still more than a day

tralarpa 10/28/2025||
> and what if you need 1TB of random data? With 48kHz audio you would be waiting 5000 years haha. 1MB is still more than a day

I think you dropped the "k" in "kHz" in your calculations.

a-dub 10/28/2025||
i thought they were all built on the compression functions from secure hashes these days?
tptacek 10/28/2025|
That's how secure random number generators work. Those are suitable for almost all purposes except for simulations, where you're tapping the RNG so often that its performance really matters and demands more than the cycles/bytes of even optimized cryptography gets you.
wglb 10/29/2025||
Plus with a simulation, you may want to replicate runs.
some_furry 10/29/2025||
You can use a seeded PRNG (e.g., AES-CTR-DRBG) and get replication while still preserving cryptographic security.
nzeid 10/28/2025||
> So, just using any old LCG wasn't good enough, you had to use one made by someone with a PhD in mathematics. Donald Knuth shook his fist at the world and shouted "Hah! I told you so!", published a book on how to do it Right that most people didn't read, and then went back into his Fortress of Solitude to write TeX.

Haaaaaaaaaaaaaaa, I believe every word of this.

Cold_Miserable 10/28/2025||
Xorshift, LCM and hardware rdrand work just fine. PCG and Weyl are overkill.
camel-cdr 10/28/2025||
sure, a += b is overkill
rurban 10/28/2025||
Hardware rdrand, lol! Totally broken
NoSalt 10/28/2025||
I dunno ... his saucy language made this very difficult to read.
butlike 10/28/2025||
Please tell me if I'm off-base here, but something I always thought about and have been toying with is the notion that "there's no true random in this universe."

From a particle physics perspective, as an observer in the electromagnetic spectrum, we're always observing through a reference frame based on the speed of light in relation to the observed object. Because it's always in reference to a constant, c, anything perceived at random can theoretically be measured if you had the position of the observer at the time of observation, right?

Am I way off-base here?

kryptiskt 10/28/2025|
Any fan of determinism would need to tackle quantum physics and what seems like unavoidable randomness in it (and there are such theories, but they offer little hope of getting around the randomness from our point of view, since they hide the order from us). The typical example of a random phenomena in nature is radioactive decay. You can't predict when any given nucleus will decay, only the probability that it will happen (which gives the half-life).
butlike 10/29/2025||
Fair enough. Thanks!
SAYANG13 10/28/2025||
[flagged]
SAYANG13 10/28/2025|
[flagged]
SAYANG13 10/28/2025||
[flagged]
websku 10/28/2025|
random numbers are not exactly random.
nachox999 10/28/2025|
natural random numbers are not (exactly) random or artifical generated random numbers are not (exactly) random?