Matakuliah
Tahun
Versi
: H0332/Simulasi dan Permodelan
: 2005
: 1/1
Pertemuan #4
Random Number Generator
1
Learning Outcomes
Pada akhir pertemuan ini, diharapkan mahasiswa
akan mampu :
• Mahasiswa dapat menerapkan algoritma
pembangkitan random number (C3)
2
Outline Materi
• Random Number Generator
3
• Random-Number Generator and Generating Random Variates
1
F(x)
1
U
U(0,1)
0
Generating
Random Variates
x
0
Random-Number
Generator
4
• The Midsquare Method
Ui
Zi2
i
Zi
0
7,182
1
5,811
0.5811
33,767,721
2
7,677
0.7677
58,936,329
3
9,363
0.9363
87,665,769
4
6,657
0.6657
44,315,649
5
3,156
0.3156
09,960,336
51,581,124
5
• Linear Congruential Generators
Z i aZ i 1 c mod m
U i Zi / m
LCG Zi 5Zi 1 3mod 16, Z 0 7
i
Zi
0
7
1
6
2
Ui
i
Zi
Ui
i
Zi
Ui
i
Zi
Ui
5
10
0.625
10
9
0.563
15
4
0.250
0.375
6
5
0.313
11
0
0.000
16
7
0.438
1
0.063
7
12
0.750
12
3
0.188
17
6
0.375
3
8
0.500
8
15
0.938
13
2
0.125
18
1
0.063
4
11
0.688
9
14
0.875
14
13
0.813
19
8
0.500
6
• General Congruences
Zi g ( Zi 1, Zi 2 ,...)(mod m)
Ui Zi / m
g ( Zi 1, Z i 2 ,...) a1 Z i 1 a2 Z i 2 ... aq Z i q
a1, a2, …, aq constant
7
• Composite Generators
{Z1j} and {Z2j} : the integer sequences generated by
two different LCGs with different moduli.
Z j (Z1 j Z 2 j ) mod m
Uj
Zj
m
8
• Tausworthe and Related Generators
bi (a1 bi 1 a2 bi 2 ... aq bi q )(mod m)
c1, c2, …, cq constant
Tausworthe Generators
bi (bi r bi q )(mod 2)
9
© Copyright 2026 Paperzz