lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Sun, Jan 17, 2010 at 12:52:00PM -0200, Luiz Henrique de Figueiredo wrote:
> > For the randum number generator, pick one according to your requirements.
> > E.g. many have very good distribution properties, but next values are
> > rather predictable once you know a sequence, which may be a no-go.
>
> Shameless plug: http://www.tecgraf.puc-rio.br/~lhf/ftp/lua/#lrandom
... which uses Mersenne Twister.
An excellent algorithm in many situations, just be aware of

"
This is in fact a limitation of all F2 -linear generators,
including the Mersenne twister, the TT800, etc.
Because of their linear nature,
the sequences produced by these generators just cannot have 
the linear complexity of a truly random sequence.
This is definitely unacceptable in cryptology, for example,
but is quite acceptable for the vast majority of simulation applications
if the linear dependencies are of long range and high order.
"
http://www.iro.umontreal.ca/~lecuyer/myftp/papers/wellrng.pdf


cheers