* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Download MTH2125: Discrete Mathematics Tutorial Questions 3 Dr. John O
Survey
Document related concepts
Index of cryptography articles wikipedia , lookup
Large numbers wikipedia , lookup
Mathematics of radio engineering wikipedia , lookup
List of prime numbers wikipedia , lookup
Proofs of Fermat's little theorem wikipedia , lookup
Elementary mathematics wikipedia , lookup
Transcript
MTH2125: Discrete Mathematics Tutorial Questions 3 Dr. John O. Mubenwafor Integers and Division: Modular Arithmetic 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) 789 is divided by 23? (g) 1001 is divided by 13? (h) 0 is divided by 19? (i) 3 is divided by 5? (j) 4 is divided by 1? (k) 44 is divided by 8? (l) 777 is divided by 21? (m) –123 is divided by 19? (n) –1 is divided by 23? (o) –2002 is divided by 87? (p) 1,234,567 is divided by 1001? (q) –100 is divided by 101? [Answer: (a) 9, 2 (b) –4, 1 (c) –1, 2 (d) 2, 5 (e) –11, 10 (f) 34, 7 (g) 77, 0 (h) 0. 0 (i) 0, 3 (j) 4, 0] 2. Determine whether 17 is congruent to 5 modulo 6 and whether 24 and 14 are congruent modulo 6. [Answer: yes, no] 3. Decide whether each of these integers is congruent to 5 mod 17: (a) 80 (b) 103 (c) –29 (d) –122 [Answer: (a) No(b) No(c) Yes (d) No] 4. Evaluate the following quantities: (a) 13 mod 3 (b) (d) –221 mod 23 (e) (g) –101 mod 13 (h) [Answer: (a) 1 (b) 2 (c) 3 (d) 9] 5. –97 mod 11 –17 mod 2 199 mod 19 If 7 2(mod 5) and 11 1(mod 5) , show that: (c) (f) 155 mod 19 144 mod 7 18 3(mod 5) and 77 2(mod 5) . Hashing Functions 6. An insurance company uses the hashing function: h(k) = k mod m, to assign memory locations to the records of its customers. Find the memory locations of the records of its customers with the following Social Security numbers if 111 memory locations are available? (i) 064212848 (ii) 037149212 (iii) 107405723 [Answer: (i) 14 (ii) 65 (iii) 14 (15)] 1 7. Which memory locations are assigned by the hashing function: h(k) = k mod m, to the records of insurance company customers with the following Social Security numbers if 101 memory locations are available? (a) 104578690 (b) 432222187 (c) 372201919 (d) 501338753 [Answer: (a) 58 (b) 60 (c) 52 (d) 3] 8. A parking lot has 31 visitor spaces, numbered from 0 to 30. Visitors are assigned parking spaces using the hashing function: h(k) = k mod m, where k is the number formed from the first three digits on a visitor’s license plates, and m is the number of available parking spaces. Which spaces are assigned by the hashing function to cars that have the following first three digits on their license plates? (a) 317, 918, 007, 100, 111, 310 (b) Describe a procedure visitors should follow to find a free parking space, when the space they are assigned is occupied. [Answer: (a) 7, 19, 7, 7, 18, 0 (b) Take the next available space mod 31] Pseudorandom Numbers 9. What sequence of pseudorandom numbers is generated using the linear congruential generator xn1 (7 xn 4) mod 9 with seed: x0 3 ? [Answer: 7, 8, 6, 1, 2, 0, 4, 5, 3, 7, 8, 6, 1, 2, 0, 4, 5, 3 …] 10. What sequence of pseudorandom numbers is generated using the linear congruential generator xn1 (4 xn 1) mod 7 with seed: x0 3 ? [Answer: 3, 6, 4, 3, 6, 4 …] 11. What sequence of pseudorandom numbers is generated using the linear congruential generator xn1 3xn mod11 with seed: x0 2 ? [Answer: 2, 6, 7, 10, 8, 2, 6, 7, 10, 8 …] Cryptology 12. What is the secret message produced from the message: “MEET YOU IN THE PARK” using the Caesar cipher? [Answer: “PHHW BRX LQ WKH SDUN”] 13. What letter replaces the letter K when the function f(p) = (7p + 3) mod 26 is used for encryption? [Answer: V] 14. Encrypt the message “DO NOT PASS GO” by translating the letters into numbers, applying the encryption function given, and then translating the numbers back into letters: (a) f(p) = (p + 3) mod 26 (the Caesar cipher) (b) f(p) = (p + 13) mod 26 (c) f(p) = (3p + 7) mod 26 [Answer: (a) GR QRW SDVV JR (b) QB ABG CNFF TB (c) QX UXM AHJJ ZX] 15. Decrypt the following messages encrypted using the Caesar cipher: (a) EOXH MHDQV (b) WHVW WRGDB (c) HDW GLP VXP [Answer: (a) BLUE JEANS (b) TEST TODAY (c) EAT DIM SUM] 2