Professional Documents
Culture Documents
D-Final New M131Full
D-Final New M131Full
D-Final New M131Full
Table of Contents
Kuwait – Salmiya – Salem Al-Mubarak St. North Salmiya Market Complex 2nd floor.
(965) 2572 6686 - 2571 4343 (965) 2571 0775 info@qeati.com
2
Relations Revision
Q1 : Let R and S be relations on the set { 1,2,3,4} given by :
R = {(1,1),(1,3),(2,1),(2,4),(3,1),(3,3),(4,2)}
S = {(1,1),(1,2),(2,1),(3,3),(3,4),(4,1)}
(a) Represent R and S by two matrices M R and M S . (4 marks)
1 0 1 0 1 1 0 0
M R 1 0 0 1 , M 1 0 0 0
1 0 1 0 S 0 0
1 1
0 1 0 0 1 0 0 0
b) R2= R°R={(x,x),(y,x),(z,x),(w,y)}
R-1= { (x,x),(x,y),(y,z),(z,w)}
Kuwait – Salmiya – Salem Al-Mubarak St. North Salmiya Market Complex 2nd floor.
(965) 2572 6686 - 2571 4343 (965) 2571 0775 info@qeati.com
3
Kuwait – Salmiya – Salem Al-Mubarak St. North Salmiya Market Complex 2nd floor.
(965) 2572 6686 - 2571 4343 (965) 2571 0775 info@qeati.com
4
Kuwait – Salmiya – Salem Al-Mubarak St. North Salmiya Market Complex 2nd floor.
(965) 2572 6686 - 2571 4343 (965) 2571 0775 info@qeati.com
5
Kuwait – Salmiya – Salem Al-Mubarak St. North Salmiya Market Complex 2nd floor.
(965) 2572 6686 - 2571 4343 (965) 2571 0775 info@qeati.com
6
Kuwait – Salmiya – Salem Al-Mubarak St. North Salmiya Market Complex 2nd floor.
(965) 2572 6686 - 2571 4343 (965) 2571 0775 info@qeati.com
7
Q: let G is a graph
(a) Represent G by an incidence matrix. ( 5 points)
1 1 0 0 0 0
Incidence matrix I = 1 0 1 1 0 0
0 0 0 0 1 1
0 1 1 0 1 0
0 0 0 1 0 1
(b) Represent G by an adjacency matrix (5 points)
0 1 0 1 0
Adjacency matrix : A = 1 0 0 1 1
0 0 0 1 1
1 1 1 0 0
0 1 1 0 0
(c) Write an adjacency list that represents G. Assuming vertices are written in alphabetical order (4 points)
Vertix a b c d e
Adjacent Vertices b,d a,d,e d,e a,b,c b,c
(d) Use the adjacency matrix to find number of paths of length 2 from a to each of c,d and e . (6 points )
These are the entries (1,3) , (1,4) and (1,5) in A2 first row of A2 [ 2 1 1 1 1]So they are all of length 1
Kuwait – Salmiya – Salem Al-Mubarak St. North Salmiya Market Complex 2nd floor.
(965) 2572 6686 - 2571 4343 (965) 2571 0775 info@qeati.com
8
1 0 0 1 1 0
0 1 1 0 0 1
Q-5: Let A 1 0 0 0 0 0 be the incidence matrix of a graph G.
0 1 1 0 1 0
0 0 0 1 0 1
(a) ( 5 points ) Draw the graph of G .
V V
1 2
e2
e4
e3 e6
e1
e5
V3 V V
4 5
Kuwait – Salmiya – Salem Al-Mubarak St. North Salmiya Market Complex 2nd floor.
(965) 2572 6686 - 2571 4343 (965) 2571 0775 info@qeati.com
9
Kuwait – Salmiya – Salem Al-Mubarak St. North Salmiya Market Complex 2nd floor.
(965) 2572 6686 - 2571 4343 (965) 2571 0775 info@qeati.com
10
Q_5
(a) (4 points) Let G be a graph with 9 edges such that every vertex of G has degree 3.
Find the number of vertices of G.
Let n be the number of vertices of G.The sum of the degrees of vertices = 2 (number of
edges) .Thus 3n = 18 n = 6
(b) ( 3 points each ) How many edges and how many vertices does each of the following
graphs has ?
(i) K7 (ii) K5,7
(i) K7 has 7 vertices and 7(7 1) 21 edges
2
(ii) K5,7 has (5 +7 ) =12 vertices and 5*7=35 edges.
Kuwait – Salmiya – Salem Al-Mubarak St. North Salmiya Market Complex 2nd floor.
(965) 2572 6686 - 2571 4343 (965) 2571 0775 info@qeati.com
11
Kuwait – Salmiya – Salem Al-Mubarak St. North Salmiya Market Complex 2nd floor.
(965) 2572 6686 - 2571 4343 (965) 2571 0775 info@qeati.com
12
Q– 5.
(a) (6 marks)
(i) Represent the expression x y x 4 / 3 in a binary tree.
2
Prefix: +^+xy2/-x43
Postfix: xy+2^x4-3/+
(b) (4 marks) Consider the prefix code represented by the binary tree below:
Kuwait – Salmiya – Salem Al-Mubarak St. North Salmiya Market Complex 2nd floor.
(965) 2572 6686 - 2571 4343 (965) 2571 0775 info@qeati.com
13
Kuwait – Salmiya – Salem Al-Mubarak St. North Salmiya Market Complex 2nd floor.
(965) 2572 6686 - 2571 4343 (965) 2571 0775 info@qeati.com
14
Q–5:
1 1 1 0
1 0 0 1
a) [3+2 Marks] Let A be the adjacency matrix of a graph G = (V, E),
1 0 0 1
0 1 1 0
V = {a, b, c, d}.
i. Draw G.
Kuwait – Salmiya – Salem Al-Mubarak St. North Salmiya Market Complex 2nd floor.
(965) 2572 6686 - 2571 4343 (965) 2571 0775 info@qeati.com
15
(Q4) The quotient q and remainder r when 4180 is divided by 245 are :
(a) q = 15 , r = 17 (b) q = 18 , r = 3 (c) q = 17 , r = 15 (d) q = 17 , r = 13
Kuwait – Salmiya – Salem Al-Mubarak St. North Salmiya Market Complex 2nd floor.
(965) 2572 6686 - 2571 4343 (965) 2571 0775 info@qeati.com
16
(c) Suppose that P(x) is statement “(x-2)(x-3)<0” where domain is set of integers . Determine truth
Kuwait – Salmiya – Salem Al-Mubarak St. North Salmiya Market Complex 2nd floor.
(965) 2572 6686 - 2571 4343 (965) 2571 0775 info@qeati.com
17
Q2 (a) ( 5 points) Find a,b and c if : a = 40 div 7 2b+c = 15 mod 7 b+2c = 17 mod 9
a = 40 div 7 = 5
15 mod 7 =1 and 17 mod 9 = 8
2b+c = 1 and b+2c = 8 gives b = -2 , c = 5
b) Using prime factorization decide whether the number 173 is prime or not .
173 14. Prime numbers less than 14 are 2,3,5,7,11,13 and 173 is not divisible by any of them .
Hence 173 is prime
c)Write the prime factorization of 89100 and 277200 and hence find their GCD and LCM .
89100 22.34.52.11 277200 24.32.52.7.11
LCM = 2 .3 .5 .7.11 2506800
4 4 2
Q3 (a) (6 points) Use the set builder notation to describe the sets
A = { 0 , 3 , 6 , 9 , 12 , 15 } A {3n : 0 n 5, n integer}
B = { 1 , 4 , 9 , 16 , 25 , …} B {n2 : n 0, n Integer}
Kuwait – Salmiya – Salem Al-Mubarak St. North Salmiya Market Complex 2nd floor.
(965) 2572 6686 - 2571 4343 (965) 2571 0775 info@qeati.com
18
Kuwait – Salmiya – Salem Al-Mubarak St. North Salmiya Market Complex 2nd floor.
(965) 2572 6686 - 2571 4343 (965) 2571 0775 info@qeati.com
19
Kuwait – Salmiya – Salem Al-Mubarak St. North Salmiya Market Complex 2nd floor.
(965) 2572 6686 - 2571 4343 (965) 2571 0775 info@qeati.com
20
Kuwait – Salmiya – Salem Al-Mubarak St. North Salmiya Market Complex 2nd floor.
(965) 2572 6686 - 2571 4343 (965) 2571 0775 info@qeati.com
21
Complete Graphs:
Kn , is a simple graph with n nodes in which every node is adjacent to every other node:
Note that Kn has n vertices and edges e = n(n-1)/2
Complete graphs: Kn
Complete bipartite graphs: Km,n
Kuwait – Salmiya – Salem Al-Mubarak St. North Salmiya Market Complex 2nd floor.
(965) 2572 6686 - 2571 4343 (965) 2571 0775 info@qeati.com