Random number generators
Download
1 / 9

Random Number Generators - PowerPoint PPT Presentation


  • 79 Views
  • Uploaded on

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.

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

PowerPoint Slideshow about ' Random Number Generators' - kail


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.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
Random number generators
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


Testing random numbers

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.


Chi square example
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


Testing random numbers1

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.


Kolmogorov smirnov example
Kolmogorov-Smirnov Example

Fo(xi) – Fe(xi)

Fe(xi+1) – Fo(xi)


Kolmogorov smirnov example1
Kolmogorov-Smirnov Example

j/n - xj

xj – (j-1)/n


Testing random numbers2

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:


Random number generators1
Random Number Generators

cycle

seed

period

What does a test say about this sample?


Simulation techniques overview
Simulation Techniques Overview

Simulation environments

emulation

Workloadparameters

exec-drivensim

SystemConfigparameters

Result Data

trace-drivensim

-> discussion of timing-firstpaper

Factorlevels

stochasticsim


ad