Many programs require the use of "random" data. Although most students immediately think of games when asked for applications of random behavior, random numbers play more important roles in the computer science field. Two important applications are Program Testing and Debugging and Simulation.

When testing and debugging a program, it is common to write another program that does nothing but repeatedly run the first program with numerous input. Having a program test another program can be faster than having a human test a program, especially when there are many possible inputs that need to be tested. The test program often uses randomly generated data to check the performance of the other program.

Another common use of random numbers is simulation. Many "real life" situations are impractical or expensive to experiment on, or happen so infrequently that test data is hard to come by. Today, many designs are tested and modified using computer simulations of real life events. For example, when designing a new car, a company may want to experiment with automobile crashes before actually producing the car. Not only is this practice expensive (having to build several cars and crash them under various situations), it is also potentially dangerous. By simulating the accidents with computers, the car company can hope to work out as many design issues as possible before building experimental vehicles.

Use for Random Number Generators:

It is often useful for a computer program to produce "random" behavior:

A good random number generator is useful in these situations and can provide statistically reliable results.