You are on page 1of 2

# MTH2125: Discrete Mathematics Tutorial Questions II Dr. John O.

Mubenwafor
Integers an Di!ision: Mo ular "rithmetic
1. 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) 7 9 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. /ecide whether each of these inte"ers is con"ruent to # mod 17(a) 0 (b) 103 (c) !9 (d) 1!! +,nswer- (a) 0o(b) 0o(c) 1es (d) 0o. 2va'uate the fo''owin" quantities(a) 13 mod 3 (b) (d) !!1 mod !3 (e) (") 101 mod 13 (h) +,nswer- (a) 1 (b) ! (c) 3 (d) 9. 97 mod 11 17 mod ! 199 mod 19 (c) (f) 1## mod 19 1%% mod 7

!. 3.

%.

#.

## 1 3(mod #) and 77 !(mod #) .

Hashing #unctions
*. ,n insurance com(any uses the hashin" function- h(k) = k mod m) 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#).

7.

Which memory 'ocations are assi"ned by the hashin" function- h(k) = k mod m) to the records of insurance com(any customers with the fo''owin" 5ocia' 5ecurity numbers if 101 memory 'ocations are avai'ab'e? (a) 10%#7 *90 (b) %3!!!!1 7 (c) 37!!01919 (d) #0133 7#3 +,nswer- (a) # (b) *0 (c) #! (d) 3. , (ar&in" 'ot has 31 visitor s(aces) numbered from 0 to 30. 6isitors are assi"ned (ar&in" s(aces usin" the hashin" function- h(k) = k mod m) where k is the number formed from the first three di"its on a visitor7s 'icense ('ates) and m is the number of avai'ab'e (ar&in" s(aces. Which s(aces 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" s(ace) when the s(ace they are assi"ned is occu(ied. +,nswer- (a) 7) 19) 7) 7) 1 ) 0 (b) 8a&e the ne9t avai'ab'e s(ace mo 31.

## \$seu oran om %umbers

9. What sequence of (seudorandom numbers is "enerated usin" the 'inear con"ruentia' "enerator xn +1 = (7 xn + %) mod 9 with seed- x0 = 3 ? +,nswer- 7) ) *) 1) !) 0) %) #) 3) 7) ) *) 1) !) 0) %) #) 3 :. What sequence of (seudorandom numbers is "enerated usin" the 'inear con"ruentia' "enerator xn +1 = (% xn + 1) mod 7 with seed- x0 = 3 ? +,nswer- 3) *) %) 3) *) % :. What sequence of (seudorandom numbers is "enerated usin" the 'inear con"ruentia' "enerator xn +1 = 3 xn mod11 with seed- x0 = ! ? +,nswer- !) *) 7) 10) ) !) *) 7) 10) :.

10.

11.

&r'(tolog'
1!. 13. 1%. What is the secret messa"e (roduced from the messa"e- ;<228 1=> 30 8?2 @,ABC usin" the Daesar ci(her? +,nswer- ;@??W EAF GH WB? 5/>0C. What 'etter re('aces the 'etter K when the function f(p) = (7p + 3) mod 26 is used for encry(tion? +,nswer- 6. 2ncry(t the messa"e ;/= 0=8 @,55 I=C by trans'atin" the 'etters into numbers) a(('yin" the encry(tion function "iven) and then trans'atin" the numbers bac& into 'etters(a) f(() J (( K 3) mo !* (the Daesar ci(her) (b) f(() J (( K 13) mo !* (c) f(() J (3( K 7) mo !* +,nswer- (a) IA HAW 5/66 LA (b) HE ,EI D044 8E (c) HF >F< ,?LL MF. /ecry(t the fo''owin" messa"es encry(ted usin" the Daesar ci(her(a) 2=F? <?/H6 (b) W?6W WAI/E (c) ?/W IG@ 6F@ +,nswer- (a) EG>2 L2,05 (b) 8258 8=/,1 (c) 2,8 /3< 5><.

1#.