Re: More on Random Number Generators in Euphoria

new topic     » goto parent     » topic index » view thread      » older message » newer message

On Mon, 14 Feb 2000 14:25:13 -0500, Brian Broker <bkb at CNW.COM> wrote:

>On Mon, 14 Feb 2000 13:22:01 -0500, Everett Williams wrote:
>
>>Has anybody run the Euphoria RNG through the Diehard test?
>
>I decided to go ahead and look into this.  The Diehard test is looking for
>32-bit random numbers...  The problem with Euphoria's 'rand' function is
>that it will only produce random numbers up to 0x3FFFFFF (instead of
>0xFFFFFFFF).  What would be an acceptable method to obtain the required
>range?  Is it acceptable to generate two 16-bit random numbers and
>concatenate them?  Does anybody have any other valid suggestions?  I could
>try all suggested methods and see what works best...
>
>-- Brian

It is perfectly legitimate to concatenate items. The output of a RNG should
normally be treated as a bit-stream anyway, arbitrarily divided under the
needs of the moment. That is not quite the same as concatenation, as in
concatenation usually some bits are thrown away. That is to say, when
you concatenate, you should not throw away the remainder, but put it at the
head of the next number. Even when throwing away portions, I believe that
it would be okay, if the number were shifted left 5 bits and the created zeros
replaced by the low order bits of the next number in sequence.

It would still be interesting to create a set of 10 to 11 megabytes in size
consisting of the 0x3FFFFFFF ranged numbers available and run it through
the diehard tests. The results might be instructive if it will accept the set
at all.

Everett L.(Rett) Williams
rett at gvtc.com

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu