[erlang-questions] Implementation of a 2006 version of Wichmann-Hill random number generator for Erlang/OTP

Richard O'Keefe <>
Wed Dec 1 03:09:09 CET 2010


> 
>>  I don't have an idea about generating two elements from one.
> 
> A crude implementation is: 
>  seed({B1, B2, B3}) -> seed({B1, B2, B3, B3}).
>  (or seed(B1, B2, B3, B3))
> 

The classic way to expand k << N random bits into N
ones (sometimes used, for example, to initialise
lagged fibonacci generators) is to use the k bits
to initialise a weaker generator and then generate
N bits worth out of that.

This _still_ doesn't give you access to all the possible
states, so you are getting rather less randomness than
you might think.

We definitely need an Erlang interface to something that
will (perhaps slowly) give us a lot more random bits than
we find in a few smallish integers; by now there probably
is one but I don't happen to know what it is.



More information about the erlang-questions mailing list