Presentation is loading. Please wait.

Presentation is loading. Please wait.

Random Number and Random Variate Generation

Similar presentations


Presentation on theme: "Random Number and Random Variate Generation"— Presentation transcript:

1 Random Number and Random Variate Generation

2 Random Number Generation
One early method – the midsquare method (von Neumann and Metropolis 1940) Start with a four digit positive integer Z0. Square Z0 to get an integer with up to eight digits (append zeros if less than eight). Take the middle four digits as the next four digit integer Z1. Place a decimal point to the left of Z1 to form the first “U(0,1)” observation. Repeat

3 Random Number Generation - MidSquare
Example: X0 = 7182 (seed) = ==> R1 = = (5811) 2 = ==> R2 = etc. 30

4 Random Number Generation- MidSquare
Note: Cannot choose a seed that guarantees that the sequence will not degenerate and will have a long period. Also, zeros, once they appear, are carried in subsequent numbers. Ex1: X0 = 5197 (seed) = ==> R1 = = ==> R2 = Ex2: X0 = 4500 (seed) = ==> R1 = = ==> R2 = 30


Download ppt "Random Number and Random Variate Generation"

Similar presentations


Ads by Google