CST-501 Simulation (Period 7) : Presented by Daw Ank Phyu Win Associate Professor

You might also like

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 9

CST-501

Simulation (Period 7)

Presented by

Daw Ank Phyu Win

Associate Professor
Generation of Random Numbers

• to obtain random observations from probability distributions

• to use the RAND() function for generating random numbers


Characteristics of Random Numbers
• The probability density function of this uniform distribution
Congruential Methods for Random Number Generation

• the congruential methods (additive, multiplicative, and mixed)

• to suppose that m = 8, a = 5, c = 7, and x0 = 4.


Illustration of congruential method
Converting random integer numbers to uniform random numbers
Problem 22.3-1
• to generate a sequence of 10 one-digit random integer numbers random numbers by the mixed
congruential method
• ≡ ( 3) (modulo 10) and 2

n ( 3) (modulo 10)
0 ( 3) (modulo 10) 5
1 ( 3) (modulo 10) 8
2 ( 3) (modulo 10) 1
Homework
3 ( 3) (modulo 10) 4
to generate a sequence of eight random integer
4 ( 3) (modulo 10) 7
numbers between 0 and 7 such that ≡ (5 1) (modulo
5 ( 3) (modulo 10) 0
6 ( 3) (modulo 10) 3 8) and 1
7 ( 3) (modulo 10) 6 to generate a sequence of five two-digit random
8 ( 3) (modulo 10) 9 integer numbers such that ≡ (61 27) (modulo 100)
9 ( 3) (modulo 10) 2 and 10
Problem 22.3-2
• to convert uniform random numbers from problem 22.3-1

Random Integer Uniform Random


Number Number
5 = 0.55
8 = 0.85
1 = 0.15
4 = 0.45
7 = 0.75 Homework (refer problem 22.3-1)
0 = 0.05 to generate a sequence of eight uniform random
3 = 0.35 numbers between 0 and 7
6 = 0.65
to generate a sequence of five uniform random
9 = 0.95
numbers
2 = 0.25
Problem 22.3-6

• x0 =1, xn+1 ≡ 7xn (modulo 13) for n = 0, 1, 2, . . . .

• for n =1, 2, . . . , 12

• x1 = 7x0 (modulo 13) = 7

• x2 = 7x1 (modulo 13) = 10

• x3 = 7x2 (modulo 13) = 5

• x4 = 7x3 (modulo 13) = 9

• x5 = 11, x6 = 12, x7 = 6, x8 = 3, x9 = 8, x10 = 4, x11 = 2, x12 = 1

• appears only once in each integer

• x13, x14, ….. will repeat x1 to x12 with cycle length 12


Homework

To use the mixed congruential method


Problem 22.3-3
• to generate a sequence of five two-digit random integer numbers
• xn+1 ≡ (41xn + 33) (modulo 100) and x0 = 48.

Problem 22.3-4.
• to generate a sequence of three three-digit random integer numbers
• xn+1 ≡ (201xn + 503) (modulo 1,000) and x0 = 485.

Problem 22.3-5.
• to generate a sequence of five random integer numbers between 0 and 31
• xn+1 ≡ (13xn + 15) (modulo 32) and x0 =14.
•to convert these random integer numbers to uniform random numbers as closely as possible.

You might also like