Black Box, White Box, Grey Box

I implemented the Mersenne Twister algorithm and ran a sample of 80 million bits through both DIEHARD and ComScire's RNGMeter test suite. It passes with results comparable to Marsalia's certified bits. This was a black-box test because I don't understand the Mersenne Twister in any detail at all. But I shall be using it from now on for all casual randoms work. It's fast enough and I don't have to spend a week worrying about it every time I want to use it for ordinary work. I'll probably stitch it into my Luna/Scheme environment, which I'd like to get back to sooner rather than later.

In the white-box corner, I ran my Multiplicative Congruential (m = 2^31-1, a = 16807) through ComScire with a resounding "thud" (-- that's a "fail" ), providing supporting evidence for yesterday's DIEHARD failure.  That's a white-box test because not only did I write every byte of the code, I understand every aspect of it in excruciating detail.

In the grey box is C# "Random" class. It also fails both DIEHARD and ComScire, and the statistics look very similar to those of my MC, so I am guessing it's a comparable MC or LC (Linear Congruential).

DIEHARD continues to choke with an end-of-file error for the last few tests on my files created via MC and the C# system Random class. This is all the more mysterious, since I used EXACTLY the same sample sizes and "Console.WriteLine" code to print out the results as I used for the Mersenne Twister and I mimicked Marsaglia's file format for his "bits" files. I am suspecting some internal mungle up due to the statistics' being so bad. Larger samples don't help. Casual perusal with emacs, less, and he (hex edit) reveal no pertinent format or structure differences between the Mersenne Twister file, Marsaglia's bits files, and my MC and C# Random outputs. ComScire gets through all of them without choking, even when they fail execrably.

I may play around with the NIST tests, but their software has no "intelligent defaults," unlike the others, so I will have to study their methodology so as to do the runs.

Published Thursday, August 19, 2004 11:07 AM by brianbec

Comments

# re: Black Box, White Box, Grey Box@ Thursday, August 19, 2004 2:45 PM

Some interesting side data: both my MC and C# system Random deliver 1 to 0 bit ratio of 0.4843! This is really amazingly awful: it means that 48 out of every 100 bits is '1'. It's also near certainty that the two represent the same class of algorithms.

The Mersenne Twister delivers a ratio of 0.499976 with a chi-squared probability of 0.972, meaning, if I have the direction right, only a 3% probability that the fluctuation from a perfect 0.5000 is due to systematic effects. Of course, if I have the direction of the chi-squared test backwards, here, then there is only a 3% chance that the fluctuation *IS* due to chance. Still digging...

brianbec

# re: Black Box, White Box, Grey Box@ Thursday, August 19, 2004 2:51 PM

Oh, the ratios above were for runs of 639 million bits, an appreciable fraction of the period length of my MC, which is 2,147 million.

brianbec

# re: Black Box, White Box, Grey Box@ Thursday, August 19, 2004 4:02 PM

The 1 to 0 bit ratio seems like a pretty basic test, and a pretty momentous failure.

Brad Corbin

# re: Black Box, White Box, Grey Box@ Wednesday, April 27, 2011 5:01 PM

It is certainly interesting for me to read that blog. Thanx for it. I like such topics and everything that is connected to this matter. I would like to read more on that blog soon.            

Natasha  Trider            

<a href="monacoescort.com/">m escort</a>

Natasha Trider

# re: Black Box, White Box, Grey Box@ Tuesday, July 19, 2011 3:07 AM

Thanks , I have recently been searching for information approximately this topic for ages and yours is the best I've came upon so far. But, what concerning the conclusion? Are you positive concerning the source?  <a href=edubacklinksstore.com/>edu backlinks</a>

edu backlinks

Leave a Comment

(required) 
(required) 
(optional)
(required)