mth 2125 tutorial: modular arithmetic

Upload: drmube-j-o-mubenwafor

Post on 03-Jun-2018

215 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/13/2019 MTH 2125 Tutorial: Modular Arithmetic

    1/2

    MTH2125: Discrete Mathematics

    Tutorial Questions II Dr. John O. Mubenwafor

    Integers an Di!ision:

    Moular "rithmetic1. What are the quotient and remainder when

    (a) 101 is divided by 11? (b) 11 is divided by 3?(c) 1 is divided by 3? (d) 19 is divided by 7?

    (e) 111 is divided by 11? (f) 79 is divided by !3?

    (") 1001 is divided by 13? (h) 0 is divided by 19?

    (i) 3 is divided by #? ($) % is divided by 1?(&) %% is divided by ? (') 777 is divided by !1?

    (m) 1!3 is divided by 19? (n) 1 is divided by !3?

    (o) !00! is divided by 7? () 1!3%#*7 is divided by 1001?

    (q) 100 is divided by 101?+,nswer- (a) 9 ! (b) % 1 (c) 1 ! (d) ! # (e) 11 10 (f) 3% 7 (") 77 0 (h) 0. 0 (i) 0 3

    ($) % 0

    !. /etermine whether 17 is con"ruent to # modu'o * and whether !% and 1% are con"ruent

    modu'o *. +,nswer- yes no

    3. /ecide whether each of these inte"ers is con"ruent to # mod 17-

    (a) 0

    (b) 103(c) !9

    (d) 1!! +,nswer- (a) o(b) o(c) es (d) o

    %. 2va'uate the fo''owin" quantities-

    (a) 13 mod 3 (b) 97 mod 11 (c) 1## mod 19

    (d) !!1 mod !3 (e) 17 mod ! (f) 1%% mod 7(") 101 mod 13 (h) 199 mod 19

    +,nswer- (a) 1 (b) ! (c) 3 (d) 9

    #. f 7 !(mod #) and 11 1(mod#) show that- 1 3(mod #) and 77 !(mod #) .

    Hashing #unctions

    *. ,n insurance comany uses the hashin" function- h(k) = k modm to assi"n memory'ocations to the records of its customers. 4ind the memory 'ocations of the records of its

    customers with the fo''owin" 5ocia' 5ecurity numbers if 111 memory 'ocations are

    avai'ab'e?

    (i) 0*%!1!%(ii) 0371%9!1!

    (iii) 107%0#7!3 +,nswer- (i) 1% (ii) *# (iii) 1% (1#)

    1

  • 8/13/2019 MTH 2125 Tutorial: Modular Arithmetic

    2/2

    7. Which memory 'ocations are assi"ned by the hashin" function- h(k) = k modm to the

    records of insurance comany customers with the fo''owin" 5ocia' 5ecurity numbers if

    101 memory 'ocations are avai'ab'e?(a) 10%#7*90 (b) %3!!!!17

    (c) 37!!01919 (d) #01337#3 +,nswer- (a) # (b) *0 (c) #! (d) 3

    . , ar&in" 'ot has 31 visitor saces numbered from 0 to 30. 6isitors are assi"ned ar&in"

    saces usin" the hashin" function- h(k) = k modm where kis the number formed from

    the first three di"its on a visitors 'icense 'ates and mis the number of avai'ab'e ar&in"saces. Which saces are assi"ned by the hashin" function to cars that have the fo''owin"

    first three di"its on their 'icense 'ates?

    (a) 317 91 007 100 111 310

    (b) /escribe a rocedure visitors shou'd fo''ow to find a free ar&in" sace when thesace they are assi"ned is occuied.

    +,nswer- (a) 7 19 7 7 1 0 (b) 8a&e the net avai'ab'e sace mo31

    $seuoranom %umbers9. What sequence of seudorandom numbers is "enerated usin" the 'inear con"ruentia'

    "enerator 1 (7 %) mod9n nx x+ = + with seed- 0 3x = ?

    +,nswer- 7 * 1 ! 0 % # 3 7 * 1 ! 0 % # 3 :

    10. What sequence of seudorandom numbers is "enerated usin" the 'inear con"ruentia'

    "enerator 1 (% 1) mod 7n nx x+ = + with seed- 0 3x = ? +,nswer- 3 * % 3 * % :

    11. What sequence of seudorandom numbers is "enerated usin" the 'inear con"ruentia'

    "enerator 1 3 mod11n nx x+ = with seed- 0 !x = ? +,nswer- ! * 7 10 ! * 7 10 :

    &r'(tolog'1!. What is the secret messa"e roduced from the messa"e- ; 82 @,ABC

    usin" the Daesar ciher? +,nswer- ;@W EAF GH WB 5/>C

    13. What 'etter re'aces the 'etter Kwhen the functionf(p) = (7p + 3) mod26is used forencrytion? +,nswer- 6

    1%. 2ncryt the messa"e ;/= =8 @,55 I=C by trans'atin" the 'etters into numbersa'yin" the encrytion function "iven and then trans'atin" the numbers bac& into

    'etters-

    (a) f() J ( K 3) mo!* (the Daesar ciher)(b) f() J ( K 13) mo!* (c) f() J (3 K 7) mo!*

    +,nswer- (a) IA HAW 5/66 LA (b) HE ,EI D44 8E (c) HF >F< ,LL MF

    1#. /ecryt the fo''owin" messa"es encryted usin" the Daesar ciher-

    (a) 2=F 2 L2,5 (b) 8258 8=/, (c) 2,8 /< 5>