Applications of Modular Arithmetic. A picture containing building, sitting, bench, side Description automatically generated.
Hashing. Hash function: h(k) = k(mod N).
Hashing. Problem: Which memory locations are assigned by hashing functions h(k) = k mod 101 to the records of an insurance company with the Social security number 104578690?.
. Hashing. Solution: >104578690 mod 101 = 1035432.5742574 >1035432.5742574 – 1035432 = 0.5742574 >0.5742574 * 101 = 57.9999974 104578690 = 101(1035432)+58 Record 58.
. ISBN (International Standard Book Number). d13 ≅ 10 – (d1 + 3d2 + d3 + 3d4 + d5 + 3d6 + d7 + 3d8 + d9 + 3d10 + d11 + 3d12) mod 10.
. Ex. ISBN = 978-0-359-82517-2. d13 ≅ 10 – (d1 + 3d2 + d3 + 3d4 + d5 + 3d6 + d7 + 3d8 + d9 + 3d10 + d11 + 3d12) mod 10 10 – (128 mod 10) 10 – 8 = 2.
. Ex. ISBN = 978-0-359-82517-2. d13 ≅ 10 – (9 + 21 + 0 + 8 + 3 + 15 + 9 + 24 + 2 + 15 + 1 + 21) mod 10.
. Casting of 9. 3074 6017 13814 1810 27 3611 Total = 28353.
Encryption. Solves the classical cryptographic problem of secure communication..