Proceedings of the 2001 Winter Simulation Conference
B
.A
.Pe
ters
,J
.S
.Sm
i
th
,D
.J
.Mede
iros
,andM
.W
.Rohrer
,eds
.
SOFTWARE FOR UNIFORM RANDOM NUMBER GENERATION:
DISTINGUISHING THE GOOD AND THE BAD
Pierre L’Ecuyer
Département d’Informatique et de Recherche Opérationnelle
Université de Montréal, C.P. 6128, Succ. Centre-Ville
Montréal, H3C 3J7, CANADA
ABSTRACT
The requirements, design principles, and statistical testing
approaches of uniform random number generators for sim-
ulation are brieFy surveyed. An object-oriented random
number package where random number streams can be cre-
ated at will, and with convenient tools for manipulating the
streams, is presented. A version of this package is now
implemented in the
Arena
and
AutoMod
simulation tools.
We also test some random number generators available in
popular software environments such as Microsoft’s
Excel
and
Visual Basic
, SUN’s
Java
, etc., by using them on two
very simple simulation problems. They fail the tests by a
wide margin.
1
WHAT ARE WE LOOKING FOR?
1.1 Introduction
The aim of (pseudo)random number generators (RNGs) is
to implement an imitation of the abstract mathematical con-
cept of mutually independent random variables uniformly
distributed over the interval
[
0
,
1
]
(i.i.d.
U
[
0
,
1
]
, for short).
Such RNGs are required not only for stochastic simulation,
but for many other applications involving computers, such
as statistical experiments, numerical analysis, probabilistic
algorithms, computer games, cryptology and security proto-
cols in communications, gambling machines, virtual casinos
over the internet, and so on. Random variables from other
distributions than the standard uniform are simulated by ap-
plying appropriate transformations to the uniform random
numbers (Law and Kelton 2000).
Various RNGs are available in computer software li-
braries. These RNGs are in fact small computer programs
implementing (ideally) carefully crafted algorithms, whose
design should be based on solid mathematical analysis. Are
these RNGs all reliable? Unfortunately, despite repeated
warnings over the past years about certain classes of genera-
tors, and despite the availability of much better alternatives,
simplistic and unsafe RNGs still abound in commercial
software. Concrete examples are given in Section 4 of this
paper.
A single RNG does not always suf±ce for simulation. In
many applications, several “independent” random number
streams
(which can be interpreted as distinct RNGs) are
required, with appropriate tools to jump around within these
streams, for instance to make independent runs and to
facilitate the implementation of certain variance reduction
techniques(Bratley, ²ox, and Schrage 1987; Law and Kelton
2000). Packages implementing such RNG streams are now
available. One of them, which we describe in Section 5,
has been implemented in the most recent releases of the
Arena
and
AutoMod
simulation environments.