Академический Документы
Профессиональный Документы
Культура Документы
Guide/Answers
Diploma in Information Technology
Final Examination
Autumn 2008
WUCT121
Discrete Mathematics
DIRECTIONS TO CANDIDATES
Refer to Page 2
WCA-WUCT121-EXSF Page 1 of 13
START OF EXAM
Question 1 (30 marks) Marks
(a)
(i) Statement. True. 2
Teachers Marking
(b)
(i)
P Q R ((P Q) R) (P ~ Q)
T T T T T F F F
Guide/Answers
1 mark for
T T F T F T F F each column
T F T T T T T T correspondi
ng to each
T F F T F T T T of the
F T T T T F F F principal
connectives
F T F T F T F F suitable
F F T F F T F T adjustments
for errors =
F F F F F T F T 4
(c)
(i) (P Q) ~ Q ~ P
(P Q) ~ Q ~ P
T F 1
T T
T T 1
T F 1
1 for
Since Q cannot be both true and false, there is no combination of T concluding
and F with F on the main connective. Therefore the statement is a statement
tautology.
WCA-WUCT121-EXSF Page 2 of 13
(ii)
(P Q ) ~ Q ~ P
~ ((~ P Q ) ~ Q ) ~ P (Implication Law)
(~ (~ P Q ) ~ ~ Q ) ~ P (De Morgan' s Law)
(~ (~ P Q ) Q ) ~ P (Double Negation Law) 1
((~ ~ P ~ Q ) Q ) ~ P ( De Morgan' s Law)
((P ~ Q ) Q ) ~ P (Double Negation Law) 1
((P Q ) (~ Q Q )) ~ P (Distributive Law)
Teachers Marking
((P Q ) T ) ~ P
(P Q ) ~ P 1
~ P (P Q ) (Commutative Law)
(~ P P ) Q (Associative Law)
Guide/Answers
1
TQ
T
Therefore the statement is a tautology.
[Names of laws not required for full marks.] 1
(d) (i) 1. There is no largest natural number, or for every natural number 2
there is another natural number which is one bigger.
2. Every natural number is one less than a given natural number. 2
(e) (i) ( ) (
n , m , 2 m n n < 2 m+1 ) 2
n , m , (2 m > n ) (n 2 m+1 ) 1
(a) P Q 1
QR 1
P R (Law of Syllogism) 1
P (P R ) R (Modus Ponens) 2
WCA-WUCT121-EXSF Page 3 of 13
(ii) Proof:
(x < 4 x > 4) x >4 1
x 2 > 16 1
x 2 15 > 1 1
(iii) This statement is true.
1 1 1
For example: x = 2, = > 2 x , > x. 2
2 2 x
Teachers Marking
(iv) False.
Counterexample: x = 1, y =1 1
( 1)2 = 12 , but x y 1
Guide/Answers
(c) "x ,
( x 1)2 0 x 2 2 x = 1 0 1
1
x2 +1 2x
= 4k 2 + 2k + 1
(
= 2 2k 2 + k + 1 ) 1
= 2l + 1, l
n 2 + n + 1 = (2m + 1) + 2m + 1 + 1
2 1
= 4m 2 + 4m + 1 + 2m + 1 + 1
= 4m 2 + 6m + 2 + 1
= 2(2m 2 + 3m + 1) + 1
= 2 p + 1, p 1
WCA-WUCT121-EXSF Page 4 of 13
(iv) {1} ( A) False { 1} ( A) and {{ 1}} ( A) 2
(v) C B = {x : x < 0} False. Counterexample: 1 C B but
2
1 {x : x < 0} or 0 C B but 0 {x : x < 0}
Question 3 (30 marks)
(a)
(i) Let A and B be sets. Then A and B are said to be disjoint if
2
A B = .
Teachers Marking
(b) Let x A B .
x A B
x A xB (Definition of set difference) )
Guide/Answers
x A xB
x A B
x A B (Definition of intersection )
A B A B 3
Let x A B .
x A B
x A B (Definition of set intersection )
x A xB
x A xB
x A B (Definition of set difference)
A B A B
A B = A B 3
(c) To prove A ( A B ) = A B .
( A B ) (Inverse Law ) 1
A B (Identity Law )
1
= A B (Definition of set difference)
[Names of laws not required for full marks.]
WCA-WUCT121-EXSF Page 5 of 13
(i) A B = {(3, 4 ), (3, 5), (3, 6 ), (4, 4 ), (4, 5), (4, 6 ), (5, 4 ), (5, 5), (5, 6 )} . 2
(ii) R = {(3, 4 ), (3, 5), (3, 6 ), (4, 5), (4, 6 ), (5, 6 )}. 2
6 x x x
5 x x
4 x
Teachers Marking 3
Guide/Answers
2
1
0 1 2 3 4 5 6
(iv) R 1 = {(4, 3), (5, 3), (5, 4), (6, 3), (6, 4 ), (6, 5)} . 2
(v) No. For first elements 3 and 4, there is more than one second element. 2
(e) F = {( x, y ) : y = 2 x 1}.
F is onto: Range of F is .
F 1 = {( x, y ) : x = 2 y 1} 1
= {( x, y ) : y = 1
2
(x + 1)}
Question 4 (30 marks)
(a) S = {( x, y ) : xy 0}.
WCA-WUCT121-EXSF Page 6 of 13
x , x x = x 2 0 Therefore S is reflexive. 1
x, y , xy 0 yx 0 Therefore S is symmetric.
1
x, y, z , xy 0 yz 0 does not imply xz 0 .
Counterexample x = 1, y = 0, z = 2 . Then xy = 0, yz = 0, xz = 2 < 0 2
Therefore S is not transitive.
Teachers Marking
1 0 3 5 4 2 2
(ii)
(1 2)(2 3 1) = (1 3)
2
(1 2 4 3) = (3 4 2 1) .
Guide/Answers
1
(iii) 1
(c)
(i) Associativity under : "a, b, c , a (b c ) = (a b ) c . 2
(d)
[0, 1) = {x : 0 x < 1} is not well-ordered.
The non-empty subset (0, 1) has no least element. Therefore [0, 1) is not well- 2
ordered.
(e) a|b
b = al , l
1
b 2 = a 2l 2
= ma 2 , m
1
a | b2
(f) CLAIM (n): n , 3 | (2 2 n 1) .
1
CLAIM (1): 2 21 1 = 3, 3 | 3
Therefore CLAIM (1) is true.
Assume CLAIM (k) is true.
1
i.e. 3 | (2 2 k 1), k 1
i.e. 2 2 k 1 = 3l , l (1)
WCA-WUCT121-EXSF Page 7 of 13
It is required to prove CLAIM (k+1) is true, i.e.
2 2 (k + 1 ) 1 = 3 m , m .
LHS = 2 2(k +1) 1
= 2 2k +2 1 1
= 4 2 2k 1
(
= 4 2 2k 1 + 3)
= 4 3l + 3 using (1) 1
= 3(4l + 1)
Teachers Marking
= 3m, m
Guide/Answers
1
i.e. n , 3 | (2 2 n 1) .
m n = m + n 2n 1
= 2k 2n
= 2(k n ) 1
= 2m, m
1
i.e. the difference of the two integers is even.
(h) n , n 2 1 = (n + 1)(n 1) 1
(a)
a1 = 1
a2 = 3
a k = a k 2 + 2a k 1 , for k 3, k
CLAIM(1): a1 = 1 . Therefore a1 is odd, and CLAIM(1) is true. 1
CLAIM(2): a 2 = 3 . Therefore a 2 is odd, and CLAIM(2) is true.
Assume CLAIM(k), CLAIM( k 1 ),CLAIM( k 2 ). CLAIM(1) are true.
1
i.e. a k , a k 1 , a k 2 ,K a1 are all odd.
i.e. a k = 2l 1, a k 1 = 2m 1,K l , mK (1)
WCA-WUCT121-EXSF Page 8 of 13
It is required to prove CLAIM (k+1) is true, i.e. that a k +1 is odd.
a k +1 = a k 1 + 2a k
= 2l 1 + 2 (2m 1) using (1) 1
= 2l 1 + 4m 2
= 2 (l + 2m 1) 1
1
= 2 p 1, p
i.e. a k +1 is odd.
1
Therefore CLAIM (k+1) is true.
Therefore, by the Strong Principle of Mathematical Induction, CLAIM (n) is true
Teachers Marking
(b) (i) d = gcd(544, 1001)
1001 = 1 544 + 457
544 = 1 457 + 87
1
Guide/Answers
457 = 5 87 + 22 1
87 = 3 22 + 21
22 = 1 21 + 1
21 = 1 21 1
d = 1 . 544 and 1001 are relatively prime.
(ii) 544m + 1001n = d
1 = 22 1 21
= 22 1 (87 3 22 )
= 4 22 1 87
1
= 4 (457 5 87 ) 1 87
= 4 457 21 87
= 4 457 21 (544 1 457 )
= 25 457 21 544
= 25 (1001 1 544 ) 21 544 1
= 25 1001 46 544 1
m = 46, n = 25
(c) (i) The quotient remainder theorem: If n and d > 0 are both integers, then there 2
exist unique integers q and r such that n = dq + r and 0 r < d .
(ii) Applying the quotient-remainder theorem,
q, r , n = 3q + r , 0 r < 3 1
Since r = 0, 1, 2 , n = 3q or n = 3q + 1 or n = 3q + 2 .
(iii) Consider three cases.
( )
If n = 3q , n 2 = (3q ) = 9q 2 = 3 3q 2 = 3k , k .
2 1
If n = 3q + 1 ,
( )
n 2 = (3q + 1) = 9q 2 + 6q + 1 = 3 3q 2 + 2q + 1 = 3l + 1, l .
2 1
If n = 3q + 2 , 1
WCA-WUCT121-EXSF Page 9 of 13
n 2 = (3q + 2 ) = 9q 2 + 12q + 4 = 3 (3q 2 + 4q + 1) + 1 = 3m + 1, m .
2
1
Therefore, the square of any integer has the form 3k or 3k + 1 for some integer k.
[35] = [ 7] = [0] 1
[3] = [17]
[12] = [ 2] 1
1
(e) Let n , and a, b, c, d .
Teachers Marking
By the definition of congruence modulo,
ab ac (mod n ) n | (ab ac ) 1
n | a(b c ) 1
Guide/Answers
Since gcd(a, n ) = 1 , by Euclids lemma, n | (b c ) . 1
b c(mod n ) 1
e10
e8
v5 v4 v3
e9
e7
(i) e1 , e2 , e3 , e11 . 1
1
(ii) v1, v2.
1
(iii) e2, e3, e8, e9, e11.
1
(iv) v2, e6, v2; v3, e7, v3.
WCA-WUCT121-EXSF Page 10 of 13
(v) e4 and e5 ; e8 and e9.
2
(vi) 5
1
(vii) 22
1
(viii) A subgraph of G with 2 vertices and 3 edges:
e6
v2 2
e4 e5
Teachers Marking v3
Guide/Answers
(ix) v1, e1, v5, e8, v4, e10, v2, e4, v3. 2
(x) v5, e1, v1, e2, v4, e8, v5, e9, v4, e10, v2, e11, v1, e3, v3, e4, v2, e6, v2, e5, v3,
e7 , v3 . 2
This simple graph does not exist. If it existed, the vertex of degree 4 would
have to be connected by edges to 4 distinct vertices other than itself. This
contradicts the assumption that the graph has 4 vertices in total. 3
(ii) A simple graph with six edges and all vertices of degree 3:
e4 v4 v4 v2
v2 e4 e1
e1 e2 e7 e6 e7 e6 e2 3
v1 v1
e3 v3 e5 e3
v5 v3
e5 v5
(d)
WCA-WUCT121-EXSF Page 11 of 13
Kruskals algorithm:
Teachers Marking
(v1 , v3 ) 4 Yes Not added
Guide/Answers
A minimum spanning tree is:
v1 1 v2
3 4
v3 v4
(e) K 2, 4
v1 v2
v3 v4 v5 v6 1
Let V1 = {v1 , v 2 }, V2 = {v3 , v 4 , v5 , v 6 }
K 2, 4 = {V , E} is complete bipartite because V1 V2 = V , V1 V2 = and
each vertex in V1 is connected to each vertex in V2 by exactly one edge.
WCA-WUCT121-EXSF Page 12 of 13
Teachers Marking
Guide/Answers
END OF EXAM
WCA-WUCT121-EXSF Page 13 of 13