Studies of Random Numbers


    Source codes for tests of randomness
    Selected publications
    Useful links

    Random numbers are used in various numerical techniques such as the Monte Carlo (MC) method and Langevin dynamics, in which random numbers serve to introduce the stochastic dynamics to these methods. The quality of random numbers in stochastic simulation methods is therefore of crucial importance. For computational purposes random numbers have traditionally been produced by deterministic rules, implemented as pseudorandom number generators (PRNG's) which usually rely on simple arithmetic operations. Although it is obvious that these pseudorandom number sequences can be ``random'' only in some limited sense, their imitation of truly random behavior is often good enough for cases in which a very high quality of random numbers is not an essential requirement. Modern high speed computers and high precision calculations, however, have caused the requirements for the quality of random number sequences to greatly increase. Under such circumstances it is crucial to confirm the quality of random numbers before using them extensively.

    We have studied this subject by testing some commonly used pseudorandom number generators with two kinds of tests. First, we have utilized several "standard" tests such as the gap test and the serial test, which probe purely general statistical properties of random number sequences, not concentrating on the requirements of any application in particular. Although being very useful for many purposes, these tests still provide us only with a very limited view of the properties of random numbers. To better characterize the quality of random numbers in specific applications, we have developed new application specific tests which are based on analogies to some commonly simulated physical systems such as the Ising model and random walks. This approach provides us with direct knowledge of the quality of random numbers in applications, which the tests have been designed to mimic.

    As a most recent step, we have used the idea of application specific testing to design tests for random number sequences used in parallel computing. Here the idea is to consider a number of diffusing random walkers, each of which is governed by a distinct random number sequence, and study their mutual correlations. Thus, if there are any long-range correlations between distinct subsequences of random numbers, we expect them to manifest themselves as a biased relative motion of resulting random walks.

    Below you can find a few source codes for tests developed by us during the last few years. The first three are (Fortran77) implementations of tests for studies of random numbers in parallel calculations, while the last three are more general application specific tests. Furthermore, a few relevant publications and links to useful sites are given below.

    Ilpo Vattulainen
    E-mail: Ilpo.Vattulainen@csc.fi

     Source Codes for Tests of Randomness

    1. S_N test
    2. Intersection test
    3. Height correlation test
    4. 2D random walk test
    5. Autocorrelation test based on the 2D Ising model
    6. n-block test

     Selected Publications

    1. Framework for Testing Random Numbers in Parallel Calculations
    2. A Comparative Study of Some Pseudorandom Number Generators
    3. Bit Level Correlations in Some Pseudorandom Number Generators
    4. Physical Tests for Random Numbers in Simulations
    5. New tests of Random Numbers for Simulations in Physical Systems, Licentiate Thesis
    6. Physical Models as Tests of Randomness

     Useful Links

    • Random Number Generation - Theoretical and Empirical Aspects by the pLab-group
    • Homepage of Pierre L'Ecuyer
    • Scalable Parallel Random Number Generators Library
    • Non-uniform random variate generation (Luc Devroye)
    • DIEHARD, a test bench by George Marsaglia