CS457 - System Performance Evaluation - Winter 2010

Public Service Announcements

Lecture 23 - Log-normal, Cauchy Distributions (pdf), Random number generators

Final Comments on the Normal Distribution

Practical Advice

Two Last Distributions

Log-normal Distribution

Normal distribution generates negative values

How do we change negative numbers to positive ones?

Cauchy Distribution

Normal distributions are your friend because they converge very well

How much is outside n standard deviations
std. dev. % in tail on one side
1 16%
2 2.6%
3 0.23%
4 0.065%


Page 481 in the text.

Key to Figure 28.4
Name Definition Example
Inversion Find explicit inverse of CDF as a function Exponential


Composition PDF is sum of two or more PDFs.
Choose one at random and generate from it
Convolution Random variable is a sum. Binomial


Characterization Find some special trick Normal
Rejection Sample on a larger domain and reject ones outside Uniform circle
Tabular inversion Define CDF as an interpolation table Normal

Pseudo-Random Number Generators

What we want

  1. Computationally efficient
  2. Gives good sequences of numbers
  3. Long periods
  4. Reproduce previous sequences for debugging

Linear Congruential Generators

X(n) = ( aX(n-1) + b ) mod m

How to get a full period - all possible values appear before repeating.

Choose m = 2^k for efficiency.

Testing Sequences of Random Numbers

Serial test

  1. Get adjacent pairs of numbers as points in a plane.
  2. Put them into bins: kxk.
  3. If sequence is uniform and random then P(point is in a given cell) = 1/k^2
  4. Use Kolmogorov test (or chi-square test) to check the distribution.

Gap test

  1. Choose an interval between zero and one, of length p
  2. Then P( U in interval ) = p

Look at runs of points outside interval

This should be a geometric distribution

Donald Knuth Wrote the Book

177 very dense pages in Semi-Numerical Algorithms

The Truth about Random Number Generation

How good do they have to be?

Look carefully at how your simulation uses random numbers

What type of correlations are you likely to care about? For example,

Return to: