Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Generating random generators
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2010-05-11 (16:01)
From: Dario Teixeira <darioteixeira@y...>
Subject: Re: [Caml-list] Generating random generators

> However, random numbers are tricky, and I'm suspicious of just
> adding a new operation ad hoc when I don't understand how the
> underlying PRNG works. Hence, I'd appreciate if anyone could
> offer some insight on whether the above approach has any hidden
> pitfalls (i.e. some sort of regularity that might appear when the
> values from two generated streams are combined in a particular
> fashion), or if there is a faster way of generating new generators
> robustly. Random.State.make invokes Digest.string for every int of
> the seed, so it seems like overkill.

Have you considered using Cryptokit's Random module?  It offers
many generators, one of which meets your determinism criteria.

Dario Teixeira