next up previous
Next: Open Addressing Up: CSE 2320: Algorithms and 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 collection of hash functions H contains exactly |H|/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 = <x0, x1, .., xr> is decomposed into r+1 bytes
a =
<a0, a1, .., ar>, 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.



Copyright © 1998 The University of Texas at Arlington