Professional Documents
Culture Documents
Class 7 END322 Spring2019 StudentV Online
Class 7 END322 Spring2019 StudentV Online
1, 0 x 1
f ( x)
0, otherwise
1
2
1 x 1
0
E ( R ) xdx
2
0
2
3 1 2
x 1 1 1 1
V ( R) x 2 dx E R
1 2
0 3 0 2 3 4 12
16/04/2019 END322E System Simulation 4
Generation of Pseudo-Random Numbers
• “Pseudo”, because generating numbers using a known method removes the
potential for true randomness.
• Goal: To produce a sequence of numbers in [0,1] that simulates, or imitates, the
ideal properties of random numbers (RN).
• Important considerations in RN routines:
• Fast
• Portable to different computers
• Have sufficiently long cycle
• Replicable
• Closely approximate the ideal statistical properties of uniformity and
independence.
• The selection of the values for a, c, m, and X0 drastically affects the statistical properties and the
cycle length.
• The random integers are being generated [0,m-1], and to convert the integers to random numbers:
Xi
Ri , i 1,2,...
m
• If c= 0, LCG is called a multiplicative generator
i 0
Xi 0
Ri 0
• In any case, if m is small, you’ll get quick cycling whether or not the
generator is full period. “Small” could mean anything less than 2
billion or so.
• And just because m is big, you still have to be careful. In addition to
above, some subtle problems can arise. Take a look at IBM’s RANDU.
(m 1)( m2 1)...( mk 1)
• The maximum possible
P 1 period is:
k 1
2
Step 3:
Step 4: