Live data from Hacker News

How Do Computers Generate Random Numbers?

digitalbunker.dev

1–10 of 52 posts

Re: How Do Computers Generate Random Numbers?

#3

The chart shows the distribution of "10,000 dice rolls," yet each potential value, 1-6, has between 6000 and 7000 hits, indicating the true number of rolls to be between 36,000 and 42,000.

You're absolutely right. The attached code was for 40K and I just mislabeled the graph. I've updated it - thanks for catching that!

Re: How Do Computers Generate Random Numbers?

#4
My personal favorite RNG is the logistical map. x_{n+1} = 4x_n(1-x_n). There is no hidden seed beyond the current output. Thus if you have a scientific calculator that lets you refer to the value on screen then you can rig it into an RNG. Seeing a simple, non-programmable machine "misbehave" and act random melts my mind a little.

Re: How Do Computers Generate Random Numbers?

#5
Just out of layman's curiosity, what would be the problem or difficulty of somehow connecting a more compact type of radio telescope that detects some level of cosmic background radiation and hooking that up to a computer. Would this not be a guaranteed way of generating truly random numbers for any need flawlessly?

I know that serious radio telescopes cost way more than any random person could afford to pay but I've certainly seen plans for smaller DIY homemade models.

Re: How Do Computers Generate Random Numbers?

#6
The Mersenne-Twister approach should certainly not be studied anymore, even if some popular old libraries still use it. It fell long out of favor, is too slow, and not good enough.

Modern PRNG's can be tested with Dieharder, TestU01 or STS and benchmarked. This article only talks about primitive old LCG's (not any good one) or MT.

Re: How Do Computers Generate Random Numbers?

#7

Just out of layman's curiosity, what would be the problem or difficulty of somehow connecting a more compact type of radio telescope that detects some level of cosmic background radiation and hooking that up to a computer. Would this not be a guaranteed way of generating truly random numbers for any need flawlessly? I know that serious radio telescopes cost way more than any random person could afford to pay but I've…

You’re not too far off. There’s for example the Quantis random number generator, which uses photons:

https://www.idquantique.com/random-number-generation/product...

From the brochure:

“ Photons - light particles - are sent one by one onto a semi-transparent mirror and detected. The exclusive events (reflection - transmission) are associated to « 0 » - « 1 » bit values.”

Re: How Do Computers Generate Random Numbers?

#8
post #6

The Mersenne-Twister approach should certainly not be studied anymore, even if some popular old libraries still use it. It fell long out of favor, is too slow, and not good enough. Modern PRNG's can be tested with Dieharder, TestU01 or STS and benchmarked. This article only talks about primitive old LCG's (not any good one) or MT.

When you say Mersenne-Twister isn't good enough, what are the other shortcomings apart from speed? It seems that even modern versions of Python are continuing to use it...

Re: How Do Computers Generate Random Numbers?

#9

Just out of layman's curiosity, what would be the problem or difficulty of somehow connecting a more compact type of radio telescope that detects some level of cosmic background radiation and hooking that up to a computer. Would this not be a guaranteed way of generating truly random numbers for any need flawlessly? I know that serious radio telescopes cost way more than any random person could afford to pay but I've…

Any stochastic data source may not (and almost certainly isn't) evenly distributed--it'll probably follow some normal distribution.

Your PRNG that reads from your telescope would need to compensate for this.

As far as using radiation to generate random numbers, check out https://www.fourmilab.ch/hotbits/

Re: How Do Computers Generate Random Numbers?

#10

Just out of layman's curiosity, what would be the problem or difficulty of somehow connecting a more compact type of radio telescope that detects some level of cosmic background radiation and hooking that up to a computer. Would this not be a guaranteed way of generating truly random numbers for any need flawlessly? I know that serious radio telescopes cost way more than any random person could afford to pay but I've…

A small radiation source works well, although the data rate is low.[1]

The idea is to count the number of events (beta particles here) per time interval. Do this twice. If count A > count B, output a 1. If count A Don't use the low-order bit of the count. That has a bias.

[1] https://www.fourmilab.ch/hotbits/

Post reply on HN