Validating a Random Number Generator Based on: A Test of Randomness Based on the Consecutive Distance Between Random Number Pairs By: Matthew J. Duggan,

Slides:



Advertisements
Similar presentations
Statistical Techniques I
Advertisements

Generating Random Numbers
Chapter 14, part D Statistical Significance. IV. Model Assumptions The error term is a normally distributed random variable and The variance of  is constant.
Random Number Generation. Random Number Generators Without random numbers, we cannot do Stochastic Simulation Most computer languages have a subroutine,
Outline input analysis input analyzer of ARENA parameter estimation
Regression Analysis Once a linear relationship is defined, the independent variable can be used to forecast the dependent variable. Y ^ = bo + bX bo is.
Hypothesis Testing IV Chi Square.
Chapter 8 Random-Variate Generation Banks, Carson, Nelson & Nicol Discrete-Event System Simulation.
Random Number Generators. Why do we need random variables? random components in simulation → need for a method which generates numbers that are random.
Simulation Where real stuff starts. ToC 1.What, transience, stationarity 2.How, discrete event, recurrence 3.Accuracy of output 4.Monte Carlo 5.Random.
Generating Random Numbers
Using random numbers Simulation: accounts for uncertainty: biology (large number of individuals), physics (large number of particles, quantum mechanics),
1 Random Number Generation H Plan: –Introduce basics of RN generation –Define concepts and terminology –Introduce RNG methods u Linear Congruential Generator.
Agenda Purpose Prerequisite Inverse-transform technique
Statistics.
Distinguishing Features of Simulation Time (CLK)  DYNAMIC focused on this aspect during the modeling section of the course Pseudorandom variables (RND)
Chapter 14 Simulation. Monte Carlo Process Statistical Analysis of Simulation Results Verification of the Simulation Model Computer Simulation with Excel.
Simulation Input and Output Data Analysis
CSCE Monte Carlo Methods When you can’t do the math, simulate the process with random numbers Numerical integration to get areas/volumes Particle.
8-4 Testing a Claim About a Mean
- 1 - Summary of P-box Probability bound analysis (PBA) PBA can be implemented by nested Monte Carlo simulation. –Generate CDF for different instances.
Inferences About Process Quality
1 Simulation Modeling and Analysis Pseudo-Random Numbers.
Properties of Random Numbers
BCOR 1020 Business Statistics Lecture 24 – April 17, 2008.
Lecture II-2: Probability Review
APPENDIX D RANDOM NUMBER GENERATION
Random-Number Generation. 2 Properties of Random Numbers Random Number, R i, must be independently drawn from a uniform distribution with pdf: Two important.
Hypothesis Testing and T-Tests. Hypothesis Tests Related to Differences Copyright © 2009 Pearson Education, Inc. Chapter Tests of Differences One.
Fall 2011 CSC 446/546 Part 6: Random Number Generation.
ETM 607 – Random Number and Random Variates
Simulation Output Analysis
Random Number Generators CISC/QCSE 810. What is random? Flip 10 coins: how many do you expect will be heads? Measure 100 people: how are their heights.
Monte Carlo I Previous lecture Analytical illumination formula This lecture Numerical evaluation of illumination Review random variables and probability.
1 Statistical Distribution Fitting Dr. Jason Merrick.
CS433 Modeling and Simulation Lecture 15 Random Number Generator Dr. Anis Koubâa 24 May 2009 Al-Imam Mohammad Ibn Saud Islamic University College Computer.
CPSC 531: RN Generation1 CPSC 531:Random-Number Generation Instructor: Anirban Mahanti Office: ICT Class Location:
Chapter 7 Random-Number Generation
Tests for Random Numbers Dr. Akram Ibrahim Aly Lecture (9)
ECE 8443 – Pattern Recognition Objectives: Error Bounds Complexity Theory PAC Learning PAC Bound Margin Classifiers Resources: D.M.: Simplified PAC-Bayes.
CS433: Modeling and Simulation Dr. Anis Koubâa Al-Imam Mohammad bin Saud University 15 October 2010 Lecture 05: Statistical Analysis Tools.
Basic Concepts in Number Theory Background for Random Number Generation 1.For any pair of integers n and m, m  0, there exists a unique pair of integers.
Modeling and Simulation Random Number Generators
Random Number Generators 1. Random number generation is a method of producing a sequence of numbers that lack any discernible pattern. Random Number Generators.
Monte Carlo Methods.
Experimental Method and Data Process: “Monte Carlo Method” Presentation # 1 Nafisa Tasneem CHEP,KNU
APPENDIX D R ANDOM N UMBER G ENERATION Organization of chapter in ISSO* – General description and linear congruential generators Criteria for “good” random.
EMIS 7300 SYSTEMS ANALYSIS METHODS FALL 2005 Dr. John Lipp Copyright © Dr. John Lipp.
Limits to Statistical Theory Bootstrap analysis ESM April 2006.
Testing Random-Number Generators Andy Wang CIS Computer Systems Performance Analysis.
STA347 - week 91 Random Vectors and Matrices A random vector is a vector whose elements are random variables. The collective behavior of a p x 1 random.
R ANDOM N UMBER G ENERATORS Modeling and Simulation CS
EMIS 7300 SYSTEMS ANALYSIS METHODS FALL 2005 Dr. John Lipp Copyright © 2005 Dr. John Lipp.
G. Cowan Lectures on Statistical Data Analysis Lecture 5 page 1 Statistical Data Analysis: Lecture 5 1Probability, Bayes’ theorem 2Random variables and.
Hypothesis Testing Example 3: Test the hypothesis that the average content of containers of a particular lubricant is 10 litters if the contents of random.
0 Simulation Modeling and Analysis: Input Analysis 7 Random Numbers Ref: Law & Kelton, Chapter 7.
MONTE CARLO METHOD DISCRETE SIMULATION RANDOM NUMBER GENERATION Chapter 3 : Random Number Generation.
Random Numbers All stochastic simulations need to “generate” IID U(0,1) “random numbers” Other random variates coming from other distribution can be generated.
Generating Random Variates
Random Number Generators
Chapter 10 Verification and Validation of Simulation Models
Chapter 7 Random Number Generation
CS 475/575 Slide set 4 M. Overstreet Old Dominion University
Chapter 7 Random-Number Generation
Properties of Random Numbers
Validating a Random Number Generator
Linear Functions The output of function “f” when x is used as the input Independent Variable Slope: the difference in “f” for consecutive values of x y-intercept:
Where real stuff starts
Generating Random Variates
Empirical Distributions
Presentation transcript:

