5.4 Pseudorandom Numbers
Pseudorandom numbers may come from various sources. On computers, they are usually specified by deterministic algorithms called pseudorandom number generators. A pseudorandom number generator works by accepting one or more seed values. These may be specified by the user or drawn from an internal clock or other routine running on the computer. The pseudorandom number generator then calculates numbers recursively based on these.
Researchers devote considerable effort to designing generators whose output passes empirical tests for pseudorandomness. This saves users the trouble of performing empirical tests every time they use pseudorandom numbers from these generators. Of course, there is no perfect pseudorandom number generator. No matter how sophisticated a generator may be, it is possible to design an empirical test that its output will fail. It is useful to keep this in mind when selecting a generator for any application. A poor choice of generator can introduce a bias in Monte Carlo results. Such bias is a separate error from the standard error associated with statistical estimation. Using larger sample sizes cannot eliminate it. The problem is with the generator, or more specifically, an incompatibility between the generator and the application. Gärtner (1999) describes an actual Monte Carlo analysis that was performed using a well-known linear congruential generator.12 The results were a little too interesting. Subsequent analysis revealed the pseudorandom numbers to be correlated with the application.