Вы находитесь на странице: 1из 12

RANDOM NUMBER

GENERATION
Lecture Notes: Chapter 8

Properties of Random
Numbers
Uniformity
Independence

Characteristics:
Continuous uniform distribution between 0 to
1.
1, 0 x 1
E ( R) 1 / 2
f ( x)
V ( R) 1 / 12
0, otherwise
If the interval (0,1) is divided into n classes,
n/n.
The probability of observing a particular value
is independent of previous numbers.

Psuedo-Random Numbers:
A sequence of numbers between 0 to 1
which simulates the ideal properties of
uniform distribution and independence
as closely as possible.

Possible errors of PsuedoRandom Numbers


Generated numbers may not be uniformly
distributed
Numbers may be discrete valued instead of
continuous
Mean and variance may be too high or too
low
Cyclic variations may occur such as
autocorrelation,
successive
numbers,
groupings of numbers

Characteristics of Routines
(Generators):
Fast
Portable
Long cycle
Replicable
Imitate randomness

Techniques for Generating PsuedoRandom Numbers


Mid square method
Mid product method
Linear Congruential method
Combined Congruential method

Linear Congruential method


proposed by Lehmer (1951)
produces a sequence of integers between 0 to m-1
if c = 0, multiplicative Congruential method
if c is not equal 0, mixed Congruential method
Where X0 = seed
Xi = random integer
i 1
C = increment
A = constant multiplier
M = modulus
Ri = random numbers = Xi / m

( A * ( X i ) C ) mod m

Combined Congruential
method
combination of two or more
multiplicative congruential generators

Hypothesis Tests for Random


Numbers
Hypothesis when testing for uniformity:
Ho: Ri U [ 0,1]
H1: Ri U [ 0,1]

Hypothesis when testing for independence:

Ho : Ri independently
Hi : Ri independently

Test for Random Numbers:


Frequency test

Kolmogorov-Smirnov test
Chi-square test

Runs test

Runs
Runs
Runs
Runs

up
down
above the mean
below the mean

Autocorrelation test
Gap test
Poker test

Other Tests
Goods Serial Test [1953, 1967]
Median-Spectrum Test [Cox and Lewis,
1966, Durbin, 1967]
A Variance Heterogeneity Test [Cox and
Lewis, 1966]
Even with all these tests, it is still no
guarantee that randomness is achieve

Вам также может понравиться