1 / 9

Random Number Generators

Random Number Generators. x n = f ( x n-1 , x n-2 ) where x 0 is seed Pseudo-random since, given the same seed, the sequence is repeatable and deterministic Cycle length – length of repeating sequence Example: x n = a x n-1 + b mod m. seed. cycle. period. k. D = S.

kail
Télécharger la présentation

Random Number Generators

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Random Number Generators xn = f ( xn-1, xn-2) where x0 is seed • Pseudo-random since, given the same seed, the sequence is repeatable and deterministic • Cycle length – length of repeating sequence • Example: xn = a xn-1 + b mod m seed cycle period

  2. k D = S (oi – ei)2 ei i=1 Testing Random Numbers Chi-Square test • Discreet distributions, large sample sizes, general • Does an observed data set satisfy a specified distribution? • Prepare a histogram of observed data – k cells • D has chi-square distribution with k-1 degrees of freedom • Null hypothesis that observations come from distribution can not be rejected at significance a if computed D is less than C 2[1-a;k-1] • Works best with equiprobable cells – cell sizes so the frequencies are equal.

  3. Chi-Square Example (observed-expected)2 expected 6.25 0.49 0.25 0.09 0.0 0.16 0.04 0.49 0.36 2.25 Sum = 10.38 whereas X 2[0.9;9] = 14.68

  4. K+ = n max [Fo(x) – Fe(x)] x K- = n max [Fe(x) – Fo(x)] x Testing Random Numbers Kolmogorov-Smirnov test • Continuous distributions, small sample sizes, general • Based on differences between observed and expected CDFs • If K+ and K- are smaller than K[1-a;n] the observations are said to come from the distribution with level of significance a.

  5. Kolmogorov-Smirnov Example Fo(xi) – Fe(xi) Fe(xi+1) – Fo(xi)

  6. Kolmogorov-Smirnov Example j/n - xj xj – (j-1)/n

  7. n-k 1 Rk = S (Ui – ½)(Ui+k – ½) n-k i=1 Rk! z1-a/2 /(12 n-k) Testing Random Numbers Serial-Correlation test • For a sequence of numbers, compute covariance between numbers that are k apart: xi and xi+k • Autocovariance at lag k, do for range of lags. • If the C.I. includes zero, not significant correlation 100(1-a)% CI:

  8. Random Number Generators cycle seed period What does a test say about this sample?

  9. Simulation Techniques Overview Simulation environments emulation Workloadparameters exec-drivensim SystemConfigparameters Result Data trace-drivensim -> discussion of timing-firstpaper Factorlevels stochasticsim

More Related