SE250:lab-5:hlin079

From Marks Wiki
Jump to navigation Jump to search

task1

                    Entropy   Chi Square mean   pi%     Correlation 
Buzhash low	    7.98550	99.00%	125.825	1.26%	-0.000047
Buzhash typical	    7.97970	25.00%	127.177	1.95%	-0.007153
Buzhashn low	    7.98214	50.00%	127.589	2.10%	0.000600
Buzhashn typical    7.98214	50.00%	127.589	2.10%	0.000600
hash crc low	    4.85247	0.01%	99.261	26.10%	-0.285059
hash crc typical    7.77880	0.01%	123.087	1.11%	-0.002250
base256 low	     0.00000	0.01%	97.000	27.32%	undefined
base256 typical	      3.90309	0.01%	107.987	27.32%	0.079032
object low	    2.00000	0.01%	77.000	27.32%	-0.521556
object typical	    4.97364	0.01%	54.918	27.32%	-0.021550
integer low	    4.11606	0.01%	32.385	27.32%	-0.217081
integer typical	   4.11606	0.01%	32.385	27.32%	-0.217081
string low	   7.99463	99.99%	127.867	1.95%	0.009136
string typical	   7.89301	0.01%	126.009	1.42%	-0.021360
rand low	    7.93533	0.01%	112.054	10.82%	-0.066125
rand typical	   7.93951	0.01%	111.686	10.82%	-0.060458
high rand low	    7.98301	75.00%	127.541	0.42%	0.001185
high rand typical   7.98338	75.00%	128.211	1.49%	-0.014177

rand vs high rand

high rand has higher entropy and better chi square compare to rand . The mean of high rand is much closer to 127.5 than rand. Also high rand's pi% and Correlation are much closer to zero compare to rand. Over all high rand has higher randomness than rand.


Entropy: the closer the value is to 8 bits per byte, the more random the numbers returned by the function must be. in this case the entropy of string low is closer to 8bits per bytes. i don't know why my string low has the higher entropy. Because when i look at some other people's outputs their Buzhash lows have the highest entropy.

Ranking based on ehtropy

string low	   7.99463
Buzhash low	    7.98550
high rand typical   7.98338
high rand low	    7.98301
Buzhashn low	    7.98214	
Buzhashn typical    7.98214	
Buzhash typical	    7.97970	

Chi Square: The number of times the values would exceed the random variable obtained gives an indication of how random the numbers must be. Values close to 50% have the highest randomness. the Buzhashn low and typical have the highest randomness{50%}.

Ranking Based on chi square

Buzhashn low	    	50.00%	
Buzhashn typical    	50.00%	
high rand low	    	75.00%	
high rand typical   	75.00%	
Buzhash typical	    	25.00%	

Arithmetic mean: The expected mean for a set of random numbers is always the centre between the highest value and the lowest value. For this set of tests, 127.5 is the expected mean. High rand low has 125.541 which is much closer than the others to the expected mean.

Ranking based on mean

high rand low	  	127.541	
Buzhashn low	    	127.589	
Buzhashn typical    	127.589	
string low	        127.867	
Buzhash typical	    	127.177	

pi%: the numbers are plotted on a 2D grid containing a circle. The percentage of points inside the circle and the percentage of points outside the circle should be the same. The error indicates by how much the two differ. Hence, the closer the error is to 0, the more random the numbers generated must be. the high rand low has 0.42% of the error

ranking based on pi%

high rand low		0.42% 
hash crc typical    	1.11%	
Buzhash low	    	1.26%
string typical	   	1.42%
high rand typical   	1.49%	
string low	   	1.95%	
Buzhash typical	    	1.95%	
Buzhashn low	    	2.10%	
Buzhashn typical        2.10%	

Serial Correlation: Values close to 0 show that the relationship between the numbers is fairly non-existant (and hence must be random).

why is the Correlation for base256 low is undefined?

Ranking based on Correlation

Buzhash low	    	-0.000047
Buzhashn low	    	0.000600
Buzhashn typical    	0.000600
Buzhash typical	   	-0.007153
string low	   	0.009136

Over all Buzhash has highest randomness compare to all the other hush functions.

task2

Buzhash low 100/1000: llps = 2, expecting 2.13803
Buzhash typical 100/1000: llps = 1, expecting 2.13803
CRC low 100/1000: llps = 2, expecting 2.13803
CRC typical 100/1000: llps = 3, expecting 2.13803
base256 low 100/1000: llps = 100, expecting 2.13803
base256 typical 100/1000: llps = 4, expecting 2.13803
Object low 100/1000: llps = 100, expecting 2.13803
Object typical 100/1000: llps = 3, expecting 2.13803
string low 100/1000: llps = 1, expecting 2.13803
String typical 100/1000: llps = 2, expecting 2.13803

Rearranged :

String typical 100/1000:    llps = 2, expecting 2.13803
Buzhash low 100/1000:      llps = 2, expecting 2.13803
CRC low 100/1000:          llps = 2, expecting 2.13803
Buzhash typical 100/1000:  llps = 1, expecting 2.13803
string low 100/1000:       llps = 1, expecting 2.13803
Object typical 100/1000:   llps = 3, expecting 2.13803
CRC typical 100/1000:      llps = 3, expecting 2.13803
base256 typical 100/1000:  llps = 4, expecting 2.13803
base256 low 100/1000:      llps = 100, expecting 2.13803
Object low 100/1000:       llps = 100, expecting 2.13803

String typical ,Buzhash low and CRC low have the best actual performance compare to all the others.


Buzhash has the best performance in both theoretical and actual situation. hash crc low has the best performance in actual situation. (But in the theoretical situation CRC low had an entropy of 4.85247 which is not close to 8 bits per byte. Also it has a chi square of 0.01% which is not close to 50%.The mean of CRC low is 99.261 which is much lower than the expected mean(127.5). the %pi is much greater than 0 . over all theoretical performance of CRC low is not as good as the theoretical performance of Buzhash .