95
play

95 LEcuyer The state evolves according to the recurrence s i = of - PDF document

Proceedings of the 2001 Winter Simulation Conference B. A. Peters, J. S. Smith, D. J. Medeiros, and M. W. Rohrer, eds. SOFTWARE FOR UNIFORM RANDOM NUMBER GENERATION: DISTINGUISHING THE GOOD AND THE BAD Pierre LEcuyer Dpartement


  1. Proceedings of the 2001 Winter Simulation Conference B. A. Peters, J. S. Smith, D. J. Medeiros, and M. 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 simplistic and unsafe RNGs still abound in commercial software. Concrete examples are given in Section 4 of this The requirements, design principles, and statistical testing paper. approaches of uniform random number generators for sim- A single RNG does not always suffice for simulation. In ulation are briefly surveyed. An object-oriented random many applications, several “independent” random number number package where random number streams can be cre- streams (which can be interpreted as distinct RNGs) are ated at will, and with convenient tools for manipulating the required, with appropriate tools to jump around within these streams, is presented. A version of this package is now streams, for instance to make independent runs and to implemented in the Arena and AutoMod simulation tools. facilitate the implementation of certain variance reduction We also test some random number generators available in techniques (Bratley, Fox, and Schrage 1987; Law and Kelton popular software environments such as Microsoft’s Excel 2000). Packages implementing such RNG streams are now and Visual Basic , SUN’s Java , etc., by using them on two available. One of them, which we describe in Section 5, very simple simulation problems. They fail the tests by a has been implemented in the most recent releases of the wide margin. Arena and AutoMod simulation environments. In the remainder of this section, we give a mathematical 1 WHAT ARE WE LOOKING FOR? definition of an RNG, then we discuss design principles, quality criteria, and statistical testing. In Section 2, we 1.1 Introduction review a few important classes of RNGs based on linear recurrences in modular arithmetic. In Section 3, we de- The aim of (pseudo)random number generators (RNGs) is scribe two very simple simulation problems which can be to implement an imitation of the abstract mathematical con- used as statistical tests (because a very good approximation cept of mutually independent random variables uniformly of the exact answer is known). In Section 4, we see how distributed over the interval [ 0 , 1 ] (i.i.d. U [ 0 , 1 ] , for short). certain widely-used generators perform on these tests. Sec- Such RNGs are required not only for stochastic simulation, tion 5 gives a quick overview of an object-oriented RNG but for many other applications involving computers, such package with multiple streams and substreams. It offer as statistical experiments, numerical analysis, probabilistic facilities that should be included, we believe, in every se- algorithms, computer games, cryptology and security proto- rious general-purpose discrete-event stochastic simulation cols in communications, gambling machines, virtual casinos software. Implementations are available in C, C++, and over the internet, and so on. Random variables from other Java. distributions than the standard uniform are simulated by ap- plying appropriate transformations to the uniform random 1.2 Definition numbers (Law and Kelton 2000). Various RNGs are available in computer software li- Mathematically, an uniform RNG can be defined (see braries. These RNGs are in fact small computer programs L’Ecuyer 1994) as a structure ( S , µ, f , U , g ) , where S is a implementing (ideally) carefully crafted algorithms, whose finite set of states , µ is a probability distribution on S used design should be based on solid mathematical analysis. Are to select the initial state s 0 (called the seed ), f : S → S these RNGs all reliable? Unfortunately, despite repeated is the transition function , U = [ 0 , 1 ] is the output set , and warnings over the past years about certain classes of genera- g : S → U is the output function . tors, and despite the availability of much better alternatives, 95

Recommend


More recommend