


















































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!



















































































2
1
Let
be a random variable with PDF
.
How to generate samples
of
on a computer
so that the these numbers are statistically indistinguishablef
X
n
i^
i
X
P
x
x
X
Digital simulation of samples of random variables
rom realizations of the random variable
?
X
4
mod
;
1, 2,
pseudorandom numbers
, ,
,
: Integers to be specified by user
: multiplier
0
: increment
0
: modulus
0
: a seed
0
, ,
,
0,
1
modulo
X
aX
c
m
i
X
R
m
a c m Xa c m X a c m X
m
m
Linear congruential generators
: returns the remainder after dividing
by
.
Period
aX
c
m
k
m
5
7
9
3 mod 2 ;
12
i^
i
i
i X
X
X
X
R
m
Example
0.50000.68750.37500.56250.25000.43750.12500.
0
0.18750.87500.
0.50000.68750.37500.56250.25000.43750.12500.
0
0.18750.87500.
0
5
10
15
20
25
30
35
0 0.9 0.8 0.7 0.6 0.5 0.4 0.3 0.2 0.
1
i
R(i)
Period=
8
906185749
1 mod 2
;
12
i^
i
i
i X
X
X
X
R
m
Example
0
10
20
30
40
50
60
70
80
90
100
0 0.9 0.8 0.7 0.6 0.5 0.4 0.3 0.2 0.
1
i
R(i)
Period=
10
R(i)
R(i+1)
11
r
PDF of R
10000
n
13
0
0
10
=
0.46140. X
X
11
12
0
0
2
2
8
X 0.
X
8
0.66680.16180.22930.
14
r
PDF of R
13
3 mod 256;
100
i^
i
i
i X
X
X
X
R
m
Example
16
0
1
0 0.9 0.8 0.7 0.6 0.5 0.4 0.3 0.2 0.
1
x(i)
x(i+1)
0
1
0 0.9 0.8 0.7 0.6 0.5 0.4 0.3 0.2 0.
1
x(i)
x(i+1)
0
1
0 0.9 0.8 0.7 0.6 0.5 0.4 0.3 0.2 0.
1
x(i)
x(i+1)
0
1
0 0.9 0.8 0.7 0.6 0.5 0.4 0.3 0.2 0.
1
x(i)
x(i+1)
17
19
0
Store
: helps to reproduce the sequence
and avoid storage of random number sequences.
Use the end of a sequence as a seed in the next sequence
Start a new sequence with a randomly chos
X
Choice of seed
en seed
(clock time on the CPU): this approach leadsto numbers that are not reproducible.
20
Number theory & nonlinear mapsTests for uniformityTests for independence of pairs and k-tuples
Selecting pseudorandom number generatorsTheoretical studies on random number generators Empirical Guideli
27
8
Period to be at least 2
10
-tuples (k
possible in
0,
k
k
nes