30 CHAPTER 3. RANDOM NUMBER GENERATION
to work on all computers. Another benefit of this is that it avoids an exact zero which can
cause problems in certain sampling algorithms. We will see more on this later. Although
the endpoints of the distribution are truncated, it usually has no effect. Moreover, if you are
depending upon good uniformity at the endpoints of the random number distribution, then
you probably have to resort to special techniques to obtain them.
3.2 Long sequence random number generators
For many practical applications, cycle lengths of one or four billion are just simply inade-
quate. In fact, a modern workstation just calculating random numbers with these RNG’s
would cycle them in just a few minutes!
One approach is to employ longer integers! The identical algorithm may be employed with
64-bit integers producing a sequence length of 2
64
or about 1.84 × 10
19
inthecaseofthe
LCRNG or 2
62
or about 4.61×10
18
for the MCRNG. A well-studied multiplier for this purpose
is a = 6364136223846793005. This 64-bit RNG is an excellent choice for the emerging 64-bit
architectures (assuming that they support 64-bit 2’s complement integer arithmetic) or it
can be “faked” using 32-bit architectures [Bie86]. However, this latter approach is no longer
recommended since more powerful long-sequence RNG’s have been developed.
A new approach called the “subtract-with-borrow” algorithm was developed by George
Marsaglia and co-workers [MZT90, MZ91]. This algorithm was very attractive. It was
implemented in floating-point arithmetic and was portable to all machines. Initialization
and restart capabilities are more involved than for LCRNG’s but the long sequence lengths
and speed of execution make it worthwhile.
Tezuka, l’Ecuyer and Couture [TlC93, Tez94, Cl96] proved that Marsaglia’s algorithm is in
fact equivalent to a linear congruential generator but with a very big integer word length
which greatly reduced the “spectral” anomalies. Since LCRNG’s are so well-studied this is
actually a comfort since for a while the “subtract-with-borrow” algorithm were being em-
ployed with little theoretical understanding, something many researchers felt uncomfortable
with.
The spectral property of this new class of generator has been addressed by L¨uscher [L
¨
94] who
used Kolmogorov’s chaos theory to show how the algorithm could be improved by skipping
some random numbers.
A version of L¨uscher’s algorithm [Jam94] will be distributed with the source library routines
associated with this course. However, keep in mind that the mathematics of random number
generation is still in its infancy. If you take up a Monte Carlo project at some time in the
future, make sure you become well-informed as to the “state-of-the-art”.
An example of Marsaglia and Zaman’s “subtract-with-borrow” algorithm is given as follows: