Maths Olympiad Prep

Track / Stage 6 / 183 of 400 #1183 of 1964

Problem 1183

National olympiad, first round
Number theory Difficulty 6.3 Prove it

3. Let the hashing function be h(K)K(modm)h(K) \equiv K(\bmod m), with 0h(K)<m0 \leqslant h(K)<m, and let the probing sequence for collision resolution be hj(K)h(K)+jq(modm)h_{j}(K) \equiv h(K)+j q(\bmod m), 0hj(K)<m0 \leqslant h_{j}(K)<m, for j=1,2,,m1j=1,2, \ldots, m-1. Show that all memory locations are probed
a) if mm is prime and 1qm11 \leqslant q \leqslant m-1.
b) if m=2rm=2^{r} and qq is odd.

This one wants a proof. Work it on paper, then read the official solution and mark yourself. Be honest about it: the record is only any use to you if it is.

Official solution

None

Source: NuminaMath-1.5, licensed Apache-2.0. Statement and solution reproduced as published; topic, difficulty and ordering added by this site.