Random Number Generators

125 viewsMathematicsOther

How does a mechanical random number generator differ from a pseudo-random number generator?
Thanks in advance!

In: Mathematics

5 Answers

Anonymous 0 Comments

I’m guessing you mean “hardware random number generator” not “mechanical random number generator”?

Lets start with pseudo-random number generators. These use some complex maths to create numbers that look random, but are entirely predictable. You put a number in, and they spit their random-looking number out.

For example, lets say the pseudo-random number function is called rnd(). You could make a sequence of 5 random numbers like this:

rnd(1) = 53656
rnd(2) = 48042
rnd(3) = 87968
rnd(4) = 1228
rnd(5) = 74576

To generate more random numbers you just keep increasing the number you give it by 1. However if you went back and did rnd(3) again you would always get 87968. In theory you might even be able to work backwards, knowing that say 1228 came from rnd(4) which would let you predict the next numbers. Not great for numbers that are supposed to be random!

Of course usually the numbers you’d feed it would be much higher than starting from 1, but the principal is the same. The start number you use is called the “seed”, often it might be say the exact date and time to the nearest millisecond that the computer boots plus or minus some other number just to mix it up a bit. That way you will get a different sequence of random numbers each time.

Now hardware random number generators use actual physical processes that are properly random. A common one is to count a radioactive element decaying because that is truly random. Or point a webcam at a lava lamp and convert the image into numbers, letting thermodynamics be the randomness. You could even flip physical dice and use a webcam to count the faces.

This is much slower than just using a random function, but unlike a random function the numbers you get are not predictable.

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