RandomNumberGeneration

# RandomNumberGeneration - CPE 619 Random-Number Generation...

This preview shows pages 1–13. Sign up to view the full content.

CPE 619 Random-Number Generation Aleksandar Milenković The LaCASA Laboratory Electrical and Computer Engineering Department The University of Alabama in Huntsville http://www.ece.uah.edu/~milenka http://www.ece.uah.edu/~lacasa

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
2 Overview Desired properties of a good generator Linear-congruential generators Tausworthe generators Survey of random number generators Seed selection Myths about random number generation
3 Random-Number Generation Random Number = Uniform(0, 1) Random Variate = Other distributions = Function(Random number)

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
4 A Sample Generator For example, Starting with x 0 =5: The first 32 numbers obtained by the above procedure 10, 3, 0, 1, 6, 15, 12, 13, 2, 11, 8, 9, 14, 7, 4, 5; 10, 3, 0, 1, 6, 15, 12, 13, 2, 11, 8, 9, 14, 7, 4, 5. By dividing x's by 16: 0.6250, 0.1875, 0.0000, 0.0625, 0.3750, 0.9375, 0.7500, 0.8125, 0.1250, 0.6875, 0.5000, 0.5625, 0.8750, 0.4375, 0.2500, 0.3125; 0.6250, 0.1875, 0.0000, 0.0625, 0.3750, 0.9375, 0.7500, 0.8125, 0.1250, 0.6875, 0.5000, 0.5625, 0.8750, 0.4375, 0.2500, 0.3125.
5 Terminology Seed = x 0 Pseudo-Random : Deterministic yet would pass randomness tests Generator function is known (preferred in simulations) Fully Random: Not repeatable Cycle length, Tail, Period Goal: Select appropriate generator function and appropriate value for seed

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
6 Desired Properties of a Good Generator It should be efficiently computable Repeated many times during a simulation The period should be large To benefit from possibly long simulations The successive values should be independent and uniformly distributed The correlation between successive numbers should be small (discussed in Chapter 27)
7 Types of Random-number Generators Linear congruential generators Tausworthe generators Extended Fibonacci generators Combined generators

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
8 Linear-Congruential Generators Discovered by D. H. Lehmer in 1951 The residues of successive powers of a number have good randomness properties Equivalently, a = multiplier m = modulus
9 Linear-Congruential Generators (cont’d) Lehmer's choices: a =23 and m =10 8 +1 Good for ENIAC, an 8-digit decimal machine Generalization: Can be analyzed easily using the theory of congruences Mixed Linear-Congruential Generators or Linear-Congruential Generators (LCG) Mixed = both multiplication by a and addition of b

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
10 Selection of LCG Parameters Choice of a, b, and m affect the period and autocorrelation 1) The modulus m should be large All x’s are between 0 and m-1 , the period can never be more than m 2) For mod m computation to be efficient, m should be a power of 2 Mod m can be obtained by truncation
11 Selection of LCG Parameters (cont’d) 3) If b is nonzero, the maximum possible period m is obtained if and only if: Integers m and b are relatively prime, that is, have no common factors other than 1 Every prime number that is a factor of m is also a factor of a-1 If integer m is a multiple of 4, a-1 should be a multiple of 4 Notice that all of these conditions are met if m=2 k , a = 4c + 1 , and b is odd Here, c , b , and k are positive integers

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
12 Period vs. Autocorrelation
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 58

RandomNumberGeneration - CPE 619 Random-Number Generation...

This preview shows document pages 1 - 13. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online