How do you use a random number generator?


Quick Answer

Use a random number generator by providing a range of numbers from which to generate one number and then initiating it to start. The generator outputs a random number from within the provided range.

Continue Reading

Full Answer

While the name implies that the generator provides entirely random numbers, this is not true, because it is impossible for a computer to generate anything truly at random. A random number generator uses what is called a seed. A seed is an arbitrary input taken from within the system, usually from the clock of the computer running the generator. This appears to be random, as the clock cannot be easily altered or controlled by the user. The arbitrary data taken from the clock is then interpreted back into a number within the specified range. Every time the random number generator is initiated, it uses the current system clock time down to the CPU cycle. This means that the number is different every time it is generated, and duplicating the results becomes nearly impossible, at least without additional computer aid.

The closest that a random number generator can be to true randomness is if the arbitrary input data is taken from a system outside of a computer, such as atmospheric noise, such as the one used by random.org.

Learn more about Numbers

Related Questions