[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua 5.4 random number generator
- From: Roberto Ierusalimschy <roberto@...>
- Date: Fri, 23 Mar 2018 10:11:37 -0300
> Sorry about getting confused about the sequence. Regular linear
> congruential generators produce an even-odd-even-odd pattern, so a 128 bit
> sequence sounded reasonable. xorshift128 and its variants are not nearly
> that bad, but there still a relatively simple linear relationship there. If
> you're using it for running a game it probably does not matter, if you're
> running a casino it definitely does.
The '+' in the xorshift128+ aims to remove the linearity of the
algorithm, but it does not affect the lowest bit (it has no carry,
so the '+' performs an xor). But I must confess I have no idea why
linearity is bad.
Our goal are things like games. If you are running a real cassino, you
probably should bring your own PRNG.
-- Roberto