next up previous
Next: Open Addressing Up: l5 Previous: Universal Hashing

Universal Hash Functions

We want to select from a set of hash functions H with reasonable certainty that the above property is true.

Thus, the number of functions $\mid$f$\mid$ in H such that h(x) = h(y) for x,y $\in$ U must satisfy

\begin{displaymath}\frac{\mid f \mid}{\mid H \mid} \;=\; \frac{1}{m} \;\longrightarrow\;
\mid f \mid \;=\; \frac{\mid H \mid}{m}\end{displaymath}



Definition: A universal collection of hash functions H contains exactly $\vert H\vert/m$ hash functions such that h(x) = h(y) for x,y $\in$ U.




\begin{displaymath}h_a(x) \;=\; \sum_{i=0}^{r} a_i x_i \; mod \; m\end{displaymath}

where key x = \(<x_0, x_1, .., x_r>\) is decomposed into r+1 bytes
a = \(<a_0, a_1, .., a_r>\), each chosen randomly from {0, 1, .., m-1}.

\(H \;=\; \cup_a \{h_a\}\) is a universal collection of hash functions.

Thus, we want to randomly select ``a'' each time.


next up previous
Next: Open Addressing Up: l5 Previous: Universal Hashing