Midterm 2020
Midterm 2020
ID NUMBER: GROUP/SECTION:
MIDTERM EXAMINATION
1 HOUR 30 MINUTES
EXAMINATION DURATION:
ADDITIONAL MATERIALS
ALLOWED TO BE USED: CALCULATOR
DISCRETE Mathematics MSC 2050 Mid-term exam - Page 2 of 8 8th week of Fall 2019
STUDENT’s SIGNATURE:
DISCRETE Mathematics MSC 2050 Mid-term exam - Page 3 of 8 8th week of Fall 2019
2. (8 points)
(a) (2 points) Translate the following statement to an English sentence
(b) (2 points) Show that the statement in (a) is false over the domain of real numbers.
(c) (2 points) Change the statement in (a) (restrict the domain) so that the new statement is true over the
domain of real numbers.
(d) (2 points) Change the statement in (a) (restrict the domain) so that the new statement is true over the
domain of integers.
DISCRETE Mathematics MSC 2050 Mid-term exam - Page 4 of 8 8th week of Fall 2019
STUDENT’s SIGNATURE:
A = {−1, 2, 4, 6}
DISCRETE Mathematics MSC 2050 Mid-term exam - Page 5 of 8 8th week of Fall 2019
4. (6 points) (a) (4 points) Write an algorithm in pseudocode, which counts number of 1s in a given bit string
of length n.
For example, in the case when the bit string is 10010 your algorithm must return 2.
(b) (2 points) Find the worst and average time complexities of your algorithm from (a).
DISCRETE Mathematics MSC 2050 Mid-term exam - Page 6 of 8 8th week of Fall 2019
STUDENT’s SIGNATURE:
5. (8 points) Consider the affine cypher on the English alphabet given by the encryption function e() =
(3 + 1) mod 26.
(a) (2 points) Find the inverse of 3 modulo 26.
(b) (2 points) Find the decryption function.
(c) (3 point) Decrypt the encrypted message “ORGWZOT ZD ZLURDDZEIN”. The alphabet below may be
helpful.
(d) (1 points) Explain why the decryption is not possible in case when the encryption function is e() =
(13 + 2) mod 26.
DISCRETE Mathematics MSC 2050 Mid-term exam - Page 7 of 8 8th week of Fall 2019
Do NOT fill P.1 P.2 P.3 P.4 P.5 Total
max points 8 8 10 6 8 40
your
score
DISCRETE Mathematics MSC 2050 Mid-term exam - Page 8 of 8 8th week of Fall 2019