[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua 5.4 random number generator
- From: Coda Highland <chighland@...>
- Date: Sat, 24 Mar 2018 14:55:34 -0500
On Sat, Mar 24, 2018 at 2:25 PM, Albert Chan <albertmcchan@yahoo.com> wrote:
>
>> On Mar 23, 2018, at 6:31 PM, Coda Highland <chighland@gmail.com> wrote:
>>
>> The lower-order bits are less random than the higher-order bits, and
>> this is true of many RNG designs. If you want a coin flip, pick a bit
>> out of the middle instead of taking the lowest bit. If you want to
>> construct a floating-point value, the lowest two bits have enough of a
>> correlation that you get especially bad results.
>>
>> /s/ Adam
>>
>
> Do you mean top bits is not as good as the middle bits ?
In some RNGs the bottom bits are weak. In some RNGs the top bits are
weak. The middle is usually safe, so if you don't know the behavior of
the RNG in advance then you should either pull bits out of the middle
or combine bits from both ends. (Obviously if you DO know the RNG's
behavior, pick out what's good.)
/s/ Adam
- References:
- Lua 5.4 random number generator, Gé Weijers
- Re: Lua 5.4 random number generator, Roberto Ierusalimschy
- Re: Lua 5.4 random number generator, Gé Weijers
- Re: Lua 5.4 random number generator, Roberto Ierusalimschy
- Re: Lua 5.4 random number generator, Gé Weijers
- Re: Lua 5.4 random number generator, Roberto Ierusalimschy
- Re: Lua 5.4 random number generator, albertmcchan
- Re: Lua 5.4 random number generator, Gé Weijers
- Re: Lua 5.4 random number generator, Albert Chan
- Re: Lua 5.4 random number generator, Coda Highland
- Re: Lua 5.4 random number generator, Albert Chan