GATE / CS ARCHIVE

GATE CSE 2014 SET 3 / QUESTION 40

GATE CSE 2014 Set 3 Q40

Data Structures · Hashing · Full GATE CSE 2014 Set 3 paper

GATE 2014 Set 3, Q40 2 marks · MCQ
Report issue

Hashing

Question 40, GATE 2014: A 100-slot hash table resolves collisions by chaining and uses simple uniform hashing. What is the probability that slots 1,2,3 are all empty after three insertions? A 97³/100³; B (99×98×97)/100³; C (97×96×95)/100³; D (97×96×95)/(3!×100³).
Tap to enlarge
Your answer
Answer & solution

Official answer: A

Step 1: For a given insertion, 97 of the 100 equally likely slots avoid the three prohibited slots, so its avoidance probability is 97/100. Step 2: Under simple uniform hashing the three placements are independent. Chaining permits multiple inserted keys to use the same allowed slot, so the allowed count does not decrease after an insertion. Step 3: Multiply the three factors: (97/100)³, option A. Using 97,96,95 would incorrectly require distinct occupied slots.

Original paper, page 62 · Answer key