how do random number generators work?

813 views

how do random number generators work?

In: Technology

5 Answers

Anonymous 0 Comments

The random number generators in computer programs work by generating a sequence of numbers that’s statistically random, this means that all numbers appear with the same frequency.

An example of a statisticllay random sequence *could* be the digits of pi. We can’t proove mathematically that the sequence of pi digits is statistically random, but for practical purposes it might just be because as far as we know all digits appear with pretty much the same frequency. Thus a pseudo-random number generator could be simply a program that returns the digits of pi.

Of course there’s a flaw here, the decimals of pi can be calculated so the output of such generator is totally predictable even if it’s statistically random, that’s what pseudo-randomness means.

All programs generating random numbers work in a very similar way, they take an input, they calculate something using that input and return a statistically random output, yet any output can be reproduced if you know the original input, therefore it’s predictable. In order to make up for this they tend to use hard to guess inputs like the number of milliseconds ellapsed since the computer was turned on or data from some sensors in the computer.

You are viewing 1 out of 5 answers, click here to view all answers.