Faculty Of Computer Studies M131 Discrete Mathematics Final Exam

Faculty Of Computer Studies
M131
Discrete Mathematics
Final Exam – Answer Key
Summer Semester – 2013
Date: ______20/08/2013_____
Number of Exam Pages:
(5) Time Allowed:
(Including this cover sheet)
(2) Hours
Instructions:
1) The Exam consists of two parts: Multiple Choice questions (10 marks) and
Essay Questions (40 marks)
2) Read carefully the instructions related to each part of the exam
3) Write your answers on the separate answer booklet
M131 – Summer 2013
1
Final Exam
Part 1: MULTIPLE CHOICE QUESTIONS
You may solve all questions. Each question is worth 2 marks. Your grade in this
part is that of the best 5 questions, giving a total of 10 possible marks.
Q–1: The inverse of the statement “If you practice well, you will win the game” is:
(a) If you don’t practice well, you will win the game.
(b) You will win the game if you practice well.
(c)If you don’t win the game, then you did not practice well.
(d) If you win the game, then you must have practiced well.
(e) None of the above
Q–2: Let S={a,b,c,d}, then |P(S)|:
(a) 4
(b) 8
(c) 16
(d) 20
(e) None of the above
Q–3: The symmetric closure of the relation T={(0,1),(1,2),(2,2),(0,3)}on the set
A={0,1,2,3} is:
(a) {(0,0),(1,1),(2,2),(3,3)}
(b) {(0,1),(1,0),(1,2),(2,2),(0,3),(3,0)}
(c) {(1, 0), (2,1),(3,0)}
(d) {(0,0), (1,0),(2,1),(3,0)}
(e) None of the above
Q–4: A full 3-ary tree with 5 internal vertices has a total number of vertices n=:
(a) 16
(b) 15
(c) 8
(d) 6
(e) None of the above
Q-5: Which of the following is false in a complete bi-partite graph Km,n?
(a) It has mn edges
(b) It has m+n vertices
(c) It is a simple undirected graph
(d) Every vertex has degree m
(e) None of the above
M131 – Summer 2013
2
Final Exam
Q–6: The value of the expression  20 / 6 3 7 given in prefix notation is:
(a) 6
(b) 16.5
(c) 12
(d) 0
(e) None of the above
II. ESSAY QUESTIONS PART (WORTH 40 POINTS).
You may try all questions. Each question is worth 10 points. Your grade in this
part is that of the best 4 questions. Please show the details of your work and not
just the final answer. Write down your answers neatly in the Answer Book
provided.
Q–1.
(a) (4 marks) Find a and b in the below system:
ì a+ b = 185mod 6
í
î2a- b = -22div13
𝑎+𝑏 =5
{
2𝑎 − 𝑏 = −2
By adding the two equations, 3a = 3 => a = 1
b=4
(b) (4 marks) Decide whether the two statements
p  q  r  are logically equivalent.
 p  q   p  r 
and
Student can either prove the logical equivalence using truth tables or equivalence laws
Method 1:
p® q
p® r
 p  q    p  r  qÙr p® (qÙr)
p q r
T T T T
T
T
T
T
T T F T
F
F
F
F
T F T F
T
F
F
F
T F F F
F
F
F
F
F T T T
T
T
F
T
F T F T
T
T
F
T
M131 – Summer 2013
3
Final Exam
F F T T
T
T
F
T
F F F T
T
T
F
T
Comparing the highlighted columns shows that the two expression are equivalent
Method 2:
p ® (qÙr) = ØpÙ(qÙr) = (ØpÙ q)Ù(ØpÙr)
(p ® q)Ù(p ® r) = (ØpÙq)Ù(ØpÙr)
(c) (2 marks) Determine whether130  5 mod 25 .
130 - 5 =125 º 0mod25 => True
Q–2:
(a) (5 marks)
(i) Find the universal set U and the subset A, if:
A  B  {1,5}
A  {2,6,7,8,10}
B  {2,3,9,10} (Hint: Use a Venn Diagram)
A={1,3,5,9}
U={1,2,3,5,6,7,8,9,10}
(ii)
Find the bit string representation of the set A  B .
A  B ={1,2,3,5,9,10}
bitstring representation: 111100011
(b) (2 marks) Find the hexadecimal representation of (567)8.
(567)8= (101110111)2 = (0001 0111 0111)2 = (177)16
M131 – Summer 2013
4
Final Exam
(c) (3 marks) Decrypt the message “RNXXNTS” which was encrypted using the
function f(p) =(p+5)mod26
Encrypted letter
f(p)
f(p)-5
(f(p)-5)mod26
plaintext letter
R
17
12
12
M
N
13
8
8
I
X
23
18
18
S
X
23
18
18
S
N
13
8
8
I
T
19
14
14
O
Q–3.
(a) (5 marks) Consider the set A= {1,2,3,6,12,24,36,48}.
(i)
Draw the Hasse Diagram of the poset (A,|)
(ii)
(iii)
(iv)
Find the maximal and minimal elements.
Maximal elements: 36 and 48
Minimal element: 1
Find the least and greatest element if any.
1 is the least element
No greatest element
Find the greatest lower bound and least upper bound of the subset {1,2,3}.
Upper bounds={6,12,24,36,48}
Lowerbounds={1}
Glb=1
Lub=6
M131 – Summer 2013
5
Final Exam
S
18
13
13
N
(b) (5 marks) Consider the relation S on the set A={1,2,3,4} defined as follows:
S  {(a, b) | a divides b}
(i)
List the elements of S.
S={(1,1),(1,2),(1,3),(1,4),(2,2),(2,4),(3,3),(4,4)}
(ii) Is S an equivalence relation?Justify.
S is reflexive (all (a,a)  S)
S is not symmetric, example (1,4)  S but (4,1)  S
=> S is not an equivalence relation
(iii) Find the transitive closure of S.
Transitive closure= S
(iv) Find the matrix representation of S.
æ 1 1 1 1 ö
ç
÷
ç 0 1 0 1 ÷
ç 0 0 1 0 ÷
ç 0 0 0 1 ÷
è
ø
Q–4
1
0
(a) Let A= 
1

0
(i)
0 1 0 0 0
0 0 1 1 1
 be the incidence matrix of a graph G.
1 0 1 0 0

0 1 0 1 0
(3 marks) Draw the graph G.
M131 – Summer 2013
6
Final Exam
(ii)
(4 marks) Find the adjacency matrix of G.
æ 0 0 1 1 ö
ç
÷
ç 0 1 1 1 ÷
ç 1 1 1 0 ÷
ç 1 1 0 0 ÷
è
ø
(b) (3 marks) Re-write the following without any negations on quantifiers:
(i)
Ø"x$y(x > y)
$x"y(x £ y)
(ii) Ø((x = 3) ® (y = 4))
(x = 3)Ù(y ¹ 4)
M131 – Summer 2013
7
Final Exam
Q– 5.
(a) (6 marks)
2
(i) Represent the expression x  y   x  4 / 3 in a binary tree.
(ii) Is the tree balanced? Justify.
Yes the tree is balanced since all the leaves are at the last two levels (h and h-1
i.e. 2 and 3)
(iii) Find the prefix and postfix notation of the above expression.
Prefix: +^+xy2/-x43
Postfix: xy+2^x4-3/+
M131 – Summer 2013
8
Final Exam
(b) (4 marks) Consider the prefix code represented by the binary tree below:
(i) Encode the word “student”.
1100 1101 1111 000 001 01 1101
(ii) Decode the bit string 010011101
NET
M131 – Summer 2013
9
Final Exam