SE250:lab-5:kkan048

From Marks Wiki
Jump to navigation Jump to search

This is my testing condition.

 int sample_size = 300;
 int n_keys = 1000;
 int table_size = 100;

Sample_size can not be too low/high.If it is too low/high,the results between different function will not be shown.

buzhash is a most common hash function.So i think it is a high standard function in the test. buzhash has a Entropy greater than 7 just after sample_size 300. So i choose 300 as a sample size.

SAMPLE SIZE 300

In  Typical entropy source,
                                   buzhash     buzhashn   hash CRC   base256   
Entropy               :            7.258579    7.392708   6.288118   3.901501
Optimum compression:               9%          7%         21%         51%
Chi square:                        25.00%      99.00%     0.01%       0.01%
Arithmetic mean:(127.5 = random)   127.6200    122.2267   101.9633    103
Monte Carlo error:                 6.95%       4.41%      4.41%       27.32%
Serial correlation coefficient:    0.030493    0.035384   0.072278    0.282614
(totally uncorrelated = 0.0)


In  Low entropy source,

                                   buzhash     buzhashn   hash CRC   base256   
Entropy               :            7.348095    7.392708   3.614340   0.000000
Optimum compression:               8%          7%         54%        100%
Chi square:                        75.00%      99.00%     0.01%      0.01%
Arithmetic mean:(127.5 = random)   131.6200    122.2267   94.1633    97
Monte Carlo error:                 3.23%       4.41%      27.32%     27.32%
Serial correlation coefficient:   -0.083985    0.035384  -0.386868   all values equal!
(totally uncorrelated = 0.0)



Unix Random Number Generator

SAMPLE SIZE 300

In  Typical entropy source,
                                   Rand        high_rand   
Entropy of the output :            7.258579    7.392708   
Optimum compression:               9%          7%         
Chi square:                        25.00%      99.00%     
Arithmetic mean:(127.5 = random)   127.6200    122.2267   
Monte Carlo error:                 6.95%       4.41%      
Serial correlation coefficient:    0.030493    0.035384   
(totally uncorrelated = 0.0)


In  Low entropy source,

                                   Rand        high_rand
Entropy of the output :            7.317278    7.247632   
Optimum compression:               8%          9%         
Chi square:                        50.00%      25.00%     
Arithmetic mean:(127.5 = random)   108.3600    128.2033   
Monte Carlo error:                 14.59%       0.69%      
Serial correlation coefficient:    -0.041849   0.010037 
(totally uncorrelated = 0.0)

I am still looking at the randomness meaning of the individual output parameters. So i just rank them in 3 group.

Rank 1:buzhash,buzhashn,UNRG
Rank 2:hash CRC
Rank 3:base256