Skip to main content
    • Aa
    • Aa

Distributed random number generation*

  • F. Warren Burton (a1) and Rex L. Page (a2)

In a functional program, a simple random number generator may generate a lazy list of random numbers. This is fine when the random numbers are consumed sequentially at a single point in the program. However, things are more complicated in a program where random numbers are used at many locations, such as in a large simulation. The programmer should not need to worry about providing separate generators with a unique seed at each point where random numbers are used. At the same time, the programmer should not need to coordinate the use of a single stream of random numbers in many parts of the program, which can be particularly difficult with lazy evaluation or parallel processing.

We discuss several techniques for distributing random numbers to various parts of a program, and some methods of allowing different program components to evaluate random numbers locally. We then propose a new approach in which a random number sequence can be split at a random point to produce a pair of random number sequences that can be used independently at different points in the computation.

The approach can also be used in distributed procedural programs, where it is desirable to avoid dealing with a single source of random numbers. The approach has the added advantage of producing repeatable results, as might be needed in debugging, for example.

Hide All
Burton F. W. 1988. Nondeterminism with referential transparency in functional programming languages. Computer J., 31 (3): 243247 (Mar.).
Clinger W. 1982. Nondeterministic call by name is neither lazy nor by name. In Conf. record 1982 ACM Symposium on LISP and Functional Programming, pp. 226234 (08).
Hudak P., Wadler P., Arvind B. B., Fairbairn J., Fasel J., Hammond K., Hughes J., Johnsson T., Kieburtz D., Nikhil R., Peyton-Jones S., Reeve M., Wise D. and Young J. 1990. Report on the programming language Haskell: A non-strict purely functional language (Version 1.0). Technical Report YALEU/DCS/RR-777, Department of Computer Science, Yale University.
Hughes R. J. M. and O'Donnell J. 1990. Expressing and reasoning about non-deterministic functional programs. In Proc. 1989 Glasgow Workshop, pp. 308328, Workshops in Computing, Springer-Verlag.
Hughes R. J. M. and O'Donnell J. 1991. Nondeterministic functional programming with sets. In Proc. IV Higher Order Workshop, pp. 1131, Workshops in Computing, Springer-Verlag.
L'Ecuyer P. 1988. Efficient and portable combined random number generators. Comm. ACM, 31 (6): 742749, 774 (06).
Søndergaard H. and Sestoft P. 1990. Referential transparency, definiteness and unfoldability. Acta Informatica, 27: 505517.
Park S. K. and Miller K. W. 1988. Random number generators: Good ones are hard to find. Comm. ACM, 31 (10): 11921201 (10).
Recommend this journal

Email your librarian or administrator to recommend adding this journal to your organisation's collection.

Journal of Functional Programming
  • ISSN: 0956-7968
  • EISSN: 1469-7653
  • URL: /core/journals/journal-of-functional-programming
Please enter your name
Please enter a valid email address
Who would you like to send this to? *


Full text views

Total number of HTML views: 0
Total number of PDF views: 9 *
Loading metrics...

Abstract views

Total abstract views: 74 *
Loading metrics...

* Views captured on Cambridge Core between September 2016 - 22nd October 2017. This data will be updated every 24 hours.