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.

Linked references
Hide All

This list contains references from the content that can be linked to their source. For a full set of references and notes please see the PDF or HTML where available.

F. W. Burton 1988. Nondeterminism with referential transparency in functional programming languages. Computer J., 31 (3): 243247 (Mar.).

W. Clinger 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).

P. L'Ecuyer 1988. Efficient and portable combined random number generators. Comm. ACM, 31 (6): 742749, 774 (06).

H. Søndergaard and P. Sestoft 1990. Referential transparency, definiteness and unfoldability. Acta Informatica, 27: 505517.

S. K. Park and K. W. Miller 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: 8 *
Loading metrics...

Abstract views

Total abstract views: 56 *
Loading metrics...

* Views captured on Cambridge Core between September 2016 - 27th May 2017. This data will be updated every 24 hours.