dimanche 20 janvier 2019

Dieharder results change from all fail to 90% pass when converting four byte to an int

I've generated 100M of random numbers in range (0..255). These numbers fail Dieharder tasks (bitnum = 8). However, I can pass this test by combining four bytes into an int. Randomness of the set didn't change, so, something isn't correct with the test settings. What could cause it?

I would be ok with a small difference, but

def prep_input(file_name, number_of_iterations,numbit=32):
    f = open(file_name, "a")            
    max_rand = (-1 + 2 ** numbit)
    print(str(max_rand))
    a = len(str(max_rand))
    for i in range(0, number_of_iterations):
        f.write(str(randint(0, max_rand)).rjust(a) + "\n")

    f1.close()

With header it looks like

#==================================================================
# Dieharder
#==================================================================
type: d
count: 16180337
numbit: 8
255
  0
 93
 ....

dieharder -a -g 202 -f input.txt >>result.txt

Results for failing set
Results for a passing set




Aucun commentaire:

Enregistrer un commentaire