List of exercises 5 - IC

List of exercises 5
5.10 Consider throwing m balls into n bins, and for convenience let the bins be numbered from 0 to n − 1. We say
there is a k-gap starting at bin i if bins i, i + 1, . . . , i + k − 1 are all empty.
(a) Determine the expected number of k-gaps.
(b) Prove a Chernoff-like bound for the number of k-gaps. (Hint: If you let Xi = 1, when there is a k-gap
starting at bin i, then there are dependencies between Xi and Xi+1 ; to avoid these dependencies, you
might consider Xi and Xi+k .)
5.14 (a) In Theorem 5.7 we showed that, for any nonnegative fuctions f ,
!
h
i
h
i
X (m)
(m)
(m)
E f (Y1 , . . . , Yn(m) ) ≥ E f (X1 , . . . , Xn(m) ) Pr
Yi
=m .
i
h
i
(m)
(m)
Prove that if E f (Y1 , . . . , Yn ) is monotonically increasing in m, then
E
h
i
(m)
f (Y1 , . . . , Yn(m) )
!
h
i
X (m)
(m)
(m)
≥ E f (X1 , . . . , Xn ) Pr
Yi
≥m ,
i
i
h
(m)
(m)
again under the condition that f is nonnegative. Make a similar statement for the case when E f (X1 , . . . , Xn )
is monotonically decreasing in m.
i
h
(m)
(m)
(b) Using part (a) and Exercise 5.13, prove Theorem 5.10 for the case that E f (X1 , . . . , Xn ) is monotonically increasing.
5.18 An undirected graph on n vertices is disconnected if there exists a set of k < n vertices such that there is no
edge between this set and the rest of the graph. Otherwise, the graph is said to be connected. Show that there
exists a constant c such that if N ≥ cn log n then, with probability 1 − o(1), a graph randomly chosen from
Gn,N is connected.
5.21 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), . . . 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 2n entries is used to store n items. Assume that the table location h(k, j) is
uniform over the 2n 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, . . . , n, the probability that the ith insertion requires more than 2 log n probes is
at most 1/n2 .
Let the random variable Xi denote the number of probes required by the ith insertion. You have shown in part
(b) that Pr (Xi > 2 log n) ≤ 1/n2 . Let the random variable X = max1≤i≤n Xi denote the maximum number
of probes required by any of the n insertions.
(c) Show that Pr (X > 2 log n) ≤ 1/n.
(d) Show that the expected length of the longest probe sequence is E [X] = O(log n).
1