Simple question about number theory in CLRS bookThis is theorem 11.5 from CLRS book. Suppose...
Frank Day
Answered
2022-07-09
Simple question about number theory in CLRS book This is theorem 11.5 from CLRS book. Suppose . Consider two distinct keys k and l from , so that . For a given hash function we let
We first note that . Why? Observe that
I'm not very well familiar with Number Theory, so my question is why is correct?
Answer & Explanation
Dobermann82
Expert
2022-07-10Added 15 answers
Step 1 According to Knuth's definition for the mod operation, we have And with the general definition of Congruence, can be rewritten as . We then have Subtract r by s, we have
With the definition of congruence quoted above, we can then rewrite (A) as . Hope this eliminates your doubts.
daktielti
Expert
2022-07-11Added 2 answers
Explanation: I’m turning my comment into an answer. If mod p, and mod p, then mod p, thus mod p, hence mod p.