There should be more to testing the randomness of a draw that what Kevin
Problems that may not be identified using the approach below are:
* Second and higher order correlations between observations
A quote from NIST suggests the following tests need to be run to certify a
random number generator:
(Cited from http://www.itl.nist.gov/div898/pubs/ar/ar1998/node6.html )
Many statistical tests exist that determine specific kinds of nonrandomness.
These include: (1) Frequency tests, to verify that the proportions of zeroes
and ones are equal; (2) Runs tests, to verify that the binary sequence
doesn't alternate too frequently, or contain too many or too few long
substrings of zeroes or ones; (3) Spectral tests, that look for periodicity
in the local frequencies of zeroes and ones (an extension of this test based
on wavelet analysis looks for aperiodic variation in these frequencies); (4)
Geometric tests, which can look at how often a random walk based on the
sequence returns to the origin, or at the local dimensionality of n-tuplets
of numbers built from the sequence, and other theoretical properties of
multivariate spacings; (5) Compression tests, that use complexity theory to
estimate if a sequence compresses too much, indicating that some kind of
patterning is present. We have developed a large suite of these tests,
together with the associated mathematical theory, critical values, and
guidelines for application, so that any user will be able to assess the
strength of their own encryption algorithms.
NIST tests for randomness can be downloaded (for UNIX) at
From: kviel [mailto:kviel@GMCF.ORG]
Sent: Thursday, July 12, 2001 8:21 AM
Subject: Re: testing for randomness of a sample
The draws will have a distribution. The expected value of the mean
and variance of a series draws of size N should approach the mean and
variance of the underlying population. This could be the basis for a
statistical test. I would assume that this is not possible for one draw,
meaning many draws are in order. You may even be able to invoke the CLT.
Another possibility is to examine the method employed to obtain the
PS Dale McLerran has posted a SAS macro for a random draw from a SAS data
set previously to this list.
From: Mathew, Regi (CAP, CARD) [mailto:Regi.Mathew@GECAPITAL.COM]
Sent: Wednesday, July 11, 2001 5:40 PM
Subject: testing for randomness of a sample
We are testing various functionalities of a software. One of the
functionality of the software is 'random selection'. It allows us to draw
random sample from a population (user
decides the proportion). How can we test that the sample is indeed random?
Is there a specific test for it?
Thanks for you response.
CONFIDENTIALITY NOTICE: This e-mail transmission, and any documents, files
or previous e-mail messages attached to it may contain proprietary,
privileged or confidential information. If you are not an intended
recipient, or a person responsible for delivering it to the intended
recipient, you are hereby notified that any disclosure, copying,
distribution or use of any of the information contained in or
attached to this transmission is STRICTLY PROHIBITED. If you have
received this transmission in error, please immediately notify me by
reply e-mail and destroy the original transmission and its
attachments without saving them in any manner.