Docsity

Understanding Pseudorandom Number Generators and Linear Congruential Generators, Slides of Structural Analysis

Partial preview of the text

Download Understanding Pseudorandom Number Generators and Linear Congruential Generators and more Slides Structural Analysis in PDF only on Docsity!

Monte Carlo simulation approach-

Docsity.com

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

Docsity.com

4

 

mod

;

1, 2,

pseudorandom numbers

, ,

,

: Integers to be specified by user

: multiplier

0

: increment

0

: modulus

0

: a seed

0

, ,

,

0,

1

modulo

i^

i

i

i

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

i

aX

c

m

k

m

Docsity.com

5

TheoremA congruential generator has full period

if and only if

(i) gcd( ,

(ii)

1 mod

for each prime factor

of

(iii)

1mod 4 if 4 divides

m

c m

a

p

p

m

a

m

Docsity.com

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=

Docsity.com

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=

Docsity.com

10

R(i)

R(i+1)

Docsity.com

11

r

PDF of R

10000

n

Docsity.com

13

0

0

10

=

0.46140. X

X

11

12

0

0

2

2

8

X 0.

X

8

0.66680.16180.22930.

Docsity.com

14

r

PDF of R

13

3 mod 256;

100

i^

i

i

i X

X

X

X

R

m

Example

Docsity.com

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)

c=1m=

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)

a=

a=

a=

a=

Caution: hidden orders.

Docsity.com

17

How about order in higher dimensions?What is acceptable and what is not?Depends on the application.

Docsity.com

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.

Docsity.com

20

Number theory & nonlinear mapsTests for uniformityTests for independence of pairs and k-tuples

Selecting pseudorandom number generatorsTheoretical studies on random number generatorsEmpirical   Guideli

27

8

Period to be at least 2

10

-tuples (k

  1. as uniformly distributed as

possible in

0,

k

k

nes

Docsity.com