Presentation is loading. Please wait.

Presentation is loading. Please wait.

Random Number Generator. Random number Random number: Uniform distribution on [0,1] Random device: dice, coin -> cannot generate the equal sequence.

Similar presentations


Presentation on theme: "Random Number Generator. Random number Random number: Uniform distribution on [0,1] Random device: dice, coin -> cannot generate the equal sequence."— Presentation transcript:

1 Random Number Generator

2 Random number Random number: Uniform distribution on [0,1] Random device: dice, coin -> cannot generate the equal sequence

3 Midsquare Method Z0=four digit positive integer = 7182 –Z02=51581124 Z1=mid four digit of z02 = 5811 –Z12=33767721 Z2= mid four digit of Z12 = 7677 Disadvantage: if Zi=XXooooXX and Zi+1=XXooooXX then repeat

4 Fibonacci Method Xi=(Xi-1+Xi-2) mod m = remainder of (Xi-1+Xi-2)/m Ex: m=100, X0=1, X1=1 X2=(1+1) mod 100 = 2 X3=(2+1) mod 100 = 3 X4=(3+2) mod 100 = 5 Serial Correlation

5 Linear Congruential Method Z i =(aZ i-1 +C) mod m m: modulus m>0 a: multiplier a<m c: increment c<m Z 0 : seed Z 0 <m 0 ≦ Z i ≦ m-1 Let U i =Z i /m ~ U(0,1) 0 ≦ U i ≦ (m-1)/m


Download ppt "Random Number Generator. Random number Random number: Uniform distribution on [0,1] Random device: dice, coin -> cannot generate the equal sequence."

Similar presentations


Ads by Google