Abstract
This article presents an extensive theoretical and empirical analysis of the pseudorandom number generators provided by subroutine libraries (NAG, CERN, IMSL, and ESSL), statistical and simulation software packages (GLIM, SAS, SPSS, DATASIM, ESSP, and LLRANDOMII), builtin functions of programming languages (APL, Turbo Pascal, Advanced BASIC, GW-BASIC, and QBASIC), and autoimplemented algorithms (Fishman & Moore, 1986; Wichmann & Hill, 1982; Van Es, Gill, & Van Putten, 1983). On the basis of these analyses, it is concluded that most of the built-in functions of the software packages that were tested can be used safely. In addition, it is concluded that the Wichmann and Hill algorithm is a good choice if only single-precision arithmetic is available, but that a prime-modulus multiplicative congruential generator with modulus 231 −1 and multiplier 16,807 is a better choice if double-precision arithmetic is available, and that the same generator with multiplier 62,089,911 or 742,938,285 is the best choice if extended-precision arithmetic is available. A Turbo Pascal and a VS FORTRAN program for the latter are given in the Appendixes.
Article PDF
Similar content being viewed by others
Avoid common mistakes on your manuscript.
References
Afflerbach, L. (1985). The pseudo-random number generators in Commodore and Apple microcomputers.Statistische Hefte,26, 321–333.
Aldridoe, J. W. (1987). Cautions regarding random number generation on the Apple II.Behavior Research Methods, Instruments, & Computers,19, 397–399.
Borland International (1990).Turbo Pascal, Version 6.0 [Computer program]. Scotts Valley, CA: Author.
Box, G. E. P., &Jenkins, G. M. (1976).Time series analysis (rev. ed.). San Francisco: Holden-Day.
Box, G. E. P., &Pierce, D. A. (1970). Distribution of residual autocorrelations in autoregressive-integrated moving average time series models.Journal of the American Statistical Association,64, 1509.
Bradley, D. R. (1988).DATASIM. Lewiston, ME: Desktop Press.
Bradley, D. R. (1989a). Computer simulation with DATASIM.Behavior Research Methods, Instruments, & Computers,21, 99–112.
Bradley, D. R. (1989b). A general purpose simulation program for statistics and research methods. In G. Garson & S. Nagel (Eds.),Advances in social science and computers (Vol. 1, pp. 145–186). Greenwich, CT: JAI Press.
Bradley, D. R., Senko, M. W., &Stewart, F. A. (1990). Statistical simulation on microcomputers.Behavior Research Methods, Instruments, & Computers,22, 236–246.
Bratley, P., Fox, B. L., &Schrage, E. L. (1983).A guide to simulation. New York: Springer-Verlag.
Brysbaert, M. (1991). Algorithms for randomness in the behavioral sciences: A tutorial.Behavior Research Methods, Instruments, & Computers,23, 45–60.
Brysbaert, M., &Cavegn, D. (1993).A note on reseeding pseudorandom number generators. Manuscript submitted for publication.
Castellan, N. J., Jr. (1992). Shuffling arrays: Appearances may be deceiving.Behavior Research Methods, Instruments, & Computers,24, 72–77.
CERN (1989).CERN program library [Computer program]. Geneva, Switzerland: European Organization for Nuclear Research.
Conveyou, R. R., &MacPherson, R. D. (1967). Fourier analysis of uniform random number generators.Journal of the Association for Computing Machinery,14, 100–119.
Davies, N., &Newbold, P. (1979). Some power studies of a portmanteau test of time series model specification.Biometrika,66, 153–155.
Diaconis, P., &Efron, B. (1983). Computer-intensive methods in statistics.Scientific American,247 (5), 96–129.
Dudewicz, E. J., &Ralley, T. G. (1981).The handbook of random number generation and testing with TESTRAND computer code. Columbus, OH: American Sciences.
Edgell, S. E. (1979). A statistical check of the DECsystem-10 FORTRAN seudorandom number generator.Behavior Research Methods & Instrumentation,11, 529–530.
Edgington, E. S. (1961). Probability table for number of runs of signs of first differences in ordered series.Journal of the American Statistical Association,56, 156–159.
ESSL (1990).Engineering and Scientific Subroutine Library: Guide and reference, Release 4 (5th ed.). New York: IBM.
Ferrenberg, A. M., Landau, D. P., &Wong, Y. J. (1992). Monte Carlo simulations: Hidden errors from “good” random number generators.Physical Review Letters,69, 3382–3384.
Fishman, G. S., &Moore, L. R. (1982). A statistical evaluation of multiplicative congruential random number generators with modulus 231 − 1.Journal of the American Statistical Association,77, 129–136.
Fishman, G. S., &Moore, L. R., III (1986). An exhaustive analysis of multiplicative congruential generators with modulus 231-l.Society for Industrial & Applied Mathematics Journal of Scientific & Statistical Computing,7, 24–45.
Golder, E. R. (1976a). Algorithm AS98: The spectral test for the evaluation of congruential pseudo-random generators.Applied Statistics,25, 173–180.
Golder, E. R. (1976b). Remark ASR18: The spectral test for the evaluation of congruential pseudo-random generators.Applied Statistics,25, 324.
Heth, C.D. (1984). A Pascal version of a pseudorandom number generator.Behavior Research Methods, Instruments, & Computers,16, 548–550.
Hoaglin, D. C., &King, M. L. (1978). Remark ASR24: A remark on algorithm AS98: The spectral test for the evaluation of congruential pseudorandom generators.Applied Statistics,27, 375–377.
Hull, T. E., &Dobell, A. R. (1962). Random number generators.Society for Industrial & Applied Mathematics Review,4, 230–254.
IBMCorporation (1986).The IBM Personal Computer BASIC, Version A3.21 [Computer program]. Portsmouth, NH: Author.
IBMCorporation (1987).VS FORTRAN, Version 2 [Computer program]. San Jose, CA: Author.
IMSL (1987).Integrated Mathematical and Statistical Library: User’s manual, Version 1.0. Houston: Author.
Katzen, H., Jr. (1970).APL programming and computer techniques. New York: Van Nostrand.
Knuth, D. E. (1969).The art of computer programming: Vol. 2. Seminumerical algorithms. Reading, MA: Addison-Wesley.
Knuth, D. E. (1981).The art of computer programming: Vol. 2. Seminumerical algorithms (2nd ed.). Reading, MA: Addison-Wesley.
Landmark Research International (1990).Landmark System Speed Test, Version 2.0 [Computer program]. Clearwater, FL: Author.
Learmonth, G. P., &Lewis, P. A. W. (1974). Statistical tests of some widely used and recently proposed uniform random number generators. In W. J. Kennedy (Ed.),Proceedings of the Seventh Conference on the Computer Science and Statistics Interface. Ames, IA: Iowa State University Press.
L’Ecuyer, P. (1988). Efficient and portable combined random number generators.Communications of the Association for Computing Machinery,31, 742–749, 774.
L’Ecuyer, P. (1990). Random numbers for simulation.Communications of the Association for Computing Machinery,33 (10), 86–97.
Lewis, P. A. W., Goodman, A. S., &Miller, J. M. (1969). A pseudorandom number generation system for the System 360.IBM Systems Journal,8, 136–146.
Lewis, P. A. W., &Orav, E. J. (1989).Simulation methodology for statisticians, operations analysts, and engineers (Vol. 1). Pacific Grove, CA: Wadsworth.
Lewis, P. A. W., Orav, E. J., &Uribe, L. C. (1988).Enhanced Simulation and Statistics Package. Pacific Grove, CA: Wadsworth.
Lewis, P. A. W., &Uribe, L. C. (1988).The new Naval Postgraduate School random number generator package LLRANDOMII [Computer program]. Monterey, CA: Naval Postgraduate School.
Lordahl, D. S. (1988). Repairing the Microsoft BASIC RND function.Behavior Research Methods, Instruments, & Computers,20, 221–223.
MacLaren, N. M. (1989). The generation of multiple independent sequences of pseudorandom numbers.Applied Statistics,38, 351–359.
Marsaglia, G. (1968). Random numbers fall mainly in the planes.Proceedings of the National Academy of Science,61, 25–28.
Marsaglia, G. (1972). The structure of linear congruential sequences. In S. K. Zaremba (Ed.),Applications of number theory to numerical analysis. New York: Academic Press.
Marsaglia, G. (1976). Random number generation. In A. Ralston (Ed.),Encyclopedia of computer science (pp. 103–152). New York: Van Nostrand Reinhold.
Marsaglia, G. (1985). A current view of random number generators. In L. Billard (Ed.),Computer science and statistics: Proceedings of the Sixteenth Symposium on the Interface (pp. 3–10). Amsterdam: North-Holland.
McLeod, A. I. (1985). A remark on Algorithm AS183: An efficient and portable pseudo-random number generator.Applied Statistics,34, 198–200.
Microsoft Corporation (1987).Graphic & Window-BASIC, Version 3.2 [Computer program]. Bellevue, WA: Author.
Microsoft Corporation (1991).QBASIC, Version 1.0 [Computer program]. Bellevue, WA: Author.
Modianos, D. T., Scott, R. C., &Cornwell, L. W. (1984). Randomnumber generation on microcomputers.Interfaces,4, 81–87.
Modianos, D. T.,Scott, R. C, &Cornwell, L. W. (1987, January). Testing intrinsic random-number generators.Byte, pp. 175–178.
Mood, A. M., Graybill, F. A., &Boes, D. C. (1974).Introduction to the theory of statistics (3rd ed.). Singapore: McGraw-Hill.
Nilsson, T. H. (1978). Randomization without replacement using replacement without losing your place.Behavior Research Methods & Instrumentation,10, 419.
Numerical Algorithms Group (1990).The NAG Fortran Library (Mark 14) [Computer program]. Oxford, U.K.: Author.
Park, S. K., &Miller, K. W. (1988). Random number generators: Good ones are hard to find.Communications of the Association for Computing Machinery,31, 1192–1201.
Payne, C. D. (Ed.) (1987).The GUM System, Release 3.77 (2nd ed.). Oxford, U.K.: NAG and the Royal Statistical Society.
Rasmussen, J. L. (1984). A FORTRAN program for statistical evaluation of pseudorandom number generators.Behavior Research Methods, Instruments, & Computers,16, 63–64.
Ripley, B. D. (1983). Computer generation of random variables: A tutorial.International Statistical Review,51, 301–319.
Ripley, B. D. (1987).Stochastic simulation. New York: Wiley.
Ripley, B. D. (1988). Uses and abuses of statistical simulation.Mathematical Programming,42, 53–68.
SAS Institute Inc. (1988).SAS language guide, Release 6.03. Cary, NC: Author.
SAS Institute Inc. (1989).Statistical Analysis System for Personal Computers, Release 6.04 [Computer program]. Cary, NC: Author.
SAS Institute Inc. (1991).Statistical Analysis System for VM/CMS, Release 6.07 [Computer program]. Cary, NC: Author.
Schrage, L. (1979). A more portable FORTRAN random number generator.Association for Computing Machinery Transactions on Mathematical Software,5, 132–138.
Siegel, S., &Castellan, N. J., Jr. (1988).Nonparametric statistics for the behavioral sciences (2nd ed.). New York: McGraw-Hill.
SPSSInc. (1983).Statistical Package for the Social Sciences. Chicago: Author.
Strube, M. J. (1983). Tests of randomness for pseudorandom number generators.Behavior Research Methods & Instrumentation,15, 536–537.
Thisted, R. A. (1987).Elements of statistical computing. New York: Chapman & Hall.
Van Es, A. J., Gill, R. D., & Van Putten, C. (1983). Random number generators for a pocket calculator.Statistica Neerlandica,37, 95–102.
Whicker, M. L., &Sioelman, L. (1991).Computer simulation applications. Newbury Park: Sage.
Whitney, C. A. (1984, October). Generating and testing pseudorandom numbers.Byte, pp. 128–129, 442–464.
Wichmann, B. A., &Hill, J. D. (1982). Algorithm AS183: An efficient and portable pseudo random number generator.Applied Statistics,31, 188–190.
Wichmann, B. A., &Hill, J. D. (1984). An efficient and portable pseudo random number generator: Correction.Applied Statistics,33, 123.
Wichmann, B. A., &Hill, J. D. (1987, March). Building a randomnumber generator.Byte, pp. 127–128.
Zeisel, H. (1986). A remark on Algorithm AS183: An efficient and portable pseudo-random number generator.Applied Statistics,35, 89.
Author information
Authors and Affiliations
Corresponding author
Additional information
The author wishes to thank Drake Bradley, Marc Brysbaert, John Castellan, Stef Decoene, Luc Delbeke, Ignace Hanoulle, Rianne Janssen, Daniel Lordahl, Gert Storms, and one anonymous reviewer for their helpful comments on an earlier draft of the article, and Anne-Marie De Meyer, Magda Vuylsteke, Paul De Boeck and the Research Group on Quantitative Methods for their support.
Rights and permissions
About this article
Cite this article
Onghena, P. A theoretical and empirical comparison of mainframe, microcomputer, and pocket calculator pseudorandom number generators. Behavior Research Methods, Instruments, & Computers 25, 384–395 (1993). https://doi.org/10.3758/BF03204529
Received:
Accepted:
Issue Date:
DOI: https://doi.org/10.3758/BF03204529