Random Number Generation

748 views

Why is it that true random number generation is virtually impossible for current computers to achieve? I build and fix computer hardware as part of my living, but I still don’t understand this. Please explain?

In: 3

10 Answers

Anonymous 0 Comments

# Part 1 – Nothing is “truly random”

Well, what does “true random” even mean?

If I flip a coin, is that truly random? If you knew what speed I flipped it at, how high it will go, and at what height it would be caught, you could technically calculate how many times it would flip in the air, and then predict whether it will land heads or tails.

So, in that sense, coin flips aren’t even “truly random”.

But they are “random enough”, because humans basically can’t calculate those things fast enough in order to make a prediction before the coin lands.

And this is true of basically any “random” process. Shuffling cards? If you had a high-speed camera and recorded the shuffle, you could technically figure out the order of the cards. Rolling dice? If you knew the speed of the throw and the rotation, it might be possible to simulate how the dice will tumble and what numbers will show up in the end.

Taken to the extreme, if you were an all-knowing-god and knew how every molecule, atom, and electron was going to move according to the laws of physics, then you could predict anything that would happen. Everything moves according to rules.

So, in some ways, there is no such thing as “random”. And in this sense, true random number generation is impossible.

# Part 2 – How “un-random” are computers?

How computers generate random numbers is called “pseudo-random number generation”. It just uses a math formula: take a number, divide it by a really big number, do all sorts of weird calculations things to it, until the answer is completely unrelated to the original number. That way, we can feed it in a predictable number, and then it gives us a completely unrelated number.

Unless you know what math formula the computer is using. Then you can predict it easily.

And again, sometimes that’s “random enough”, but sometimes it isn’t (especially when there’s a lot of money on the line, like gambling). So can we get any *more* random than that?

Well, yes and no. Computers can only follow instructions — all they can do is take an input, do a fixed set of instructions using the input, then give an output. So, since instructions are fixed and cannot be random, it would seem that computers can’t *really* produce random numbers.

The closest we can get is “randomizing” the input we give it.

One way of doing this is using the internal clock as an input. Computers keep time to a very accurate degree, usually down to the millisecond. If a human pressed a “generate random number” button on the computer, the computer could use the current millisecond that the button was pressed, then the input would, more or less, be completely random, since no one can predict exactly what millisecond the button will be pressed.

The are other ways of providing “random enough” input as well, even without human input. One computer security company [points webcams at lava lamps](https://www.youtube.com/watch?v=1cUUfMeOijg), and uses what the camera sees as input for their computers’ pseudo-random number generators. Some companies [put radioactive materials in their computers](https://www.youtube.com/watch?v=SxP30euw3-0) and use as input the count of the exact amount of radiation emitted at any given time, which is also highly unpredictable.

So while it’s technically true that computers can never produce “truly random” numbers, we’ve already reached the point where they can produce numbers that are basically unpredictable, unless you are an all-knowing god.

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