GATE / CS ARCHIVE

GATE CSE 2023 / QUESTION 20

GATE CSE 2023 Q20

Algorithms · Hashing & Randomized Algorithms · Full GATE CSE 2023 paper

GATE 2023, Q20 1 mark · MCQ
Report issue

Hashing & Randomized Algorithms

Question 20, GATE 2023: An adversary chooses k keys for m hash slots, k>m, to maximize collisions. Which strategy best counters a malicious fixed key set: A division with a fixed modulus; B multiplication with a fixed constant; C universal hashing; D choose division or multiplication based on whether k is prime?
Tap to enlarge
Your answer
Answer & solution

Official answer: C

Universal hashing chooses a hash function randomly from a family with a bounded collision probability for distinct fixed keys, preventing an adversary from exploiting one known deterministic mapping. Division and multiplication with fixed constants can be targeted. Thus C under the standard model in which the selected random function is hidden or chosen independently of the adversary’s key set; unrestricted adaptive knowledge would require additional assumptions.

Teaching detail. For a universal family H, each distinct fixed pair x,y has collision probability at most 1/m when h is selected randomly from H. With chaining, the expected number of other keys colliding with a particular key is consequently bounded by (k−1)/m by linearity of expectation. Since k>m, some collisions are unavoidable by the pigeonhole principle: the goal is controlling concentrated collisions, not eliminating them. Random selection must be independent of the malicious fixed keys for this standard guarantee to apply.

Original paper, page 18 · Answer key