Page 408, Exercise 4


The technique discussed does not produce a uniform hash
function.  Let me illustrate:

 
Assume that we allow two character identifiers of the form: A, A1, A2, B, etc.  Further assume that x=16 bits with 8 bits used to represent each identifier. According to the text the first bit (the leftmost) of x1 must be 1. This leaves us 7 free bits in each identifier which is sufficient to store the characters by their ASCII representation. The hash values for the identifiers A, A1, A2, and A3 are:

Identifier: A        A1               A2              A3

x1  1100 0001     1100 0001         1100 0001       1100 0001
x2  1000 0000     1011 0001         1011 0010       1011 0011
______________   _____________     ___________    ____________
xor 0100 0001     0111 0000         0111 0011       0111 0010


As you can see, if we select the middle four bits, identifiers A1, A2 and A3 will all have the same hash value.