How do random number generators work?

266 views

How do random number generators work?

In: 119

10 Answers

Anonymous 0 Comments

For pseudo-random number generators, take a process that generates a chaotic, but deterministic string of numbers. Index into it at a somewhat random location (called a Seed) and use that.

For example, Pi is chaotic (non-repeating but deterministic). If you are looking for random numbers between 0-9, you can take a ‘seed’ which is just the number of decimal places to go to, and start reading decimals. So this algorithm with seed 542 would be: 9 0 7 0 2 1 7 9 8 and so on.

This is deterministic, anyone with the same algorithm and seed would get the same numbers. But unless you know what to look for, it will appear to be random.

Non-deterministic random number generators will use a process that is not repeatable. The common way this is done is to use sensor noise. For instance, take a microphone, and measure something. Like if a microphone is sensitive to xx.yy, measure to xx.yyzzzzzzzzzzzzzAA. AA is likely to be raw noise and totally random, for the purposes of a generator. Other common systems include cameras pointed at lava lamps (really!) or looking at the higher order bits from images. While theoretically if you set up the exact same physical experiment (with the sensors in the exact same state of being/wear) it would be deterministic, practically, due to physical process, those trailing bits are essentially random.

There are other ways to do it too of course, but those are the common ones.

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