2015-10-05 5 views
6

Ho diversi file .txt contenenti un numero elevato di numeri interi (circa 2,5 milioni) generati da vari RNG. Voglio usare la suite di test più dura per testare questi RNG.Utilizzo del file .txt contenente numeri casuali con la suite di test irriducibili

I file .txt simile a questa:

#============================================== 
# generator Park  seed = 1 
#============================================= 
type: d 
count: 2500000 
numbit: 32 
16807 
282475249 

Seguito da ofcourse, più numeri interi. Io uso il seguente comando per eseguire irriducibili con questo file .txt

dieharder -f randdata.txt -a - g 202 

La mia domanda è, è il mio file .txt corretto (in particolare le prime righe), e perché sono queste linee neccesary? La ragione per cui la sto chiedendo è perché ogni file .txt generato da alcuni RNG (alcuni buoni, altri cattivi) fallisce quasi tutti i test e mi chiedo se questo sia dovuto a qualche errore che ho fatto nel passare il file .txt a morire o se i miei RNG sono tutti pessimi.

risposta

8

Sì, quel file di input sembra corretto. Sembra che un certo numero di prove dieharder non riuscire anche con ingressi 10M generati dal proprio generatore di dieharder:

$ dieharder -o -f example.input -t 10000000 # Generate an input file 
$ head -n 10 example.input 
#================================================================== 
# generator mt19937 seed = 3423143424 
#================================================================== 
type: d 
count: 10000000 
numbit: 32 
2310531048 
808929469 
2423056114 
4237891648 
$ dieharder -a -g 202 -f example.input 
#=============================================================================# 
#   dieharder version 3.31.1 Copyright 2003 Robert G. Brown   # 
#=============================================================================# 
    rng_name |   filename    |rands/second| 
    file_input|     example.input| 2.50e+06 | 
#=============================================================================# 
     test_name |ntup| tsamples |psamples| p-value |Assessment 
#=============================================================================# 
# The file file_input was rewound 1 times 
    diehard_birthdays| 0|  100|  100|0.07531570| PASSED 
# The file file_input was rewound 11 times 
     diehard_operm5| 0| 1000000|  100|0.00000000| FAILED 
# The file file_input was rewound 24 times 
    diehard_rank_32x32| 0|  40000|  100|0.00047786| WEAK 
# The file file_input was rewound 30 times 
    diehard_rank_6x8| 0| 100000|  100|0.38082242| PASSED 
# The file file_input was rewound 32 times 
    diehard_bitstream| 0| 2097152|  100|0.56232583| PASSED 
# The file file_input was rewound 53 times 
     diehard_opso| 0| 2097152|  100|0.83072458| PASSED 

Non so esattamente quanti campioni è necessario ottenere "migliori" risultati ... ma fallimenti con solo i numeri di 2,5 milioni sembrano essere previsti.

Dopo alcuni esperimenti, però, sembra che le prove con partenza passando con ~ 120 MB di dati binari casuali:

 
$ dd if=/dev/urandom of=/tmp/random bs=4096 count=30000 
30000+0 records in 
30000+0 records out 
122880000 bytes transferred in 10.873818 secs (11300538 bytes/sec) 
$ du -sh /tmp/random 
117M /tmp/random 
$ dieharder -a -g 201 -f /tmp/random 
#=============================================================================# 
#   dieharder version 3.31.1 Copyright 2003 Robert G. Brown   # 
#=============================================================================# 
    rng_name |   filename    |rands/second| 
file_input_raw|      /tmp/random| 1.11e+07 | 
#=============================================================================# 
     test_name |ntup| tsamples |psamples| p-value |Assessment 
#=============================================================================# 
    diehard_birthdays| 0|  100|  100|0.71230346| PASSED 
# The file file_input_raw was rewound 3 times 
     diehard_operm5| 0| 1000000|  100|0.62093817| PASSED 
# The file file_input_raw was rewound 7 times 
    diehard_rank_32x32| 0|  40000|  100|0.02228171| PASSED 
# The file file_input_raw was rewound 9 times 
    diehard_rank_6x8| 0| 100000|  100|0.20698623| PASSED 
# The file file_input_raw was rewound 10 times 
    diehard_bitstream| 0| 2097152|  100|0.55567887| PASSED 
# The file file_input_raw was rewound 17 times 
     diehard_opso| 0| 2097152|  100|0.20799917| PASSED 

che corrisponde a 122,880,000/4 = 30,720,000 - così circa 31M interi.