Hostname: page-component-8448b6f56d-qsmjn Total loading time: 0 Render date: 2024-04-17T07:50:51.549Z Has data issue: false hasContentIssue false

Distributed random number generation*

Published online by Cambridge University Press:  07 November 2008

F. Warren Burton
Affiliation:
School of Computing Science, Simon Fraser University, Burnaby, British Columbia, CanadaV5A 1S6burton@cs.sfu.ca
Rex L. Page
Affiliation:
Amoco Production Company, Research Center, 4502 East 41st Street, Post Office Box 3385, Tulsa, Oklahoma 74102, USArpage@trc.amoco.com
Rights & Permissions [Opens in a new window]

Abstract

Core share and HTML view are not available for this content. However, as you have access to this content, a full PDF is available via the ‘Save PDF’ action button.

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.

Type
Articles
Copyright
Copyright © Cambridge University Press 1992

References

Burton, F. W. 1988. Nondeterminism with referential transparency in functional programming languages. Computer J., 31 (3): 243247 (Mar.).Google Scholar
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).Google Scholar
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.Google Scholar
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.Google Scholar
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.Google Scholar
L'Ecuyer, P. 1988. Efficient and portable combined random number generators. Comm. ACM, 31 (6): 742749, 774 (06).CrossRefGoogle Scholar
Søndergaard, H. and Sestoft, P. 1990. Referential transparency, definiteness and unfoldability. Acta Informatica, 27: 505517.CrossRefGoogle Scholar
Park, S. K. and Miller, K. W. 1988. Random number generators: Good ones are hard to find. Comm. ACM, 31 (10): 11921201 (10).CrossRefGoogle Scholar
Submit a response

Discussions

No Discussions have been published for this article.