<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://wiki.kram.nz/index.php?action=history&amp;feed=atom&amp;title=SE250%3Alab-5%3Ajhor053</id>
	<title>SE250:lab-5:jhor053 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.kram.nz/index.php?action=history&amp;feed=atom&amp;title=SE250%3Alab-5%3Ajhor053"/>
	<link rel="alternate" type="text/html" href="https://wiki.kram.nz/index.php?title=SE250:lab-5:jhor053&amp;action=history"/>
	<updated>2026-05-02T11:48:07Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.3</generator>
	<entry>
		<id>https://wiki.kram.nz/index.php?title=SE250:lab-5:jhor053&amp;diff=6559&amp;oldid=prev</id>
		<title>Mark: 20 revision(s)</title>
		<link rel="alternate" type="text/html" href="https://wiki.kram.nz/index.php?title=SE250:lab-5:jhor053&amp;diff=6559&amp;oldid=prev"/>
		<updated>2008-11-03T05:19:48Z</updated>

		<summary type="html">&lt;p&gt;20 revision(s)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Lab 5==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
With:&lt;br /&gt;
&amp;lt;pre&amp;gt;int sample_size = 1000;&lt;br /&gt;
int n_keys = 200;&lt;br /&gt;
int table_size = 100;&amp;lt;/pre&amp;gt;&lt;br /&gt;
My sample size is a fairly large as we wanted to test to make sure the data is being tested to make sure ti is random enough. I also chose to make sure my ratio of keys to table size is 2 to make sure it can handle more keys than table size,&lt;br /&gt;
&lt;br /&gt;
My results are:&lt;br /&gt;
&amp;lt;pre&amp;gt;For low_entropy_src&lt;br /&gt;
Type		Entropy	ChiSq	Mean	Pi % er	S. C. C.&lt;br /&gt;
buzhash         7.84379 95.00%  128.086 0.29%   -0.017268&lt;br /&gt;
buzhashn        7.82387 90.00%  127.373 1.06%   -0.007118&lt;br /&gt;
hash_CRC        4.04588 0.01%   94.848  27.32%  -0.395249&lt;br /&gt;
base256         0.00000 0.01%   97.000  27.32%  undefined&lt;br /&gt;
Java_Integer    2.79173 0.01%   31.125  27.32%  -0.230200&lt;br /&gt;
Java_Object     2.00000 0.01%   77.000  27.32%  -0.521556&lt;br /&gt;
Java_String     7.91760 99.99%  126.441 1.25%   0.003240&lt;br /&gt;
rand            7.71844 0.01%   110.541 8.92%   -0.048389&lt;br /&gt;
high_rand       7.79205 25.00%  134.546 4.12%   -0.028254&lt;br /&gt;
&lt;br /&gt;
Now for typical_entropy_src&lt;br /&gt;
Type		Entropy	ChiSq	Mean	Pi % er	S. C. C.&lt;br /&gt;
buzhash         7.79778 50.00%  126.574 4.31%   -0.007005&lt;br /&gt;
buzhashn        7.82387 90.00%  127.373 1.06%   -0.007118&lt;br /&gt;
hash_CRC        4.21252 0.01%   92.006  26.56%  -0.465003&lt;br /&gt;
base256         0.00000 0.01%   97.000  27.32%  undefined&lt;br /&gt;
Java_Integer    2.79173 0.01%   31.125  27.32%  -0.230200&lt;br /&gt;
Java_Object     2.00000 0.01%   77.000  27.32%  -0.521556&lt;br /&gt;
Java_String     7.90224 99.99%  126.914 6.61%   0.025449&lt;br /&gt;
rand            7.76960 5.00%   112.412 11.98%  -0.044490&lt;br /&gt;
high_rand       7.82756 90.00%  128.999 1.82%   -0.025330&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The difference between rand and high_rand is that high rand is generally better but comes at some slight processing power and memory use. High rand tends to &amp;#039;over&amp;#039; randomize where as rand just &amp;#039;under&amp;#039; randomizes (ie tends to be biased to under values rather than higher values).&lt;br /&gt;
&lt;br /&gt;
I would rate in order from best to worse...&lt;br /&gt;
1, buzhash it generally turned out teh better random variables and overall got the better values compared to the &amp;#039;expected random values&amp;#039;.&lt;br /&gt;
2, buzhashn, was more reliable across typical entropy and low entropy values&lt;br /&gt;
3, high_rand was off a bit more but still acceptable&lt;br /&gt;
4, rand was just below high random as even though its values are good its still off (+- but lower than) high_rand.&lt;br /&gt;
5, Java_string was good but its ChiSq value let it down as its putting it in the extreme for randomness.&lt;br /&gt;
6th, Java_integer was slightly better than the below but still really fail it seems.&lt;br /&gt;
7th equal, Java_Object, hash_CRC, and base256 failed as the tests didn&amp;#039;t seems all that reliable to go off these tests and seems to be quite off &amp;#039;expected random variables&amp;#039; and generally low quality.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
===Overall===&lt;br /&gt;
A very good intro to hashing, and great input from John H for explaining the different concepts and tests for randomness. The length was good (I was a bit slow this morn :S) A bit more explanation of the different test on the handout would have helped too though.&lt;/div&gt;</summary>
		<author><name>Mark</name></author>
	</entry>
</feed>