[Haskell-cafe] Splittable random numbers
John Meacham
john at repetae.net
Sat Jan 22 03:08:23 CET 2011
On Wed, Nov 10, 2010 at 11:33 AM, Lauri Alanko <la at iki.fi> wrote:
> So a naive implementation of split would be:
>
> split g = (mkGen seed, g')
> where (seed, g') = random g
>
> (Where mkGen creates a new state from some sufficiently big seed
> data.)
>
> So what is the problem here? What kinds of observable
> interdependencies between split streams would come up with the above
> definition using common PRNGs? Are my assumptions about the security
> of cryptographic PRNGs incorrect, or is the issue simply that they are
> too expensive for "ordinary" random number generation?
Yeah, I was thinking for any "good" PRNG this should be fine. We
probably want to pull as much internal state as we can from one
generator to the other so we may want to use a specialized seed
routine that is optimized for a specific PRNG rather than using an Int
or something.
John
More information about the Haskell-Cafe
mailing list