Random Numbers

Intuitively, we can list a number of criteria that a sequence of numbers must fulfill to pass as a random number sequence:
  • unpredictability,
  • independence,
  • without pattern.

These criteria appear to be the minimum request for an algorithm to produce random numbers. More precisely we can formulate:

  • uniform distribution,
  • uncorrelated,
  • passes every test of randomness,
  • large period before the sequence repeats (see later),
  • sequence repeatable and possibility to vary starting values,
  • fast algorithm.

Here we listed also criteria that are more of practical relevance than of relevance for the statistical properties. The first criterion is immediately evident since every number must appear with the same probability. This alone is not sufficient for the quality of a generator, but a minimal requirement. Much more stringent, we require that the numbers be uncorrelated! This also takes into account how we will later generate the numbers. It also requires that not only we can not predict the next number, but also numbers generated at a later point in the sequence. We come back to correlation in this chapter quite often since it is a very important issue raised in many different contexts.

The third criterion can never be fulfilled! We can always construct a test such that a particular generator fails this test of randomness. What is meant is that all tests made so far have proven a certain generator to deliver a reasonably random sequence of numbers.

The last criteria should be augmented with the requirement of portability. The generator should deliver the same sequence of numbers irrespective of the underlying hardware.

Most computer installations or some programming environments provide one with a random number generator. It should be clear that you should not trust a generator before it is tested by you! Unfortunately most statistical tests fail to show correlation that appears later in a bias in the results of simulations of statistical mechanics problems. Probably the best test is to apply the generator to a real problem where the results are known or where it can be inferred that something must be wrong with the generator.

previous page next page