Re: More on Random Number Generators in Euphoria

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

--=====================_14631672==_.ALT


from the DIEHARD Manual:

 "Write a main program that sends the (hex) output of your random
   number procedure to an ordinary ascii file.  Then invoke the
   file on this disk, ASC2BIN.EXE that will prompt for the names
   of your input and output files and do the conversion.

   Your random number generator should produce 32-bit integers.
   (If 31 bits, left justify by shift-left-one, as some of the
   tests in DIEHARD favor leading bits.)  You should send them to
   your ascii file in hex form, 8 hex 'digits' per integer,
   10 integers per line, no intervening spaces.  The ascii file
   will be twice as big as the binary file it is reduced to.

   You can see that DIEHARD requires large test files.  But they
   need only be created one at a time, then deleted."

The program analyses the "goodness" (randomness) of the *bits*  so  a 0x3FFFFFF
limit is not relevant. Think of it as an 80,000,000 iteration cointoss.


At 04:34 PM 02/14/2000 -0400, you wrote:
>On Mon, 14 Feb 2000, Brian Broker 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 would be acceptable to concatenate two 16 bit integers provided
>you apply the results of the test only to 'the concatenation of two 16 bit
>integers as generated by rand()'. =)

Joel H. Crook

Manager, Information Services
Certified Novell Administrator
Microsoft Certified Professional, OS Specialist

Kellogg & Andelson Accountancy Corp.
14724 Ventura Blvd. 2nd Floor
Sherman Oaks, CA 91403
(818) 971-5100

--=====================_14631672==_.ALT

<html><div>from the DIEHARD Manual:</div>
<br>
<div>&nbsp;&quot;Write a main program that sends the (hex) output of your
random</div>
<div>&nbsp;&nbsp; number procedure to an ordinary ascii file.&nbsp; Then
invoke the</div>
<div>&nbsp;&nbsp; file on this disk, ASC2BIN.EXE that will prompt for the
names</div>
<div>&nbsp;&nbsp; of your input and output files and do the
conversion.</div>
<br>
<div>&nbsp;&nbsp; Your random number generator should produce 32-bit
integers.</div>
<div>&nbsp;&nbsp; (If 31 bits, left justify by shift-left-one, as some of
the</div>
<div>&nbsp;&nbsp; tests in DIEHARD favor leading bits.)&nbsp; You should
send them to</div>
<div>&nbsp;&nbsp; your ascii file in hex form, 8 hex 'digits' per
integer,</div>
<div>&nbsp;&nbsp; 10 integers per line, no intervening spaces.&nbsp; The
ascii file</div>
<div>&nbsp;&nbsp; will be twice as big as the binary file it is reduced
to.</div>
<br>
<div>&nbsp;&nbsp; You can see that DIEHARD requires large test
files.&nbsp; But they</div>
<div>&nbsp;&nbsp; need only be created one at a time, then
deleted.&quot;</div>
<br>
<div>The program analyses the &quot;goodness&quot; (randomness) of the
*bits*&nbsp; so&nbsp; a 0x3FFFFFF limit is not relevant. Think of it as
an 80,000,000 iteration cointoss. </div>
<br>
<br>
<div>At 04:34 PM 02/14/2000 -0400, you wrote:</div>
<div>&gt;On Mon, 14 Feb 2000, Brian Broker wrote:</div>
<div>&gt;</div>
<div>&gt;&gt; On Mon, 14 Feb 2000 13:22:01 -0500, Everett Williams
wrote:</div>
<div>&gt;&gt;</div>
<div>&gt;&gt; &gt;Has anybody run the Euphoria RNG through the Diehard
test?</div>
<div>&gt;&gt;</div>
<div>&gt;&gt; I decided to go ahead and look into this.&nbsp; The Diehard
test is looking for</div>
<div>&gt;&gt; 32-bit random numbers...&nbsp; The problem with Euphoria's
'rand' function is</div>
<div>&gt;&gt; that it will only produce random numbers up to 0x3FFFFFF
(instead of</div>
<div>&gt;&gt; 0xFFFFFFFF).&nbsp; What would be an acceptable method to
obtain the required</div>
<div>&gt;&gt; range?&nbsp; Is it acceptable to generate two 16-bit random
numbers and</div>
<div>&gt;&gt; concatenate them?&nbsp; Does anybody have any other valid
suggestions?&nbsp; I could</div>
<div>&gt;&gt; try all suggested methods and see what works
best...</div>
<div>&gt;&gt;</div>
<div>&gt;&gt; -- Brian</div>
<div>&gt;&gt;</div>
<div>&gt;</div>
<div>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; It would be
acceptable to concatenate two 16 bit integers provided</div>
<div>&gt;you apply the results of the test only to 'the concatenation of
two 16 bit</div>
<div>&gt;integers as generated by rand()'. =)</div>
<br>

Joel H. Crook<br>
<br>
Manager, Information Services<br>
<font size=1>Certified Novell Administrator<br>
Microsoft Certified Professional, OS Specialist<br>
<br>
</font><b>Kellogg &amp; Andelson Accountancy Corp.<br>
</b><font size=1>14724 Ventura Blvd. 2nd Floor<br>
Sherman Oaks, CA 91403<br>
(818) 971-5100<br>
</font></html>

--=====================_14631672==_.ALT--

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

Search



Quick Links

User menu

Not signed in.

Misc Menu