View
261
Download
5
Category
Preview:
Citation preview
WUCT121 Logic Tutorial Exercises Solutions 1
WUCT121
Discrete Mathematics
Logic
Tutorial Exercises Solutions
1. Logic
2. Predicate Logic
3. Proofs
4. Set Theory
5. Relations and Functions
WUCT121 Logic Tutorial Exercises Solutions 2
Section 1: Logic Question1
(i) If 3=x , then 2<x .
(a) Statement
(b) False
(c) 23 <⇒= xx
(ii) If 0=x or 1=x , then xx =2 .
(a) Statement
(b) True
(c) xxxx =⇒=∨= 2)10(
(iii) There exists a natural number x for which xx 22 −= .
(a) Statement
(b) False
(iv) If �∈x and 0>x , then if 1>x then 1>x ..
(a) Statement
(b) True
(c) )11()0( >⇒>⇒>∧∈ xxxx �
(v) 5=xy implies that either 1=x and 5=y or 5=x and 1=y .
(a) Statement
(b) False. Consider 1−=x and 5−=y or 5−=x and 1−=y .
(c) ))15()51((5 =∧=∨=∧=⇒= yxyxxy
(vi) 0=xy implies 0=x or 0=y .
(a) Statement
(b) True
(c) 000 =∨=⇒= yxxy
(vii) yxxy = .
(a) Statement
(b) True
(viii) There is a unique even prime number.
(a) Statement
(b) True, x = 2.
WUCT121 Logic Tutorial Exercises Solutions 3
Question2
(a) If x is odd and y is odd then yx + is even.
p: x is odd. q: y is odd. r: yx + is even.
Form: rqp ⇒∧ .
(b) It is not both raining and hot.
p: It is raining. q: It is hot
Form: ( )qp ∧~ , alternatively qp ~~ ∨
(c) It is neither raining nor hot.
p: It is raining. q: It is hot
Form: qp ~~ ∧ , alternatively ( )qp ∨~ .
(d) It is raining but it is hot.
p: It is raining. q: It is hot.
Form: qp ∧ .
(e) 21 ≤≤− x .
2:,2:,1:,1: =<=−<− xsxrxqxp .
Form: )()( srqp ∨∧∨ .
Question3 :
(a) QP ∨ : Mathematics is easy or I do not need to study.
(b) QP ∧ : Mathematics is easy and I do not need to study
(c) Q~ : I need to study.
(d) Q~~ : I do not need to study.
(e) P~ : Mathematics is not easy.
(f) QP ∧~ : Mathematics is not easy and I do not need to study.
(g) QP ⇒ : If Mathematics is easy, then I do not need to study
Question4
(a) The truth tables for ( ) qqp ∧∨~ and ( ) qqp ∨∧~ .
p q (~p ∨ q) ∧ q (~p ∧ q) ∨ q
T T F T T F F T
T F F F F F F F
F T T T T T T T
F F T T F T F F
Step: 1 2 3* 1 2 3*
The tables are the same
(b) The truth tables for ( ) pqp ∧∨~ and ( ) pqp ∨∧~ .
p q (~p ∨ q) ∧ p (~p ∧ q) ∨ p
T T F T T F F T
T F F F F F F T
F T T T F T T T
F F T T F T F F
Step: 1 2 3* 1 2 3*
The tables are not the same. The student’s guess is false
WUCT121 Logic Tutorial Exercises Solutions 4
Question5
(a) The truth tables for pp ~∨ and pp ~∧ .
p p ∨ ~p p ∧ ~p
T T F F T
F T T F F
2* 1 2* 1
(b) pp ~∨ is a tautology i.e. always true; pp ~∧ is a contradiction, i.e. always false
(c) Use truth tables.
p q (p ∨ ~p) ∨ q (p ∧ ~p) ∧ q
T T T F T F F F
T F T F T F F F
F T T T T F T F
F F T T T F T F
Step: 2 1 3* 2 1 3*
Notice that “true ∨ anything” is true and “false ∧ anything” is false
Conclusion: If you have a compound statement R of the form “ P∨T ”, where T
stands for a tautology (and P is any compound statement), then R is also a
tautology. Similarly, if you have a compound statement, S, of the form “ P∧F ”,
where F stands for a contradiction, then S is also a contradiction.
Question6
(a) The truth tables for the statements ( ) ( )rqpp ∨∧∨ ~ and rq ∨ .
p q r (p ∨ ~p) ∧ (q ∨ r) q ∨ r
T T T T F T T T
T T F T F T T T
T F T T F T T T
T F F T F F F F
F T T T T T T T
F T F T T T T T
F F T T T T T T
F F F T T F F F
Step: 2 1 4* 3 1*
Notice that the two statements are logically equivalent.
In fact, the truth value of the first is dependent entirely on the second
WUCT121 Logic Tutorial Exercises Solutions 5
(b) The truth tables for the statements ( ) ( )rqpp ∧∨∧ ~ and rq ∧ .
p q r (p ∧ ~p) ∨ (q ∧ r) q ∧ r
T T T F F T T T
T T F F F F F F
T F T F F F F F
T F F F F F F F
F T T F T T T T
F T F F T F F F
F F T F T F F F
F F F F T F F F
Step: 2 1 4* 3 1*
Notice that the two statements are logically equivalent.
In fact, the truth value of the first is again dependent entirely on the second.
Conclusion: If you have a compound statement R of the form “ P∧T ”, where T stands
for a tautology (and P is any compound statement), then the truth-value of R depends
entirely on the truth-value of P. Similarly, if you have a compound statement, S, of
the form “ P∨F ”, where F stands for a contradiction, then the truth-value of S
depends entirely on the truth-value of P.
Question7
(a) ( ) ( )qpqp ~⇒∨⇒
(p ⇒ q) ∨ (p ⇒ ~ q)
Step 1 4* 3 2
Place F under main connective F
⇒ must be F F F
1st ⇒ , p must be T and q must be F.
2nd ⇒ , p must be T and ~q must be F
T F T F
q must be T T
q cannot be both T and F , thus ( ) ( )qpqp ~⇒∨⇒ can only ever be true and is a tautology
(b) ( ) ( )pqqp ⇒∨⇒~
~( p ⇒ q) ∨ (q ⇒ p)
Step 2 1 4* 3
Place F under main connective F
~must be F and⇒ must be F F F
1st ⇒ must be T. 2
nd ⇒ , q must be T
and p must be F
T T F
1st ⇒ p can be F and q can be T,
no conflict
F T
There is no contradiction, thus the statement is not a tautology
WUCT121 Logic Tutorial Exercises Solutions 6
(c) ( ) ( )( )qprqp ⇒∨⇒∧ ~
(p ∧ q) ⇒ (~r ∨ (p ⇒ q)
Step 1 5* 2 4 3
Place F under main connective F
∧ must be T and∨ must be F T F
∧ p must be T and q must be T
∨ ~r must be F and ⇒ must be F
T T F F
⇒ p must be T and q must be F T F
q cannot be both T and F , thus ( ) ( )( )qprqp ⇒∨⇒∧ ~ can only ever be true and is a
tautology
Question8
(a) ( )
ityAssociativ~~
LawsMorgan'De)~(~
LawnImplicatio)(~
rqp
rqp
rqprqp
∨∨≡
∨∨≡
∨∧≡⇒∧
(b)
( )
LawDominance
LawNegation
ityAssociativ~
LawnImplicatio)(~
T
qT
qpp
qppqpp
≡
∨≡
∨∨≡
∨∨≡∨⇒
Question9
(a)
( )
RHS
NegationDouble~
sMorgan'De~~~
LawnImplicatio)(~~
~LHS
=
∧≡
∧≡
∨≡
⇒=
qp
qp
qp
qp
(b) ( )
( )
( )RHS
nImplicatio
ityAssociativ)(~
NegationDouble)(~
sMorgan'De)~~(~
LawnImplicatio~~
~LHS
=
∨⇒≡
∨∨≡
∨∨≡
∨∨≡
∨∧≡
⇒∧=
rqp
rqp
rqp
rqp
rqp
rqp
WUCT121 Logic Tutorial Exercises Solutions 7
Question10
(a) If x is a positive integer and 32 ≤x then 1=x .
The proposition is True.
If x is a positive integer, then 332 ≤⇒≤ xx .
Now 7.13 ≈ and so 1=x .
(b) ( ) ( )( ) ( ) ( )( )01~0~1~ >∧≤⇔≤∨> yxyx .
The proposition is false. (You should have tried proving it using De Morgan’s Laws and
failed.)
Now find values of x and y that make the statement false.
Let 0=x and 1=y .
( ) ( )( ) ( )
( ) ( )( ) False.ison propositiand the
Falseis 01~ Thus,
True also is 01
True is 0~1~
>∧≤
>∧≤
≤∨>
yx
yx
yx
Question11
(a)
≤>∨>≡
≤∨>≡
≤∨>≡
≤⇒>
ofNegation)0()1(
NegationDouble)0(~)1(
LawnImplicatio)0(~))1((~~
)0(~)1(~
yx
yx
yx
yx
(b) ( ) ( )
( ) ( )( ) ( ) ≤>∨>≡
>∨≤≡
>⇒≤
ofNegation10
LawnImplicatio10~
10
xy
xy
xy
.
Question12
( )( )( )
( )
Law Idempotent
ityAssociativ
NegationDouble
sMorgan'De~~~~
~~~
qp
qqp
qqp
qqp
qqp
∨≡
∨∨≡
∨∨≡
∨∨≡
∧∨
WUCT121 Logic Tutorial Exercises Solutions 8
Section 2 :Predicate Logic
Question1
(a) Every real number that is not zero is either positive or negative.
The statement is true.
(b) The square root of every natural number is also a natural number.
The statement is false (consider 2=n ).
(c) Every student in WUCT121 can correctly solve at least one assigned problem.
Lecturers are yet to work out if this is true or false!
Question2
(a) ( )( )000,, =∧=⇒=∈∀∈∀ yxxyyx ��
The statement is false (consider 1=x and 0=y ).
(b) yxyx ≤∈∃∈∀ ,, ��
The statement is true.
(c) ∃ student s in WUCT121, ∀ lecturer’s jokes j, s hasn’t laughed at j.
True or false ??
Question3 Let H be the set of all people (human beings).
(a) qpHqHpP loves ,,: ∈∀∈∃ .
( )
( )qpHqHp
qpHqHp
qpHqHpP
lovet doesn' ,,
loves ,~,
loves ,,~:~
∈∃∈∀≡
∈∀∈∀≡
∈∀∈∃
In a nice world, P is true!.
(b) qpHqHpP loves ,,: ∈∀∈∀ .
( )( )
qpHqHp
qpHqHp
qpHqHpP
lovet doesn' ,,
loves ,~,
loves ,,~:~
∈∃∈∃≡
∈∀∈∃≡
∈∀∈∀
In a perfect world, P is true!
(c) qpHqHpP loves ,,: ∈∃∈∃ .
( )( )
qpHqHp
qpHqHp
qpHqHpP
lovet doesn' ,,
loves ,~,
loves ,,~:~
∈∀∈∀≡
∈∃∈∀≡
∈∃∈∃
P is definitely true!
(d) qpHqHpP loves ,,: ∈∃∈∀ .
( )( )
qpHqHp
qpHqHp
qpHqHpP
lovet doesn' ,,
loves ,~,
loves ,,~:~
∈∀∈∃≡
∈∃∈∃≡
∈∃∈∀
In our world, P is probably true!
WUCT121 Logic Tutorial Exercises Solutions 9
(e) �� ∈∈∀ xxP ,: .
( )
��
��
∉∈∃≡
∈∈∀
xx
xxP
,
,~:~
P~ is true.
(f)
( )( )
pnpn
pnpn
pnpnP
2,,
2,~,
2,,~:
≠∈∀∈∃≡
=∈∃∈∃≡
=∈∃∈∀
��
��
��
( )
pnpn
pnpnP
2,,
2,,~~:~
=∈∃∈∀≡
=∈∃∈∀
��
��
P is true.
(g) not primeis ,: nnP �∈∃ .
( )
primeis ,
not primeis ,~:~
nn
nnP
�
�
∈∀≡
∈∃
P is true.
(h) angle right tria is , triangle: TTP ∀ .
( )
angle right tria not is , triangle
angle right tria is , triangle~:~
TT
TTP
∃≡
∀
P~ is true.
Question4
(a) ( )01, >⇒>∈∀ xxx �
This statement is true. Clearly, 0 so,10 ><< xx
(b) ( )21, >⇒>∈∀ xxx �
This statement is false. Let 5.1=x . Then 2 but 1 <> xx .
(c) ( )xxxx >⇒>∈∃ 21,�
This statement is true. Let 2=x . Then 1>x and xx =>= 242 .
(d)
<
+⇒>∈∃
3
1
11,
2x
xxx �
This statement is true. Let 3=x . Then 1>x and 3
1
10
3
12<=
+x
x.
(e) 9,, 22 =+∈∀∈∀ yxyx ��
This statement is false. Let 1=x and 1=y . Then 9222 ≠=+ yx .
(f) 1,, 2 +<∈∃∈∀ yxyx ��
This statement is true. For ,�∈x let 2xy = . Then clearly 12 +< yx .
(g) 0,, 22 ≥+∈∀∈∃ yxyx ��
This statement is true. Let 0=x . For each 0, 2 ≥∈ yy � , and we have
0222 ≥=+ yyx .
WUCT121 Logic Tutorial Exercises Solutions 10
(h) ( )22,, yxyxyx <⇒<∈∃∈∃ ��
This statement is true. Let 0=x and 1=y . Then yx < and 22 10 yx =<= .
Question5 For each of the following statements,
(i) ( )ξξ <≠∃>∀ xx ,0,0~
( )ξξ
ξξ
≥≠∀>∃≡
<≠∃>∃≡
xx
xx
,0,0
,0~,0
The negation of the statement is false.
For any 0>ξ , we can take 2
ξ=x and we have 0≠x but ξ<x .
(ii) ( )2,,~ xyxy <∈∀∈∃ �,�
( )2
2
,,
,~,
xyxy
xyxy
≥∈∃∈∀≡
<∈∀∈∀≡
�,�
�,�
The negation of the statement is false.
Let 1−=y . We know 02 ≥x for all �∈x , i.e. yx >2 .
(iii)
<
+<⇒<∈∀∈∀ y
yxxyxxy
2,,~ ��
( )( )yxxyyxxy
yyx
xyx
yxxy
yyx
xyxxy
yyx
xyxxy
≥∨≤∧<∈∃∈∃≡
≥
+∨≤
+∧<∈∃∈∃≡
<
+<⇒<∈∃∈∃≡
<
+<⇒<∈∀∈∃≡
,,
22,,
2~,,
2,~,
��
��
��
��
The negation of the statement is false.
Clearly, ( )yxxyyx ≥∨≤∧< is equivalent to yxyx ≥∧< , which is
impossible.
Question6
(a)
2,
)2(~,
)2,(~:~
2
2
2
≠∈∀≡
=∈∀≡
=∈∃
xx
xx
xxP
�
�
�
(b)
xxx
xxx
xxxQ
21,
)21(~,
)21,(~:~
2
2
2
<+∈∃≡
≥+∈∃≡
≥+∈∀
�
�
�
WUCT121 Logic Tutorial Exercises Solutions 11
Question7
(a)
),,(
))(~,,(
)),(~,(
),,(:~~
),,(:
xyyx
xyyx
xyyx
xyyxP
xyyxP
≥∈∀∈∃≡
<∈∀∈∃≡
<∈∃∈∃≡
<∈∃∈∀
<∈∃∈∀
��
��
��
��
��
The true statement is P because for a real number x, x – 1 is a smaller real
number.
(b)
0,
00,
)0(~)0(~,
))00(~,(
))00(,(:~~
))00(,(:
=∈∃≡
≤∧≥∈∃≡
>∧<∈∃≡
>∨<∈∃≡
>∨<∈∀
>∨<∈∀
xx
xxx
xxx
xxx
xxxQ
xxxQ
�
�
�
�
�
�
The true statement is ~Q because x = 0 is neither positive nor negative.
Question8
(a) ( ) ( )
0,
0~,0,~
<∈∃≡
≥∈∃≡≥∈∀
xx
xxxx
�
��
The negation is true.
(b) ( )( )
( )( ) s) Morgan'(De even not is odd not is ,
even is odd is ~,
even is odd is ,~
zzz
zzz
zzz
∧∈∀≡
∨∈∀≡
∨∈∃
�
�
�
The original statement is true
(c)
( )( )( )
( ) s) Morgan'(De not primeis odd is ,
primeis even is ~,
primeis even is ,~
nnn
nnn
nnn
∨∈∀≡
∧∈∀≡
∧∈∃
�
�
�
The original statement is true.
WUCT121 Logic Tutorial Exercises Solutions 12
(d)
≥
+∧≠∈∃≡
<
+∧≠∈∃≡
<
+⇒≠∈∃≡
<
+⇒≠∈∀
11
0,
11
~ 0,
11
0~,
11
0,~
y
yyy
y
yyy
y
yyy
y
yyy
�
�
�
�
The negation is true.
(e)
( )( )
( )1,,
1~,,
1,~,
1,,~
≠∈∃∈∀≡
=∈∃∈∀≡
=∈∀∈∀≡
=∈∀∈∃
xyyx
xyyx
xyyx
xyyx
��
��
��
��
The negation is true.
(f)
( )( )
( )pnpn
pnpn
pnpn
pnpn
2,,
2~,,
2,~,
2,,~
≠∈∀∈∃≡
=∈∀∈∃≡
=∈∃∈∃≡
=∈∃∈∀
��
��
��
��
The negation is true.
(g)
( )( )( )( )( )( )( )
( )( )( )εεε
εεε
εεε
εεε
εεε
εεε
≥−∧>∈∀∈∃∈∃≡
<−∧>∈∀∈∃∈∃≡
<−⇒>∈∀∈∃∈∃≡
<−⇒>∈∃∈∃∈∃≡
<−⇒>∈∃∈∀∈∃≡
<−⇒>∈∃∈∀∈∀
yxyx
yxyx
yxyx
yxyx
yxyx
yxyx
0,,,
6) pt 1.4.2 (Thm. ~0,,,
0~,,,
0,~,,
0,,~,
0,,,~
���
���
���
���
���
���
The statement is true.
Question9
(a) ( )( )11,~ 2 >⇒−>∈∀ yyy �
( )( )( )
( )11,
1~1,
11~,
2
2
2
≤∧−>∈∃≡
>∧−>∈∃≡
>⇒−>∈∃≡
yyy
yyy
yyy
�
�
�
The original statement is false. Take y = 0, then )1010 2 <=⇒−>= yy
WUCT121 Logic Tutorial Exercises Solutions 13
(b)
( )( )
01,
01~,
01,~
2
2
2
≠+∈∀≡
=+∈∀≡
=+∈∃
xx
xx
xx
�
�
�
The original statement is false. For any real number, x, 02 ≥x , so 112 ≥+x .
Thus, 012 ≠+x .
(c)
( ) ( )( )( ) ( )( )
( ) ( ) zyxzyxzyx
zyxzyxzyx
zyxzyxzyx
−−=−−∈∃≡
−−≠−−∈∃≡
−−≠−−∈∀
,,,
~,,,
,,,~
�
�
�
The original statement is false. Let 1== yx and 0=z .
Then ( ) 011011 =−=−− and ( ) 000011 =−=−− .
(d)
( )( )
( )0,,
0~,,
0,~,
0,,~
≠+∈∀∈∃≡
=+∈∀∈∃≡
=+∈∃∈∃≡
=+∈∃∈∀
yxyx
yxyx
yxyx
yxyx
��
��
��
��
The negation is false. For any real number x, 0=− xx , so let xy −= .
Question10 Write the following statements using quantifiers. Find their negations and
determine in each case whether the statement or its negation is false, giving brief
reason where possible.
(a) mnmnP >∈∃∈∀ ,,: ��
( )( )
( )mnmn
mnmn
mnmn
mnmnP
≤∈∀∈∃≡
>∈∀∈∃≡
>∈∃∈∃≡
>∈∃∈∀
,,
~,,
,~,
,,~:~
��
��
��
��
The statement P is false. Let 1=n . All natural numbers m are greater than n.
(b) 0,: 2 ≥∈∀ xxP �
( )( )
0,
0~,
0,~:~
2
2
2
<∈∃≡
≥∈∃≡
≥∈∀
xx
xx
xxP
�
�
�
The statement ~P is false. For any real number x, 2x is not less than 0.
(c) Let D be the set of all dogs.
.vegetarianis,: dDdP ∈∃ .
( )( )
arian not vegetis ,
n vegetariais ~ ,
n vegetariais ,:~~
dDd
dDd
dDdP
∈∀≡
∈∀≡
∈∃
The statement ~P is probably false.
WUCT121 Logic Tutorial Exercises Solutions 14
(d) rationalis ,: xxP �∈∃ .
( )( )
nal not ratiois ,
rationalis ~,
rationalis ,:~~
xx
xx
xxP
�
�
�
∈∀≡
∈∀≡
∈∃
The statement ~P is false. The number 2 is real and rational.
(e) Let S be the set of all students and let M be the set of all mathematics subjects.
msMmSsP likes ,,: ∈∃∈∀ .
( )( )
( )msMmSs
msMmSs
msMmSs
msMmSsP
dislikes ,,
likes ~,,
likes ,~,
likes ,,~:~
∈∀∈∃≡
∈∀∈∃≡
∈∃∈∃≡
∈∃∈∀
Unfortunately, P is more likely to be false.
WUCT121 Logic Tutorial Exercises Solutions 15
Section 3: Proofs
Question1
(a) The statement is of the form: )())()(( aPxQxP ∧⇒ , thus the conclusion is
)(aQ . So, applying the universal rule of Modus Ponens, we conclude that Peter
phones John.
(b) The statement is of the form: ))()(())()(( xRxQxQxP ⇒∧⇒ , thus the
conclusion is )()( xRxP ⇒ So, applying the Law of syllogism, we know the final
conclusion is as follows: Therefore, if 0232 =+− xx , then 2=x or 1=x .
(c) The statement is of the form: )(~))()(( aQxQxP ∧⇒ , thus the conclusion is
)(~ aP . So, applying the universal rule of Modus Tollens, we conclude that
1−=y is not real.
Question2 Prove or disprove the following statements
(a) Statement is of the form )(, xPDx∈∀ , so must prove with general proof, or
disprove with counterexample.
Disprove: Let 29=n . Then
3129
)1129(29
29292929 22
×=
++=
++=++ nn
In this case, 292 ++ nn is not prime, and thus we have a counterexample.
Therefore, it is false to say “ 29, 2 ++∈∀ nnn � is prime”.
(b) Statement is of the form ),(,, yxPDyDx ∈∀∈∃ . So, to prove, must find one
Dx∈ that for all ,Dy∈ ),( yxP is true.
Prove: Let 0=x , and let �∈y . Then 10 ≠=xy .
Thus, the statement is true.
(c) Statement is of the form ),(,, yxPDyDx ∈∀∈∀ , so must prove with general
proof, or disprove with counterexample.
Disprove: Let 1== ba . Then,
( ) ( ) 4211 222 ==+=+ ba and 22222 )(211 baba +≠=+=+ .
Thus we have a counterexample.
Therefore, it is false to say that ( ) 222,, bababa +=+∈∀ �
WUCT121 Logic Tutorial Exercises Solutions 16
(d) Statement is of the form ),(,, yxPDyDx ∈∀∈∀ , so must prove with general
proof, or disprove with counterexample.
Disprove: Let 1=n and 3=m , both of which are odd. Then the average is
22
31
2=
+=
+mn, which is not odd.
Thus we have a counterexample.
Therefore, it is false to say that the average of any two odd integers is odd.
Question3 Find the mistakes in the following “proofs”.
(a) Statement is of the form )(, xPDx∈∀ , that is a universal statement, so requires
proof with general proof, or disprove with counterexample.
(b) The mistake is in the use of the definitions of odd and even numbers.
When using an existential statement on two separate occasions, you should not
use the same variable; that is, if we use k for defining n as an odd integer
( 12 += kn for some �∈k ), then we must use a different letter for defining m as
an even integer (e.g. qm 2= for some �∈q ).
Question4
(a) Statement is of the form )(, xQDx∈∀ , where )(xQ is “ xx 212 ≥+ ”.
Thus we must find a )(xP to give the form )()(, xQxPDx ⇒∈∀
We know that for all 0, 2 ≥∈ xx � , so let )(xP be “ 02 ≥x ”.
xx
xx
xx
21
012
0)1(0
2
2
22
≥+⇒
≥+−⇒
≥−⇒≥
Therefore for xxx 21, 2 ≥+∈� .
(b) Statement is of the form )()(, nQnPDn ⇒∈∀ , where )(nP is “n is odd” and
)(nQ is “ 2n is odd”
( )
odd is
22where12
1222
144
,12odd is
2
22
22
22
n
ppqqn
ppn
ppn
ppnn
⇒
∈+=+=⇒
++=⇒
++=⇒
∈+=⇒
�
�
Therefore, For ,�∈n if n is odd, 2n is odd.
WUCT121 Logic Tutorial Exercises Solutions 17
(c) Statement is of the form ),(),(,, yxQyxPDyDx ⇒∈∀∈∀ , where ),( yxP is
“any two odd integers” and ),( yxQ is “sum is even”.
Let x, y be any two odd integers.
�
�
�
∈++==
++=
++=
+++=+
∈+=⇒
∈+=⇒
12
)1(2
222
)12()12(
12odd is
12odd is
qprr
qp
qp
qpyx
qqyy
ppxx
Therefore, the sum of any two odd integers is even.
(d) Statement is of the form )()(, xQxPDx ⇒∈∀ .
Let ABC be a triangle, with angles A, B and C.
We are given that the sum of two angles is equal to the third angle, i.e.
)1(KCBA =+ .
We know that °=++ 180CBA , since the angle sum of a triangle is °180 .
triangleangledrightais
90
1802
(1)by 180180
ABC
C
C
CCCBA
⇒
°=⇒
°=⇒
°=+⇒°=++
Therefore f the sum of two angles of a triangle is equal to the third angle, then the
triangle is a right angled triangle
Question5 Statement is of the form )()(, xQxPDx ⇒∈∀ , where )(xP is “x is
negative real number”, and )(xQ is “ 4)2( 2 >−x ”.
We know that for all 0, <∈ xx �
4)2(
444
04
0)4(
040
2
2
2
>−⇒
>+−⇒
>−⇒
>−⇒
<−⇒<
x
xx
xx
xx
xx
Therefore if x is a negative real number, then 4)2( 2 >−x ..
Question6 Statement is of the form )(, xPDx∈∃ , so to prove, must show one ,Dx∈
which makes )(xP true.
Let 127112812.7 7 =−=−=n , which is prime.
Therefore, there is an integer 5>n such that 12 −n is prime
WUCT121 Logic Tutorial Exercises Solutions 18
Question7 Statement is of the form )(, xPDx∈∀ , where D is finite. So to prove,
must show for all ,Dx∈ )(xP is true.
Using the method of exhaustion:
primeis131411010041:10
primeis1134198141:9
primeis974186441:8
primeis834174941:7
primeis714163641:6
primeis614152541:5
primeis534141641:4
primeis47413941:3
primeis43412441:2
primeis41411141:1
2
2
2
2
2
2
2
2
2
2
=+−=+−=
=+−=+−=
=+−=+−=
=+−=+−=
=+−=+−=
=+−=+−=
=+−=+−=
=+−=+−=
=+−=+−=
=+−=+−=
nnn
nnn
nnn
nnn
nnn
nnn
nnn
nnn
nnn
nnn
Therefore, for each integer n such that 41,101 2 +−≤≤ nnn is a prime number.
Question8 Statement is of the form )()(, nQnPDn ⇒∈∀ , where )(nP is “n is an
odd number”, and )(nQ is “ 1)1( −=− n ”.
1
)1(1
)1()1(
)1()1(
)1()1(
12odd is
2
12
−=
−×=
−=
−−=
−=−
∈+=⇒∈∀+
p
p
pn
ppnnn ��,
Therefore, if n is an odd integer, then .1)1( −=− n
Question9 Statement is of the form: )()(, nQnPDn ⇒∈∀ , where )(nP is “ 2n is
even”, and )(nQ is “n is even”.
To prove by contraposition we must show )(~)(~, nPnQDn ⇒∈∀ . )(~ nQ is “n is
not even”, i.e. “ n is odd”, and )(~ nP is “ 2n is not even”, i.e. “ 2n is odd”.
WUCT121 Logic Tutorial Exercises Solutions 19
( )
odd is
22where12
1222
144
,12odd is
2
22
22
22
n
ppqqn
ppn
ppn
ppnn
⇒
∈+=+=⇒
++=⇒
++=⇒
∈+=⇒
�
�
Therefore, if n is odd, 2n is odd, and so by proof by contraposition, if 2n is even,
then n is even
Question10 Statement is of the form: )()(, mQmPDm ⇒∈∀ , where )(mP is “m is
an integer”, and )(mQ is “ 12 ++ mm is always odd”. Now if m is an integer, then m
is even or m is odd, thus )()()( mSmRmP ∨≡ , where )(mR is “m is even”, and
)(mS is “m is odd”.
))()(())()((
)())()(()()(Hence
mQmSmQmR
mQmSmRmQmP
⇒∧⇒≡
⇒∨≡⇒
Case 1: Prove: )()( mQmR ⇒ , i.e. If m is even, then 12 ++ mm is always odd
( )
odd is 1
2where121
1221
1241
,2even is
2
22
22
22
++⇒
∈+=+=++⇒
++=++⇒
++=++⇒
∈=⇒
mm
ppqqmm
ppmm
ppmm
ppnn
�
�
Therefore if m is even, then 12 ++ mm is always odd
Case 2: Prove: )()( mQmS ⇒ , i.e. If m is odd, then 12 ++ mm is always odd
( )
odd is 1
132where121
113221
1121441
,12odd is
2
22
22
22
++⇒
∈++=+=++⇒
+++=++⇒
+++++=++⇒
∈+=⇒
mm
kkllmm
kkmm
kkkmm
kkmm
�
�
Therefore if m is odd, then 12 ++ mm is always odd.
Thus if m is even or m is odd, then 12 ++ mm is always odd, and so if m is an
integer, then 12 ++ mm is always odd.
WUCT121 Logic Tutorial Exercises Solutions 20
Question11 Disprove the statement: baba
baba111
,0,0,, +=+
≠≠∈∀ � . Are there
any values for a, b that make the statement true? Explain.
Statement is of the form )(, xPDx∈∀ , that is a universal statement, so requires
disproof with counterexample
Let 1=a and 2=b .
Then 3
1
21
11=
+=
+ ba.
But, baba +
≠=+=+1
2
3
2
1
1
111.
Thus by counterexample the statement baba
baba111
,0,0,, +=+
≠≠∈∀ � is false
There are no real values that make the statement true.
If you try to solve for a and b, you come across a quadratic with only complex
solutions
Question12 Prove or disprove this statement: For all integers, a, b if ba < , then
22 ba < .
Statement is of the form ),(),(,, yxQyxPDyDx ⇒∈∀∈∀ , so requires general
proof or disproof with a counterexample.
Counterexample: Let 5−=a and let 2=b .
ba < but 22 425 ba =>=
Thus by counterexample the statement ),(),(,, yxQyxPDyDx ⇒∈∀∈∀ is false.
Question13 Prove if 2n is odd, then n is odd.
Statement is of the form: )()(, nQnPDn ⇒∈∀ , where )(nP is “ 2n is odd”, and
)(nQ is “n is odd”. Direct proof is not possible, thus use proof by contraposition.
To prove by contraposition we must show )(~)(~, nPnQDn ⇒∈∀ . )(~ nQ is “n is
not odd”, i.e. “ n is even”, and )(~ nP is “ 2n is not odd”, i.e. “ 2n is even”.
even is
2where2
22
4
,2even is
2
22
22
22
n
pqqn
pn
pn
ppnn
⇒
∈==⇒
×=⇒
=⇒
∈=⇒
�
�
Therefore, if n is even, 2n is even, and so by proof by contraposition, if 2n is odd,
then n is odd
WUCT121 Logic Tutorial Exercises Solutions 21
Question14 Prove there is no smallest positive real number.
Statement is of the form )(, xPDx∈∀ . Where )(xP is “there is no smallest positive
real number” So to prove, must show for all ,Dx∈ )(xP is true. Prove by
contradiction.
Assume )(~ xP , that is assume there is a smallest positive real number, �∈n . Then
nnn <−∈− 1,1 � . This contradicts our assumption, thus )(~ xP is false and the
original statement “there is no smallest positive real number” is true.
Question15 Prove each of the following using proof by cases
(a) If ,6or,5,4=x then .2132 xxx ≠+−
Statement is of the form )()]()()([ xQxTxSxR ⇒∨∨ , where )(xR is 4=x ,
)(xS is 5=x , )(xT is 6=x and )(xQ is .2132 xxx ≠+−
Case 1: Prove: )()( xQxR ⇒ , i.e. If 4=x , then .2132 xxx ≠+−
4
25
214342
≠
=
+×−
Therefore If 4=x , then .2132 xxx ≠+−
Case 2: Prove: )()( xQxS ⇒ , i.e. If 5=x , then .2132 xxx ≠+−
5
31
215352
≠
=
+×−
Therefore If 5=x , then .2132 xxx ≠+− .
Case 3: Prove: )()( xQxT ⇒ , i.e. If 6=x , then .2132 xxx ≠+−
6
39
216362
≠
=
+×−
Therefore If 6=x , then .2132 xxx ≠+− .
Thus If ,6or,5,4=x then .2132 xxx ≠+−
(b) 4320, ≠+⇒≠∈∀ xxx �
WUCT121 Logic Tutorial Exercises Solutions 22
Question16 Prove there is a perfect square that can be written as the sum of two other
perfect squares. (Note an integer n is a perfect square if and only if 2, knk =∈∃ � )
Statement is of the form )(, nPDn∈∃ , so we must show one example.
�∈∃n , (n is a perfect square ),, 22 lknlk +=∈∃∧ �, .
Let 2525 ==n . n is a perfect square and 22 34 +=n .
Therefore, there is a perfect square that can be written as a sum of two other perfect
squares.
Question17 Prove that the product of two odd integers is also an odd integer.
Statement is of the form ),(),(,, yxQyxPDyDx ⇒∈∀∈∀ , where D is the integers,
),( yxP can be written as “x is odd and y is odd”, ),( yxQ can be written as “ yx× is
odd”.
odd is
2where12
1)2(2
1224
)12)(12(
,12odd is
,12odd is
yx
lkklnn
lkkl
lkkl
lkyx
llyy
kkxx
×∴
∈++=+=
+++=
+++=
++=×
∈+=⇒
∈+=⇒
�
�
�
Therefore the product of two odd integers is also an odd integer
Question18 Prove or disprove the following statements:
(a) The difference between any two odd integers is also an odd integer.
Statement is of the form ),(),(,, yxQyxPDyDx ⇒∈∀∈∀ , where D is the
integers, ),( yxP can be written as “x is odd and y is odd”, ),( yxQ can be written
as “ yx − is odd”. Disprove with counterexample or prove with general proof.
Counterexample: Let 5=x , 3=y , 235 =−=− yx , which is even. Hence by
counterexample the statement “The difference between any two odd integers is
also an odd integer” is false.
WUCT121 Logic Tutorial Exercises Solutions 23
(b) For any integer n, )36(|3 +nn .
Statement is of the form )(, nPDn∈∀ , where D is the integers, )(nP can be
written as “ �∈=+ kknn ,3)36( ”. Disprove with counterexample or prove with
general proof.
)36(|3
2,3
)2(3
)12(3)36(
2
2
+∴
∈+==
+=
+=+
nn
nnkk
nn
nnnn
�
Therefore for any integer n, )36(|3 +nn .
(c) The cube of any odd integer is an odd integer.
Statement is of the form )()(, xQxPDx ⇒∈∀ , where D is the integers, )(xP can
be written as “x is odd”, )(xQ can be written as “ 3x is odd”.
odd is
364where12
1)364(2
16128
)12(
,12odd is
3
23
23
23
33
x
kkkll
kkk
kkk
kx
kkxx
∴
∈++=+=
+++=
+++=
+=
∈+=⇒
�
�
Therefore the cube of any odd integer is an odd integer
(d) For any integers a, b, c, if ca | , then cab | .
Disprove by counterexample: Let 4,3,2 === cba .
caac |2224 ∴=×== However cabab |,4|6 //=
Thus by counterexample “For any integers a, b, c, if ca | , then cab | ” is false.
(e) There is no largest even integer.
Proof by contradiction.
Assume that there is a largest even integer, n, say.
Then, knk 2, =∈∃ � .
Consider the number ( )12222 +=+=+= kknm .
Let �∈+= 1kl . Then lm 2= .
Therefore, by definition, m is an even integer. Also, we have nm > .
However, we said that n was the largest even integer. Thus we have a
contradiction.
Therefore, our assumption must be wrong.
Therefore, there must be no largest even integer
WUCT121 Logic Tutorial Exercises Solutions 24
(f) For all integers a, b, c, if bca |/ , then ba |/ .
Statement form is ),,(),,( cbaQcbaP ⇒ , where bcacbaP |:),,( / and
bacbaQ |:),,( /
Proof by contraposition, i.e. prove ),,(~),,(~ cbaPcbaQ ⇒ . Where
bcacbaP |:),,(~ , and bacbaQ |:),,(~
bca
kclalbc
akcbc
kakbba
|
|
∴
∈==⇒
=⇒
∈=⇒
�
�
Therefore For all integers a, b, c, if ba | , then bca | , and so by contraposition for
all integers a, b, c, if bca |/ , then ba |/ .
(g) For all integers n, 22 3)1(4 nnn −++ is a perfect square.
�∈+==
+=
++=
−++=−++
2
)2(
44
34443)1(4
2
2
2
2222
nkk
n
nn
nnnnnn
Therefore for all integers n, 22 3)1(4 nnn −++ is a perfect square.
(h) For any integers a, b, if ba | then .| 22 ba
22
22
22
|
)(
|
ba
kllabc
akb
kakbba
∴
∈==⇒
=⇒
∈=⇒
�
�
Therefore for any integers a, b, if ba | then .| 22 ba
(i) For all integers n, 412 +− nn is prime.
Disprove by counterexample. Let 41=n .
Then ( ) ( )222 4141414141 =+−=+− nn , which is clearly not prime.
WUCT121 Logic Tutorial Exercises Solutions 25
(j) For all integers, n and m, if mn − is even, then 33 mn − is even.
Statement is of the form ),(),(,, mnQmnPDmDn ⇒∈∀∈∀ , where D is the
integers, ),( mnP is “ mn − is even”, ),( mnQ is “ 33 mn − is even”.
even is
where2
)(2
)(2
))((
,2even is
33
22
22
22
2233
mn
kmknmknll
kmknmkn
mnmnk
mnmnmnmn
kkmnmn
−∴
∈++==
++=
++=
++−=−
∈=−⇒−
�
�
Therefore for all integers, n and m, if mn − is even, then 33 mn − is even
Question19 Prove that the product of any four consecutive numbers, increased by one,
is a perfect square?
)(, nPDn∈∀ , where D is the integers, )(nP is “product of any four consecutive
numbers, increased by one, is a perfect square”.
Let 3,2,1, +++ nnnn be four consecutive integers.
squareperfectais1)3)(2)(1(Hence
)13(
)13(
161161)3)(2)(1(
22
22
234
++++
∈++==
++=
++++=++++
nnnn
Znnkk
nn
nnnnnnnn
Thus the product of any four consecutive numbers, increased by one, is a perfect
square.
WUCT121 Logic Tutorial Exercises Solutions 26
Section 4: Set Theory
Question1
(a) ( ]{ }10:
1,0
≤<∈=
=∪
xx
BA
�
(b) �=∩ BA
(c) BCB =∩
(d) CCA =∪
(e) ACA =∩
(f) { }1: ≠∈= xxA �
(g) ( ) ( ){ }10:
,10,
>∨<∈=
∞∪∞−=
xxx
C
�
(h) [ ) { }10:1,0 <≤∈==− xxAC �
(i) { }1,0=− BC
(j) �=−CA
The sets A and B are disjoint.
Question2
(a) �=∪ BA
(b) �=∩ BA
(c) { }2=∩ PB
(d) { }
{ }K,13,11,9,7,5,3,2,1
2
=
∪=∪ APA
(e) { }
{ }K,13,11,7,5,3
2
=
−=∩ PPA
(f) BA =
(g) { }{ }1 composite is :
not primeis :
=∨∈=
∈=
xxx
xxP
�
�
(h) { }2=− AP
(i) { }2−=− BPB
(j) ABA =−
A and B are disjoint as �=∩ BA .
P is not a subset of A, since P∈2 but A∉2 .
Question3 Let X = {1, 2, 3, 4}.
(a) ( ) { } { } { } { } { } { } { } { } { }{
{ } { } { } { } { } { } }4,3,2,1,4,3,2,4,3,1,4,2,1,3,2,1,4,3
,4,2,3,2,4,1,3,1,2,1,4,3,2,1,�=XP
(b) ( )XP has 1624 = elements.
(c) Yes, ( )XP∈� is true.
WUCT121 Logic Tutorial Exercises Solutions 27
(d) Yes, { } ( )XP⊆� is true.
Question4 ( ) { }�� =P . ( )�P has 120 = element.
Question5 ( )XP has n2 elements.
Question6
(a) False.
Let { } ( )XB P∈= 2 and. { } ( )XC P∈= 1 . Then
BCBCCBCB ⊄∴∉∈⊄∴∉∈ 1,1also2,2
(b) True. Let �=B ..
(c) True. Let XB = .
(d) True. All subsets but X are proper subsets
Question7 Since ( )XP has four elements, ( )( )XPP will have 1624 = elements.
( )( ) { } { } { }{ }( ){ { } { }{ } { }{ } { }{ } { }{ } { }{ }
{ }{ } { } { }{ } { } { }{ } { } { }{ }{ } { }{ } { } { }{ } { } { } { }{ }{ } { }{ } { } { } { }{ } }2,1,2,1,,2,1,2,
,2,1,2,1,2,1,1,,2,1,
,2,1,2,2,1,1,2,1,2,1,
,2,,1,,2,1,2,1,,
2,1,2,1,
��
��
�
����,
�
=
= PPP X
Since Y has three elements, ( )( )YPP will have 256232 = elements.
{ }{ }1,� and { }{ }2 belong to ( )( )YPP .
Question8 [ ] { } ( )1,0,1,1,1, −� , etc.
The elements of ( )�P cannot be listed. (There are too many of them!)
The set ( )�P has an infinite number of elements.
[ ] { } ( )�� P∈≤≤−∧∈=− 11|1,1 xxx is true.
WUCT121 Logic Tutorial Exercises Solutions 28
Question9
Question10 Omitted
Question11 Let Claim(n) be “If { }nX ,,2,1 K= , then ( )XP has n2 elements.”
Step 1: Claim(1) is “If { }1=X , then ( )XP has 221 = elements.”
( ) }}1{,(�=XP . ( )XP has 2 elements, so, Claim(1) is true.
Step 2: Assume that Claim(k) is true for some �∈k ; that is, “If { }kX ,,2,1 K= ,
then ( )XP has k2 elements.” …(1)
Prove Claim( 1+k ) is true; that is, prove that “If { }1,,,2,1 += kkX K , then ( )XP
has 12 +k elements.”
We know that the set { }k,,2,1 K has k2 subsets which contain the elements 1, 2, 3,
…, k.
These subsets will also be subsets of { }1,,,2,1 += kkX K .
So, we already have k2 subsets of X.
How do we take into account the element 1+k ? Each of these original k2 subsets
will determine a “new” subset when the element 1+k is included in the original
subset and all subsets containing 1+k will be so determined.
Thus, we have the subsets of { }k,,3,2,1 K and the “new” subsets.
So the total number of subsets of { }1,,,3,2,1 += kkX K is ( ) 122222 +==+ kkkk .
So Claim( 1+k ) is true.
Thus, by Mathematical Induction, Claim(n) is true for all �∈n .
�
}3{}2{}1{
}3,2{}2,1( }3,1{
}3,2,1{
WUCT121 Logic Tutorial Exercises Solutions 29
Question12
(a) Let { }1=X and { }2=Y .
Then ( ) { }{ }1,�=XP , ( ) { }{ }2,�=YP and { }2,1=∪YX .
( ) ( ) { } { }{ }2,1,�=∪ YX PP , ( ) { } { } { }{ }2,1,2,1,�=∪YXP
Clearly, ( ) ( ) ( )YXYX ∪⊆∪ PPP but ( ) ( ) ( )YXYX ∪≠∪ PPP .
(b) Let { }2,1=X and { }3,2=Y .
Then ( ) { } { } { }{ }2,1,2,1,�=XP , ( ) { } { } { }{ }3,2,3,2,�=YP and { }2=∩YX .
( ) ( ) { }{ }2,�=∩ YX PP , ( ) { }{ }2,�=∩YXP
Clearly, ( ) ( ) ( )YXYX ∩=∩ PPP .
Question13
(a) Prove CBCABA ∪⊆∪⇒⊆
KNOW: BA ⊆ , that is, )1(KBxAx ∈⇒∈
PROVE: CBCA ∪⊆∪ , that is, CBxCAx ∪∈⇒∪∈ .
PROOF: Let CAx ∪∈ .
CBx
CxBx
CxAxCAx
∪∈⇒
∈∨∈⇒
∈∨∈⇒∪∈
(1) by
Therefore, CBCA ∪⊆∪ .
(b) To prove ( ) BBBA =∩∪ , we must prove two things:
1. ( ) BBBA ⊆∩∪ , that is, ( ) BxBBAx ∈⇒∩∪∈
2. ( ) BBAB ∩∪⊆ , that is, ( ) BBAxBx ∩∪∈⇒∈
Proof of 1:
( ) ( )
( ) BBBA
Bx
BxBAxBBAx
⊆∩∪∴
∈⇒
∈∧∪∈⇒∩∪∈
WUCT121 Logic Tutorial Exercises Solutions 30
Proof of 2:
( ) ( )( )( )( ) BBAB
BBAx
BxABx
BxAxBx
BxBxBx
∩∪⊆∴
∩∪∈⇒
∈∧∪∈⇒
∨∈∧∈∨∈⇒
∈∧∈⇒∈
ion-introduct
Thus, ( ) BBBA =∩∪
Question14 Let U be the universal set and let A, B and C be subsets of U.
Using properties of union, intersection and complement and known set laws, simplify
the following:
(a)
( )( ) ( )
( )( )AB
AB
ABAA
ABAABA
∩=
∩∪=
∩∪∩=
∩∪=∩∩
�
)(
(b)
( )
U
BU
BCC
CBCCBC
=
∪=
∪∪=
∪∪=∪∪
(c)
( )�
��
=
∩=∩∩ UUA
(d)
( )U
AAAUA
=
∪=∪∩
Question15
Let { } ( )
−+=∈∃∈==
2
11,:,1,0
k
nknBA ��
Step 1: Prove BA ⊆ .
Let Ax∈ . Then 0=x or 1=x . Proof by cases.
Case 1: ( )2
11
2
110
1−+=
−=⇒= xx .
WUCT121 Logic Tutorial Exercises Solutions 31
Therefore, ( )
−+=∈∃
2
11,
k
xk � .
Case 2: ( )2
11
2
111
2−+=
+=⇒= xx .
Therefore, ( )
−+=∈∃
2
11,
k
xk � .
Therefore, BA ⊆ .
Step 2: Prove AB ⊆ .
Let By∈ . Then ( )
−+=∈∃
2
11,
k
yk � .
k can be an odd integer or an even integer.
Let k be an odd integer.
Then ( ) ( )
02
0
2
11
2
11==
−+=
−+=
k
y .
Let k be an even integer.
Then ( )
12
2
2
11
2
11==
+=
−+=
k
y .
Therefore, 0=y or 1=y .
Thus, Ay∈ .
Therefore, AB ⊆ .
Therefore, by Step 1 and Step 2, BA = .
Question16 { }K,9,5,3,1=A { }K,11,8,5,2=B .
( ) ( )
( )
odd numberan is
even. must be
1 soeven is 2 But .13332
2312
2312
w
wkwwk
wk
wtwktk
BtAtBAt
⇒
++=+=⇒
+=−⇒
+=∈∃∧−=∈∃⇒
∈∧∈⇒∩∈
��
Therefore, there is an odd integer �∈w such that 23 += wt .
Thus, ( )23odd is +=∧∈∃⇒∩∈ wtwwBAt � .
Now, let t be an integer such that ( )23odd is +=∧∈∃ wtww � .
Bt∈ by the definition of B. We must show that At∈ .
WUCT121 Logic Tutorial Exercises Solutions 32
�∈t such that ( )23odd is +=∧∈∃ wtww �
( )( )( ) ( )( )
At
pptpwp
ptpwp
∈⇒
−+=++=∧+=∈⇒
++=∧+=∈⇒
133223612
212312
�
�
Therefore, BAt ∩∈ .
Thus, ( ) BAtwtww ∩∈⇒+=∧∈∃ 23odd is �
Question17
(a) We must prove two things:
1. ( ) BABA ∩⊆∪ , that is, ( ) BAxBAx ∩∈⇒∪∈
2. ( )BABA ∪⊆∩ , that is, ( )BAxBAx ∪∈⇒∩∈
Proof of 1.:
( ) ( )( )( ) ( )
( ) BABA
BAx
BxAx
BxAx
BxAx
BAxBAx
∩⊆∪∴
∩∈⇒
∈∧∈⇒
∈∧∈⇒
∈∨∈⇒
∪∈⇒∪∈
~~
~
~
Proof of 2: Reverse the steps for proof of 1. ( )BABA ∪⊆∩∴
Therefore, ( ) BABA ∩=∪
(b) We must prove two things:
1. ( ) ( ) CBACBA −∩⊆−∩ , that is ( ) ( ) CBAxCBAx −∩∈⇒−∩∈
2. ( ) ( )CBACBA −∩⊆−∩ , that is ( ) ( )CBAxCBAx −∩∈⇒−∩∈
Proof of 1:
( )( )
( )
( )( ) ( ) CBACBA
CBAx
CxBAx
CxBxAx
CxBxAx
CBxAxCBAx
−∩⊆−∩∴
−∩∈⇒
∉∧∩∈⇒
∉∧∈∧∈⇒
∉∧∈∧∈⇒
−∈∧∈⇒−∩∈
Proof of 2: Reverse the steps for proof of 1. ( ) ( )CBACBA −∩⊆−∩∴
Therefore, ( ) ( ) CBACBA −∩=−∩ .
WUCT121 Logic Tutorial Exercises Solutions 33
Question18 Let U be the universal set and let A, B and C be subsets of U.
Using properties of union, intersection and complement and known set laws, simplify
the following:
(a)
( ) ( ) ( )
U
UU
CUCCCUC
=
∩=
∪∩∪=∪∩
(b)
( ) ( )
A
AA
AAAUA
=
∪=
∪∪=∪∩ �
(c)
( ) ( )
�
��
=
∩=
∩∪=∪∪
CC
CCCC
(d)
( )( )
�
�
=
∩=
∩∩=
∩∩=∩∩
B
BAA
ABAABA
Question19
(a) Let Tn∈ . Then 2n is an odd integer.
Let’s assume that n is an even integer.
Then, ( )knk 2=∈∃ �
( ) ( )2222 2242 kkkn ===⇒ .
Therefore, 2n is an even integer.
This leads us to a contradiction, as 2n is an odd integer.
So our assumption must be wrong.
Therefore, n must be an odd integer On∈⇒ .
Thus, OT ⊆ .
(b) Let Om∈ .
Then m is an odd integer ( )12 +=∈∃⇒ kmk �
( )
( )( ) �∈+
++=
++=
+=⇒
kk
kk
kk
km
22
,1222
144
12
2
2
2
22
Therefore, 2m is an odd integer, so Tm∈ .
Thus, TO ⊆ .
(c) From Part (a) OT ⊆ and from part (b) TO ⊆ . Therefore OT = .
WUCT121 Logic Tutorial Exercises Solutions 34
Question20 Let 1=x and 4=y . 1716122 =+=+ yx and E∉17 .
Thus, T is not a subset of E.
Question21
(a) Prove BAABA ⊆⇒=∩ .
KNOW: ABA =∩ ., that is )1(and KAxBAxBAxAx ∈⇒∩∈∩∈⇒∈
PROVE: BA⊆ , that is, BxAx ∈⇒∈ .
Bx
BxAx
BAxAx
∈⇒
∈∧∈⇒
∩∈⇒∈ 1)(by
Thus, BA⊆ .
(b) Disprove the statement.
Let { }2,1=A , { }3,2=B and { }2=C .
Then { }1=∩=∩ CABA , but CB ≠ .
Question22 Determine if the following statements are true or false:
(a) True
Prove BABA ⊆⇒=∩ � .
KNOW: �=∩ BA .
PROVE: BA⊆ , that is, BxAx ∈⇒∈ .
Let Ax∈ . Suppose Bx∈ .
Then BAx ∩∈ , but �=∩ BA .
Therefore, we have a contradiction and Bx∉ , that is, Bx∈ .
(b) True
Prove ( ) �=⇒⊆∧⊆ BBABA .
KNOW: BABA ⊆⊆ and .
PROVE: �=B .
Let �≠B , that is, there exists x such that Bx∈ .
Now, we have two cases.
Either Ax∈ or Ax∈ .
BxAx ∈⇒∈ , which is a contradiction.
WUCT121 Logic Tutorial Exercises Solutions 35
BxAx ∈⇒∈ , which is also a contradiction.
Therefore, x does not exist, so �=B .
(c) True
Prove A and AB − are disjoint, that is ( ) �=−∩ ABA .
Suppose ( ) �≠−∩ ABA , that is, there exists x such that ( )ABAx −∩∈
( )( )
BxAxAx
AxBxAx
ABxAx
∈∧∉∧∈⇒
∉∧∈∧∈⇒
−∈∧∈⇒
This statement is false.
Therefore, ( ) �=−∩ ABA .
WUCT121 Logic Tutorial Exercises Solutions 36
Section 5: Relations and Functions
Question1
(a)
(i) )}3,2(),2,2(),0,2(),3,1(),2,1(),0,1{(=×BA
x
y
0 1 2
1
2
3
(ii) )}2,2(),1,2(),2,1(),1,1{(=× AA
x
y
0 1 2
-1
1
2
3
4
(iii) )}2,3(),1,3(),2,2(),1,2(),2,0(),1,0{(=× AB
x
y
0 1 2 3
1
2
3
(b) Is BBBA ×⊆× No
(c) }3,2,1,0{=∪ BA CBA ×∪ )(
)},3(),,3(),,2(),,2(),,1(),,1(),,0(),,0{()( babababaCBA =×∪
)},2(),,2(),,1(),,1{()( babaCA =× .
WUCT121 Logic Tutorial Exercises Solutions 37
),3(),,3(),,2(),,2(),,0(),,0{()( bababaCB =×),3(),,3(),,2(),,2(),,1(),,1(),,0(),,0{()()( babababaCBCA =×∪×
What do you notice? )}()()( CBCACBA ×∪×=×∪
(d)
)},3,2(),,3,2)(,2,2(),,2,2(,),,0,2(),,0,2(
),,3,1(),,3,1(),,2,1(),,2,1(),,0,1(),,0,1{()(
bababa
bababaCBA =××
)}2,2,(),1,2,(),2,1,(),1,1,(
),2,2,(),1,2,(),2,1,(),1,1,{()(
bbbb
aaaaAAC =××.
Question2 )}2,(),,2,(),1,(),1,{( babaAD =× .
)},2(),,2(),,1(),,1{( babaDA =× , they are not equal
Question3 Let }10:{ <<∈= xxA � , }31:{ <<−∈= xxB � and
}10:{ ≤≤∈= xxC � .
(a) Sketch the graph of BA× in 2� . The unshaded area:
x
y
-1 0 1 2
-1
1
2
3
(b) Sketch the graph of CC × in 2� . Note: CC × is called the until square in 2� .
The area inside the square:
x
y
-1 0 1
-1
1
WUCT121 Logic Tutorial Exercises Solutions 38
(c) Sketch the graph of �×C in 2� . The unshaded area:
x
y
-1 0 1
-1
1
Question4 Let },,{ 21 naaaA K= and },,{ 21 mbbbB K= .
(a) There will be mn elements in BA× .
(b)
)},(),,(),,(
),,(),,(),,(
),,(),,(),,{(
21
22212
12111
mnnn
m
m
bababa
bababa
bababaBA
K
KK
K=×
.
Question5
)()()(
)()(),(
),(),(
))()(
)(
)(
)(),(
CBCACBA
CBCAba
CBbaCAba
CbBaCbAa
CbBaAa
CbBAa
CBAba
×∪×=×∪∴
×∪×∈⇔
×∈∨×∈⇔
∈∧∈∨∈∧∈⇔
∈∧∈∨∈⇔
∈∧∪∈⇔
×∪∈
Question6 Sketch the graphs of the following relations in 2� .
(a) }:),{(1 yxyxyxR −=∧== .
x
y
-1 0 1
-1
1
WUCT121 Logic Tutorial Exercises Solutions 39
(b) }0:),{( 22 =−= yxyxR .
x
y
-2 -1 0 1 2
-1
1
(c) }2:),{( 23 xyyxR +== .
x
y
-2 -1 0 1 2
-1
1
(d) }0))((:),{( 24 =−−= yxyxyxR .
x
y
-2 -1 0 1 2
-1
1
Question7 Sketch the graphs of the following relations in 2� .
WUCT121 Logic Tutorial Exercises Solutions 40
(a) |}||:|),{(1 yxyxR ==
x
y
-2 -1 0 1 2
-1
1
(b) }0)3694)((:),{( 2222 =−+−= yxyxyxR
x
y
-4 -3 -2 -1 0 1 2 3 4
-3
-2
-1
1
2
3
Question8
(a) ( ) ( ) ( ) ( ) ( ){ }8,4,6,3,10,2,82, ,6,2=R
(b) Graph BA× and circle the elements of R.
x
y
0 1 2 3 4
1
2
3
4
5
6
7
8
9
10
(c) True or false?
(i) 4R6 False, 4 is not a factor of 6
(ii) 4R8 True, 248 ×=
(iii) R∈)8,3( False, 3 is not a factor of 8
(iv) R∈)10,2( True, 5210 ×=
(v) R∈)12,4( False, B∉12
WUCT121 Logic Tutorial Exercises Solutions 41
Question9
(a) RSR =∪ (b) SSR =∩
Question10 Write down the domain and range of the relation R on the given set A.
}beinghumanais:{ hhA = , } ofsister theis:),{( 2121 hhhhR =
Dom { }sibling a has female is : ffAfR ∧∈= ,
Range { }sister a has: pApR ∈=
Question11 ( ) ( ) ( ) ( ) ( ) ( ){ }6,5,6,4,5,4,6,3,5,3,4,3=R .
( ) ( ) ( ) ( ) ( ) ( ){ }5,6,4,6,4,5,3,6,3,5,3,41 =−R
Question12 }194
:),{(22
1 =+=− xyyxT .
Sketch of T:
x
y
-4 -3 -2 -1 0 1 2 3 4
-3
-2
-1
1
2
3
Sketch of 1−T :
x
y
-4 -3 -2 -1 0 1 2 3 4
-3
-2
-1
1
2
3
Question13 Determine whether or not the given relation is reflexive, symmetric or
transitive. Give a counterexample in each case in which the relation does not satisfy
the property.
(a) 1R on the set }beinghumanais:{ hhA = given by
} ofsister theis:),{( 21211 hhhhR =
1R is not reflexive, symmetric or transitive. Consider a family with three siblings,
Jane, Mary and John.
1R is not reflexive as Jane is not her own sister
WUCT121 Logic Tutorial Exercises Solutions 42
1R is not symmetric as Jane is John’s sister, however John is not Jane’s sister
1R is not transitive as Jane is Mary’s sister and Mary is Jane’s sister, however,
Jane is not her own sister.
(b) 2R on the set },,,{ dcbaA = given by
)},(),,(),,(),,(),,(),,(),,(),,{(2 ddccbccbbbabbaaaR =
2R is reflexive on { }dcbaA ,,,= :
( ) ( ) ( ) ( ) 2222 R,and R,,R,,R, ∈∈∈∈ ddccbbaa .
2R is symmetric:
( ) ( ) ( ) ( ) 2222 R,and R,;R,and R, ∈∈∈∈ bccbabba .
All other elements in 2R are of the form ( )xx, so satisfy the symmetry property.
2R is not transitive:
( ) ( ) 22 R,and R, ∈∈ cbba . However, ( ) 2R, ∉ca .
So transitivity fails.
Question14 Determine whether or not the following relation is an equivalence relation.
R on }3,2,1,0{=A given by AAR ×= .
( ){ }AyxyxAAR ∈=×= ,:, . That is, ( ) R,,, ∈∈∀ yxAyx .
R is Reflexive: ( ) ( ) R,,, ∈⇒×∈∈∀ xxAAxxAx .
R is Symmetric:
( )
( )( ) ( ) RxyRyxAyx
AAxy
Axy
AAyxAyx
∈⇒∈∈∀
×∈⇒
∈⇒
×∈∈∀
,,,, Thus,
,
,
,,,
R is Transitive:
( ) ( ) ( )( ) ( ) ( ) R.,R,R,,,, Thus,
.,and ,,,,,,,
∈⇒∈∧∈∈∀
×∈×∈×∈∈∀
zxzyyxAzyx
AAzxAAzyAAyxAzyx
Therefore, the relation R is an equivalence relation on A
Question15 Show that the relation R on the set }4,3,2,1,0{=A given by )}4,4(),0,4(),3,3(),1,3(),2,2(),3,1(),1,1(),4,0(),0,0{(=R is an equivalence relation.
Find all the classes of R.
R is Reflexive on }4,3,2,1,0{=A :
( ) ( ) ( ) ( ) ( ) .4,4and 3,3,2,2,1,1,0,0 RRRRR ∈∈∈∈∈
Thus, ( ) RaaAa ∈∈∀ ,, .
R is Symmetric:
( ) ( ) ( ) ( ) RRRR ∈∈∈∈ 1,3and 3,1;0,4and 4,0 .
All other elements in R are of the form ( )xx, , so satisfy the symmetry property.
Thus, ( ) ( ) RabRbaAba ∈⇒∈∈∀ ,,,, .
R is Transitive:
( ) ( ) ( ) ;4,0and 4,0,0,0 RR ∈∈
( ) ( ) ( ) ;0,0and 0,4,4,0 RR ∈∈
( ) ( ) ( ) ;4,0and 4,4,4,0 RR ∈∈
( ) ( ) ( ) ;3,1and 3,1,1,1 RR ∈∈
( ) ( ) ( ) ;1,1and 1,3,3,1 RR ∈∈
WUCT121 Logic Tutorial Exercises Solutions 43
( ) ( ) ( ) ;3,1and 3,3,3,1 RR ∈∈
( ) ( ) ( ) ;1,3and 1,1,1,3 RR ∈∈
( ) ( ) ( ) ;3,3and 3,1,1,3 RR ∈∈
( ) ( ) ( ) ;1,3and 1,3,3,3 RR ∈∈
( ) ( ) ( ) ;0,4and 0,0,0,4 RR ∈∈
( ) ( ) ( ) ;4,4and 4,0,0,4 RR ∈∈
( ) ( ) ( ) RR ∈∈ 0,4and 0,4,4,4 .
Elements of the form ( )xx, also satisfy the transitive property.
Thus, ( ) ( ) ( ) RcaRcbbaAcba ∈⇒∈∈∀ ,,,,,,, .
Therefore, R is an equivalence relation.
{ }4,0)0(class = ; { }3,1)1(class = ; { }2)2(class = ; { } )1(class3,1)3(class == ;
{ } )0(class4,0)4(class == .
Question16 Is the following relation a function? Give brief reason.
R on [ ] { }22:2,2 ≤≤−∈=− xx � , where
})1(11)1(1:),{( 22 +−−=∨−−== xyxyyxR .
x
y
-2 -1 0 1 2
1
2
Dom [ ] { }22:2,2 ≤≤−∈=−= xxR � .
However, the relation doesn’t satisfy the vertical line test as both ( )0,0 and ( )1,0 are
elements of the relation
Question17
(i) Let }9,5,1{=A and }7,4,3{=B . BAF ×⊆1 and )}4,9(),3,5(),7,1{(1 =F
(a) 1F is one-to-one as each element in the range appears only once.
(b) 1F is onto as range BF =1
WUCT121 Logic Tutorial Exercises Solutions 44
(ii) 2F on � and }2:),{(2 xyyxF ==
x
y
-4 -3 -2 -1 0 1 2 3 4
-6
-5
-4
-3
-2
-1
1
2
3
4
5
6
(a) The function satisfies the horizontal line test, thus 2F is one-to-one
(b) Range { } �� ≠∈= nnF :22 , thus, 2F is not onto
Question18 Let }6,5,4{=A and }7,6,5{=B and define the relations S and T from A
to B as follows: }evenis:),{( yxyxS −= and )}7,6(),5,6(),6,4{(=T .
(a) 1−S from B to A, )}5,7(),6,6(),4,6(),5,5{(1 =−S .
and 1−T from B to A, )}6,7(),6,5(),4,6{(1 =−T
(b) )}6,6(),7,5(),5,5(),6,4{(=S , SS ∈∈ )7,5(and)5,5( thus S is not a function,
Dom AT ≠= }6,4{ and TT ∈∈ )7,6(,and)5,6( , thus T is not a function,
11 )6,6(and)4,6( −− ∈∈ SS , thus 1−S is not a function
Dom BT ==− }7,6,5{1 each element in the domain appears only once, thus 1−T
is a function.
Question19 Simplify the following:
(a) )421()423)(431( =
(b) )134()431( 1 =−
(c) )2541()1452( 1 =−
(d) )4123()24)(13)(423)(23( =
Recommended