Consider a hash table with $m$ slots that uses chaining for collision resolution. The table is initially empty. What is the probability that after 4 keys are inserted that at least a chain of size 3 is created? (Assume simple uniform hashing is used).
- $m^{–2}$
- $m^{–4}$
- $m^{–3}(m–1)$
- $3m^{–1}$
MY TRY
$P(atleast 3) = P(exactly 4) + P(exactly 3)$
$P(exactly 3) = {m \choose 1}\frac {1}{m^3} \frac {(m-1)}{m}*4 = \frac{4(m-1)}{m^3}$ [choose chaining slot and 4 positions for non-chaining slot ]
$P(exactly 4) = {m \choose 1}\frac {1}{m^4} = \frac {1}{m^3} $
$$P(atleast 3) = \frac {1}{m^3} + \frac{4(m-1)}{m^3} =\frac{4m-3}{m^3}$$
Doesn't match any of the options.
Best Answer
Note: Your approach is correct, given that we may assume four pairwise different keys.
$$ $$