In hashing with open addressing, the hash table is implemented as an array and there are no linked lists or chaining. Each entry in the array either contains one hashed item or is empty. The hash function defines, for each key $k$, a probe sequence $h(k, 0), h(k, 1), \ldots$ of table locations. To insert the key $k$, we first examine the sequence of table locations in the order defined by the key's probe sequence until we find an empty location; then we insert the item at that position. When searching for an item in the hash table, we examine the sequence of table locations in the order defined by the key's probe sequence until either the item is found or we have found an empty location in the sequence. If an empty location is found, this means the item is not present in the table.
An open-address hash table with $2 n$ entries is used to store $n$ items. Assume that the table location $h(k, j)$ is uniform over the $2 n$ possible table locations and that all $h(k, j)$ are independent.
(a) Show that, under these conditions, the probability of an insertion requiring more than $k$ probes is at most $2^{-k}$.
(b) Show that, for $i=1,2, \ldots, n$, the probability that the $i$ th insertion requires more than $2 \log n$ probes is at most $1 / n^{2}$.
Let the random variable $X_{i}$ denote the number of probes required by the $i$ th insertion. You have shown in part (b) that $\operatorname{Pr}\left(X_{i}>2 \log n\right) \leq 1 / n^{2}$. Let the random variable $X=$ $\max _{1 \leq i \leq n} X_{i}$ denote the maximum number of probes required by any of the $n$ insertions.
(c) Show that $\operatorname{Pr}(X>2 \log n) \leq 1 / n$.
(d) Show that the expected length of the longest probe sequence is $\mathbf{E}[X]=O(\log n)$.