Computational Physics

(Rick Simeone) #1

608 Appendix B


behaviour in any test so far[4]. The sequence lengths in all these examples might
seem large, but in practice they are not sufficient for large-scale simulations, so that
sometimes one has to look for generators with larger periods.
Before treating another type of random number generator, we discuss statist-
ical deficiencies intrinsic to all types of generators, although some suffer more
from them than others. It turns out that when pairs of subsequent random num-
bers from a sequence are considered, fairly small correlations are found between
them. However, if triples or higher multiples of subsequent random numbers are
taken, the correlations become stronger. This can be shown by taking triples of
random numbers, for example, and considering these as the indices of points in
three-dimensional space. For pure random numbers, these points should fill the
unit cube homogeneously, but for pseudo-random sequences from a modulo gen-
erator, the points fall near a set of parallel planes. A theoretical upper bound to the
number of such planes in dimensiondhas been found[8]– it is given by(d!m)^1 /d.
In general one can say that the better the random number generator, the more planes
fill thed-dimensional hypercube. It is not clear to what extent such deviations from
pure random sequences influence the outcome of simulations using random number
generators: this depends on the type of simulation.
In the case of the modulo random number generator, the importance of correla-
tions varies with the multipliera. A small value of the multiplierafor example
results in a small random numberxi to be followed by a few more relatively
small numbers, and this is of course highly correlated. To obtain a good multiplier,
extensive tests have to be performed [4, 7].
It should be stressed that bad random number generators abound in cur-
rently available software, and it is recommended to check the results of any
simulation with different random number generators. Surprisingly, random gen-
erators may be better on paper than others but have less favourable properties
in particular simulations. It has been noted, for example, that the simple mod-
ulo generator has better properties in cluster Monte Carlo simulations (see
Section 15.5.1) than several others that perform better in general statistical tests[9],
because the formation of the clusters induces a higher sensitivity to long-range
correlations.
A second example of a random number generator, which suffers less from cor-
relations than the modulo generator, is a shift-register generator. This works as
follows. The random numbers are strings of, say,rbits. Each bit of the next number
in the sequence is determined by the corresponding bits of the previousnnumbers.
If we denote thekth bit of theith number in the sequence byb(ik), we can write
down the production rule for the new bits:


b(ik)=(c 1 b(i−k) 1 +c 2 b(i−k) 2 +···+cnb(ik−)n)mod 2 (B.4)
Free download pdf