1 / 9

# Random Number Generators - PowerPoint PPT Presentation

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.

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.

## PowerPoint Slideshow about 'Random Number Generators' - kail

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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

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

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.

(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

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.

Fo(xi) – Fe(xi)

Fe(xi+1) – Fo(xi)

j/n - xj

xj – (j-1)/n

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:

cycle

seed

period

Simulation environments

emulation

exec-drivensim

SystemConfigparameters

Result Data

trace-drivensim

-> discussion of timing-firstpaper

Factorlevels

stochasticsim