Questions: Universal and Perfect Hashing

4 questions to test your understanding

Score: 0 / 4
Question 1 Multiple Choice

A universal hash family H mapping universe U to {0,...,m-1} guarantees that for any two distinct keys x, y in U: Pr_{h in H}[h(x) = h(y)] <= 1/m. Why is this strictly stronger than assuming a 'random' hash function?

AIt is not stronger — a truly random function automatically satisfies the universal property
BA truly random function from U to {0,...,m-1} requires O(|U| log m) bits to store, which is impractical, while a universal family can be specified with O(log |U|) bits per function — universality achieves the collision bound with compact representation
CUniversal families guarantee no collisions, while random functions allow collisions
DUniversal hashing works only for integers, while random hashing works for all data types
Question 2 Short Answer

In the FKS perfect hashing scheme, the second-level hash tables use space quadratic in the number of keys hashing to each bucket. Despite this, total space is O(n). Why?

Think about your answer, then reveal below.
Question 3 True / False

A 2-universal hash family is sufficient to guarantee O(1) expected lookup time in a chaining hash table, but k-wise independence for larger k provides stronger concentration guarantees.

TTrue
FFalse
Question 4 True / False

Perfect hashing achieves O(1) worst-case lookup for static sets. It cannot handle insertions without rebuilding the entire structure.

TTrue
FFalse