Validating a Random Number Generator Based on: A Test of Randomness Based on the Consecutive Distance Between Random Number Pairs By: Matthew J. Duggan, John H. Drew, Lawrence M. Leemis Presented By: Sarah Daugherty MSIM 852 Fall 2007

Daugherty MSIM 852 Fall 2007 Introduction  Random numbers are critical to Monte Carlo simulation, discrete event simulation, and bootstrapping  There is a need for RNG with good statistical properties.  One of the most popular methods for generating random numbers in a computer program is a Lehmer RNG.

Daugherty MSIM 852 Fall 2007 Lehmer Random Number Generators  Lehmer’s algorithm: an iterative equation produces a stream of random numbers.  Requires 3 inputs: m, a, and x 0. m = modulus, a large fixed prime number a = multiplier, a fixed positive integer < m x 0 = initial seed, a positive integer < m  Produces integers in the range (1, m-1)

Daugherty MSIM 852 Fall 2007 Problem  Lehmer RNG are not truly random With carefully chosen m and a, it’s possible to generate output that is “random enough” from a statistical point of view.  However, still considered good generators because their output can be replicated, they’re portable, efficient, and thoroughly documented.  Marsaglia (1968) discovered too much regularity in Lehmer RNG’s.

Daugherty MSIM 852 Fall 2007 Marsaglia’s Discovery  He observed a lattice structure when consecutive random numbers were plotted as overlapping ordered pairs. ((x 0, x 1, x 2,…, x n ), (x 1, x 2,…, x n+1 )) Lattice created using m = 401, a = 23. Does not appear to be random at all; BUT a degree of randomness MAY be hidden in it.

Daugherty MSIM 852 Fall 2007 Solution  Find the hidden randomness in the order in which the points are generated.  The observed distribution of the distance between consecutive RN’s should be close to the theoretical distance.  Develop a test based on these distances. Hoping to observe that points generally are not generated in order along a plane or in a regular pattern between planes.

Daugherty MSIM 852 Fall 2007 Overlapping vs. Non-overlapping Pairs  Considering distance between consecutive pairs of random numbers, points can be overlapping or non-overlapping. Overlapping: (x i, x i+1 ), (x i+1, x i+2 ) Non-overlapping: (x i, x i+1 ), (x i+2, x i+3 )  Both approaches are valid.  The non-overlapping case is mathematically easier in that the 4 numbers represented are independent therefore the 2 points they represent are also independent.

Daugherty MSIM 852 Fall 2007 Non-overlapping Theoretical Distribution  If we assume X 1, X 2, X 3, X 4 are IID U(0,1) random variables, we can find the distance between (X 1, X 2 ) and (X 3, X 4 ) by:

Daugherty MSIM 852 Fall 2007 Non-overlapping Theoretical Distribution  The cumulative distribution, F(x), of D.

Daugherty MSIM 852 Fall 2007 Goodness-of-Fit Test  Now we can compare our theoretical distribution against the Lehmer generator.  Convert the distances between points into an empirical distribution, F(x), which will allow us to perform a hypothesis test. ^ ^ N(x) = # of values that do not exceed x n = # of distances collected ^ ^

Daugherty MSIM 852 Fall 2007 Classification of Results  Based on results of 3 hypothesis tests (KS, CVM, and AD tests), each RNG can be classified as: Good – the null hypothesis was not rejected in any test. Suspect – the null hypothesis was rejected in 1 or 2 of the tests. Bad – the null hypothesis was rejected in all 3 tests.

Daugherty MSIM 852 Fall 2007 Results  Interesting cases are when a multiplier is rejected by only 1 or 2 of the 3 tests. See a = 3 in table.

Daugherty MSIM 852 Fall 2007 Random number pairs Distances connecting pairs F(x) (solid) vs. F(x) (dotted) ^ GoodSuspectBad

Daugherty MSIM 852 Fall 2007 Summary  A test of randomness was developed for Lehmer RNG’s based on distance between consecutive pairs of random numbers.  Since some multipliers are rejected by only one or two of the 3 hypothesis tests, the distance between parallel hyperplanes should not be used as the only basis for a test of randomness. The order in which pairs are generated is a second factor to consider.

Daugherty MSIM 852 Fall 2007 Critique  Potential – limited. Many other tests exist for validating RNG’s.  Impact – minimal. Frequently used RNG’s use a modulus much larger than the m=401 used here.  Overall – paper is well written; in it’s current state, this test is a justified addition to collection of tests for RNG’s.  Future – use larger modulus; improve theoretical distribution by improving numerical calculations of integral for cdf; test other non-Lehmer generators such as additive linear, composite, or quadratic.