Abstract

There are numerous applications in the field of psychology that require the use of random numbers. Randomization of subjects into groups, random presentation of treatments to subjects, simulation of cognitive processes, and Monte Carlo simulations of statistics used in psychological research require the use of random numbers. A common procedure for obtaining random numbers is through the use of a computer's pseudorandom number function. The function is deemed pseudorandom because the values are not generated from a truly random process; rather, each value is calculated from the previous value, often through multiplicative and modulo operations. In order to be useful, the values produced by a pseudorandom number generator must meet certain criteria of randomness. Computer companies usually do not supply users with information concerning the adequacy of their pseudorandom number generator in meeting these criteria. It is well known that some pseudorandom number generators do not produce satisfactory random numbers (Jansson, 1966; Knuth, 1969). It is therefore the user's responsibility to determine the adequacy ofa pseudorandom number generator. The present article describes a FORTRAN N program that may be used to test the adequacy of a pseudorandom number generator. It checks whether the values produced by the generator pass a cycle repetition test plus four standard statistical tests: rectangularity test, sequential independence test, runs up and down test, and gaps test. Each test is conducted on the same 100,000 random values. The program output consists of a probability value for each of the statistical tests. The tests are described in numerous sources (Hammersley & Handscomb, 1964; Jansson, 1966; Knuth, 1969; Lehman, 1977; Shreider, 1966). Of these references, Jansson (1966) and Lehman (1977) present the tests in the clearest fashion. Cycle Repetition. Due to the manner in which pseudorandom values are generated, most pseudorandom number generators produce a finite of different pseudorandom numbers. At the end of a certain cycle, the generator will reproduce the same sequence of numbers. For a pseudorandom number generator to be useful, it must generate an long of numbers before it repeats its cycle. What constitutes an acceptably long series depends upon

Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call