[erlang-questions] All possible internal states of Erlang/OTP random module are practically computable

Richard A. O'Keefe <>
Tue Dec 23 05:14:39 CET 2014


On 23/12/2014, at 1:46 pm, Kenji Rikitake <> wrote:

> This is a preliminary result of a brute-force check of the AS183 algorithm
> looping period, using a C program running in the exactly same algorithm as in
> the Erlang/OTP random module.

The result is anything but surprising.

> Conclusion: I have to say that Erlang/OTP "random" module should be
> revised ASAP.

We have known this for some time.

There is a 4-generator version of the Wichmann-Hill idea; there is some
IP restriction on it which I do not understand.  The point is that the
inventors of AS183 themselves believe it is past its use-by date.

AS183 was an excellent choice for a 4 mB 20 MHz machine that secretly
wanted to be a 16-bit machine.  Those days are long past.

George Marsaglia’s “Random Number Generators” is a good survey of
the 2003 state of the art.

Many of the good ones (not excluding the Mersenne Twister) require
large mutable tables, so are best done in the VM.
There is code for a Complementary-Multiply-With-Carry generator
in the right column of page 9, and a table that can be used to
shrink the table size to something lighter weight.



More information about the erlang-questions mailing list