Random numbers have long been a sticky topic in math. How, using deterministic kinds of formulas, does one create truly random numbers? The answer, of course, is that it can't be done. Mathematical processes are deterministic, so once You set the problem up, there is only one possible outcome. The results are always the same.
Things look awefully bleak for trying to simulate the randomness of the world on our home computers. But we have something to fall back on: pseudorandom numbers. Pseudorandom numbers are numbers created by a deterministic function that seem to the average user to be random. The object is to get a series of numbers totally independent of each other. Pseudorandom numbers come close. There is very little correlation between any of them.
The most common way of creating pseudorandom numbers is using a linear congruential method. This is a recursive method defined as follows:
(We apologize to Lynx users, who probably can't view the subscripts and superscripts on this page properly.) This means that You start with a seed value, say 5, and plug it in for Xn. You choose appropriate values for a, c, and m, and You use the result as the Xn for the next time around. What are appropriate values for a, c, and m? That's a good question, that we're not going to answer here. We don't want to get far into random numbers. We just wanted to show You that they are pseudorandom, and are really deterministic, since, once You decide on a seed value and the constants a, c, and m, the whole sequence of numbers that this equation generates is known. It will be the same every time. Suffice it to say that You need to use a very large number for m (something on the order of 231 will do nicely), because the function actually repeats itself every so often. By using a large m, You can get more numbers (billions, if You're lucky) before it repeats.
But what if You want absolutely 100% pure random numbers? You'll have to turn to nature. Any physical phenominon has an element of randomness to it. All You have to do is find that randomness and measure it when You need a random number. If You measured, for instance, the background noise on a long wire, that would be random. This has been done before with success.
Continue with the lesson
Go back to the previous page of the lesson