Hash function

To map a large Universe (U) of possible keys (e.g., all student IDs) into a small, manageable array of size m.

$$ h : U → \{0, 1, ..., m − 1\} $$

Collision

Modern hash function

$$ h(x)=(ax+b)(\text{mod} ~p) $$

For inputs in $\{0, ..., p − 1\}$, if $x1 \ne x2$, then $h(x1) \ne h(x2)$