Probability & Random Variables


Answer & solution
Answer: ((n−1)/n)^K, for independent uniform hashing. (no official key was published)
A single inserted key avoids bucket 1 with probability (n−1)/n=1−1/n. Bucket 1 is empty after K insertions exactly when every one of those K keys avoids it. Under independent hashing, multiply the K probabilities to obtain
P(bucket 1 empty) = (1−1/n)K.
The table may have collisions in other buckets; they do not affect this event. External chaining allows arbitrarily many keys in a bucket, so K need not be at most n. For K=0 the probability is 1, including the n=1 case, by the empty-product convention. For n=1 and K≥1 it is 0, because the only bucket must receive every key. For n=2,K=3 it is (1/2)3=1/8.
The independence qualification is substantive. The source supplies the uniform probability for any individual key, but marginal uniformity alone is not enough to multiply events. For example, choose one uniformly random bucket U and send all keys to U. Every key is marginally uniform, yet bucket 1 remains empty with probability 1−1/n for every K≥1, rather than (1−1/n)K. The displayed answer uses the usual independent-uniform hashing model and is not claimed under that correlated alternative.