*Due Friday, April 3 at 10:00 PM. Please refer to the homework policy here.*

Suppose we have a universal hash function .

- Show that if , then with probability , is injective. (That is, for all .)
- Using part (a) show how to build a hash table over keys with space that has max load 1 with constant probability (say ), using only a universal hash function.

The goal of this problem is to show how to get constant time access for keys with space, using only universal hash functions.

The high level idea is similar to the hash tables discussed in lecture where we would use a universal hash into a smaller array and make a linked list out of the collisions. Here the array has size . When we have a set of (say) collisions at an array cell, rather than making a linked list of length , and we build a hash table of size with maximum load 1, using part (2). (We may have to retry if we fail.) If the total size (summing the lengths of the first array and each of the secondary arrays) comes out to bigger than (say) , we try again.

For each let be the number of keys that hash to the th cell. Show that

Show that

- Show that

- Show that
^{1}

Together, (a), (b), (c), and (d), show that this approach will build a "perfect" hash table over the keys in space with probability of success at least , using only universal hash functions. We can then keep repeating the construction until it succeeds.