Homework 14

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


  1. Suppose we have a universal hash function .

    1. Show that if , then with probability , is injective. (That is, for all .)
    2. 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.
  2. 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.

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

    2. Show that

    1. Show that
    1. Show that1

    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.


1 The "" used to be "", but this was a typo. Morally, any constant would be fine.