SE250:lab-5:sbas046

From Marks Wiki
Jump to navigation Jump to search

Task1

Results of comparisons between the different hash functions: What this demonstrated is the Buzzhash low function is the most suitable. The only thing thats is unfavorable is its compression and linked list lengths. It does however have the most random results.

In descending order of randomness:

1)Buzhash low 2)Buzhash typical 3)High Rand typical 4)High Rand low 5)Rand typical 6)Rand low

INPUT VALUES:     

int sample_size = 1000;
int n_keys = 100;
int table_size = 100;
	
------------------------------------------------------------------------
Testing Buzhash low on 1000 samples
Entropy = 7.843786 bits per byte.

Optimum compression would reduce the size
of this 1000 byte file by 1 percent.

Chi square distribution for 1000 samples is 214.46, and randomly
would exceed this value 95.00 percent of the times.

Arithmetic mean value of data bytes is 128.0860 (127.5 = random).
Monte Carlo value for Pi is 3.132530120 (error 0.29 percent).
Serial correlation coefficient is -0.017268 (totally uncorrelated = 0.0).

Buzhash low 100/100: llps = 4, expecting 4.22683
------------------------------------------------------------------------
Testing Buzhash typical on 1000 samples
Entropy = 7.797775 bits per byte.

Optimum compression would reduce the size
of this 1000 byte file by 2 percent.

Chi square distribution for 1000 samples is 250.82, and randomly
would exceed this value 50.00 percent of the times.

Arithmetic mean value of data bytes is 126.5740 (127.5 = random).
Monte Carlo value for Pi is 3.277108434 (error 4.31 percent).
Serial correlation coefficient is -0.007005 (totally uncorrelated = 0.0).

Buzhash typical 100/100: llps = 3, expecting 4.22683
------------------------------------------------------------------------
Testing Rand low on 1000 samples
Entropy = 7.718445 bits per byte.

Optimum compression would reduce the size
of this 1000 byte file by 3 percent.

Chi square distribution for 1000 samples is 368.06, and randomly
would exceed this value 0.01 percent of the times.

Arithmetic mean value of data bytes is 110.5410 (127.5 = random).
Monte Carlo value for Pi is 3.421686747 (error 8.92 percent).
Serial correlation coefficient is -0.048389 (totally uncorrelated = 0.0).

Rand low 100/100: llps = 5, expecting 4.22683
------------------------------------------------------------------------
Testing Rand typical on 1000 samples
Entropy = 7.748395 bits per byte.

Optimum compression would reduce the size
of this 1000 byte file by 3 percent.

Chi square distribution for 1000 samples is 338.88, and randomly
would exceed this value 0.05 percent of the times.

Arithmetic mean value of data bytes is 112.8910 (127.5 = random).
Monte Carlo value for Pi is 3.373493976 (error 7.38 percent).
Serial correlation coefficient is -0.081749 (totally uncorrelated = 0.0).

Rand typical 100/100: llps = 3, expecting 4.22683
------------------------------------------------------------------------
Testing High Rand low on 1000 samples
Entropy = 7.805220 bits per byte.

Optimum compression would reduce the size
of this 1000 byte file by 2 percent.

Chi square distribution for 1000 samples is 265.15, and randomly
would exceed this value 50.00 percent of the times.

Arithmetic mean value of data bytes is 132.9390 (127.5 = random).
Monte Carlo value for Pi is 3.132530120 (error 0.29 percent).
Serial correlation coefficient is -0.041236 (totally uncorrelated = 0.0).

High Rand low 100/100: llps = 5, expecting 4.22683
------------------------------------------------------------------------
Testing High Rand typical on 1000 samples
Entropy = 7.827559 bits per byte.

Optimum compression would reduce the size
of this 1000 byte file by 2 percent.

Chi square distribution for 1000 samples is 221.12, and randomly
would exceed this value 90.00 percent of the times.

Arithmetic mean value of data bytes is 128.9990 (127.5 = random).
Monte Carlo value for Pi is 3.084337349 (error 1.82 percent).
Serial correlation coefficient is -0.025330 (totally uncorrelated = 0.0).

High Rand typical 100/100: llps = 3, expecting 4.22683
------------------------------------------------------------------------

Task 2

It seems that High Rand typical has the best output of the linked list length.