GATE Computer ScienceModerateGATE CS (PYQ pattern)

Twenty distinct keys are hashed independently and uniformly into 100 slots. What is the expected number of keys that share their slot with at least one other key?

  1. A. 1.90
  2. B. 3.48
  3. C. 3.80
  4. D. 2.85

Correct answer: B. 3.48

A fixed key is alone iff the other 19 keys avoid its slot: probability 0.99¹⁹ ≈ 0.826. So the expected number of keys that collide is 20·(1 − 0.99¹⁹) ≈ 3.48. 1.90 = C(20, 2)/100 is the expected number of colliding pairs, and 3.80 doubles it (overcounting keys in triple collisions).

More Algorithms questions

Exams that ask this topic