Random Numbers
Random Numbers
Random numbers are a necessary basic ingredient in the simulation of almost all
discrete systems.
Most computer languages have a subroutine, object, or function that will generate a
random number.
Similarly, simulation languages generate random numbers that are used to generate
event times and other random variables.
The generation of random numbers and their subsequent testing for randomness
shows how random numbers are used to generate a random variable with any desired
probability distribution
PROPERTIES OF RANDOM NUMBERS
A sequence of random numbers, 𝑅1 , R2 , ••• , must have two important statistical
properties: uniformity and independence. Each random number Ri ; must be an
independent sample drawn from a continuous uniform distribution between zero and 1
• That is, the pdf is given by
The routine should be fast. Individual computations are inexpensive, but simulation could
require many millions of random numbers. The total cost can be managed by selecting a
computationally efficient method ( Analytic Model) of random number generation.
The routine should be portable to different compute and ideally, to different programming
languages. This is desirable so that the simulation program will produce the same results
wherever it is executed.
The routine should have a sufficiently long cycle. The cycle length, or period, represents the
length of the random number sequence before previous numbers begin to repeat themselves
in an earlier order. Thus, if 10,000 events are to be generated, the period should be many
limes that long. A special case of cycling is degenerating. A routine degenerates when the
same random numbers appear repeatedly. Such an occurrence is certainly unacceptable. This
can happen rapidly with some methods.
The random numbers should be replicable. Given the starting point (or conditions) it should
be possible to generate the same set of random numbers. completely independent of the
system that is being simulated. This is helpful for debugging purposes and is a means of
facilitating comparisons between systems
TECHNIQUES FOR GENERATING RANDOM NUMBERS
X i 1 ( aX i c )mod( m ) i 0,1,2,
The initial value 𝑋 0 is called the seed, a is called the multiplier, c is the increment, and m is the
modulus.
If c not equal to 0 in Equation, then the form is called the mixed congruential method. When c = 0, the
form is known as the multiplicative congruential method. The selection of the values for a, c, m, and X 0
drastically
𝑛
1.If the interval [0, l] is divided into classes, or subintervals of equal length, the expected number of
observations in each interval is 𝑁 , where N is the total number of observations.
𝑛
2. The probability of observing a value in a particular interval is independent of the previous values drawn.
.
Notice that the title has the word "pseudo" in it. "Pseudo" means false, so false random numbers are being
generated! In this instance, "pseudo" is used to imply that the very act of generating random numbers by a
known method removes the potential for true randomness. If the method is known, the set of random numbers
can be replicated. Then an argument can be made that the numbers are not truly random. The goal of any
generation scheme, however, is to produce a sequence of numbers between 0 and l that simulates, or imitates,
the ideal properties of uniform distribution and independence as closely as possible.
To be sure, in the generation of pseudo-random numbers, certain problems or errors
can occur