Professional Documents
Culture Documents
1st Semester End of Sem Exams For Discrete Mathematics May 2022
1st Semester End of Sem Exams For Discrete Mathematics May 2022
1st Semester End of Sem Exams For Discrete Mathematics May 2022
–...1/5
SECTION A (ANSWER ALL QUESTINONS) – [40 MARKS]
1. a) Consider the following directed, undirected and weighted graphs below:
(i) Determine the weighted matrix, adjacency list for both graphs
Use Dijkstra’s Algorithm to find the shortest distance from [2 marks]
(ii) Graph 1: vertex s and [5 marks]
(iii) Graph 2: vertex a [5 marks]
to all the other vertices. Determine if there exist any other shortest
paths from s to t and from a to z in each graph?
b) Suppose cells in a computer memory indexed from 0 to 9. From the
0 1 2 3 4 5 6 7 8 9
Hash function below, show how the data would be inserted in the order
given in initially empty cells. Use Collision Resolution or linear
–...2/5
probing policy if required:
H (n) = n mod 10
Cells indexed 0 to 9: Data: 12, 18, 13, 2, 3, 23, 5, 15 [8 marks]
–...3/5
SECTION B (CHOOSE ANY 2) – [20 MARKS]
3. a) Using the Handshaking Principle, determine the number of edges
of a graph with fourteen (14) vertices and each with degree six (6)? [5 marks]
b) A sequence of integers x1 , x2 , ..., xn is defined by
xk
x1 = 1 and xk +1 = for k 1
xk + 2
Calculate x2 , x3 and x4
1
Prove by induction that xn = n 1 ? [5 marks]
2 −1
n
(ii) AB = A + B [1 mark]
(iii) ( A + C )( A + B) = AB + AC [1 mark]
(iv) AB + A + AB = 0 [1 mark]
3
c) Let A = R – {2} and B = R − where R is the set of real
5
3x − 9
numbers. Let f ( x) = , x R . Show that f is bijective
5 x − 10
–...4/5
and hence find the inverse. [4 marks]
–...5/5