wuct121 discrete mathematics logic
TRANSCRIPT
![Page 1: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/1.jpg)
WUCT121 Logic 1
WUCT121
Discrete Mathematics
Logic
1. Logic
2. Predicate Logic
3. Proofs
4. Set Theory
5. Relations and Functions
![Page 2: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/2.jpg)
WUCT121 Logic 2
Section 1. Logic
1.1. Introduction.
In developing a mathematical theory, assertions or
statements are made. These statements are made in the
form of sentences using words and mathematical symbols.
When proving a theory, a mathematician uses a system of
logic. This is also the case when developing an algorithm
for a program or system of programs in computer science.
The system of logic is applied to decide if a statement
follows from, or is a logical consequence of, one or more
other statements.
You are familiar with using numbers in arithmetic and
symbols in algebra. You are also familiar with the βrulesβ of
arithmetic and algebra.
Examples:
β’ ( ) ( )
13103
ityAssociativ 643643
=+=
++=++
β’ ( )x
xxx2
vityDistributi 5353β=β=β
![Page 3: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/3.jpg)
WUCT121 Logic 3
In a similar way, Logic deals with statements or sentences
by defining symbols and establishing βrulesβ.
Roughly speaking, in arithmetic an operation is a rule for
producing new numbers from a pair of given numbers, like
addition (+) or multiplication (Γ).
In logic, we form new statements by combining short
statements using connectives, like the words and, or.
Examples:
β’ This room is hot and I am tired.
β’ 1<x or 7>x .
1.2. Statements
1.2.1. Definition
Definition: Statement. A statement or proposition is an
assertion or declarative sentence which is true or false, but
not both.
The truth value of a mathematical statement can be
determined by application of known rules, axioms and laws
of mathematics.
![Page 4: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/4.jpg)
WUCT121 Logic 4
A statement which is true requires a proof.
Examples:
β’ Is the following statement True or False?
For a real number x, if 12 =x , then 1=x or 1β=x .
The statement is TRUE. Therefore, we must prove it.
Consider 12 =x .
Adding 1β to both sides gives 012 =βx .
Factorising this equation, we have ( )( ) 011 =+β xx .
Therefore, 01 =βx or 01 =+x .
Case 1: 01 =βx .
Add 1 to both sides and we have 1=x .
Case 2: 01 =+x .
Add 1β to both sides and we have 1β=x .
![Page 5: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/5.jpg)
WUCT121 Logic 5
A statement which is false requires a demonstration.
Example:
β’ Is the following statement True or False?
2)35()23(5 ββ=ββ
The statement is FALSE. Therefore, we must demonstrate
it.
2)35()23(50
222)35(4
15)23(5
βββ βββ΄=
β=ββ=
β=ββ
![Page 6: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/6.jpg)
WUCT121 Logic 6
Exercise:
Determine which of the following sentences are statements.
For those which are statements, determine their truth value.
(i) 532 =+ Statement True
(ii) It is hot and sunny
outside.
Statement
(iii) 632 =+ Statement False
(iv) Is it raining? Not a statement
(v) Go away! Not a statement
(vi) There exists an
even prime
number.
Statement True
(vii) There are six
people in this room.
Statement
(viii) For some real
number , 2, <xx
Statement True
(ix) 2<x See comment in notes
(x) xyyx +=+ See comment in notes
![Page 7: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/7.jpg)
WUCT121 Logic 7
Strictly speaking, as we donβt know what x or y are, in parts
(ix) and (x), these should not be statements. In
Mathematics, x and y usually represent real numbers and
we will assume this is the case here.
Therefore, (ix) is either true or false (even if we donβt know
which) and (x) is always true, so we will allow both.
1.2.2. Simple Statements
Definition: Simple Statement. A simple or primitive
statement is a statement which cannot be broken down into
anything simpler.
A simple statement is denoted by use of letters p, q, r...
Examples:
β’ p: There are seven days in a week
p is a simple statement
β’ 632: =+p
p is a simple statement
![Page 8: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/8.jpg)
WUCT121 Logic 8
1.2.3. Compound Statements
Definition: Compound Statement. A compound or
composite statement is a statement which is comprised of
simple statements and logical operations.
A compound statement is denoted by use of letters P, Q,
R...
Examples:
β’ P: There are seven days in a week and twelve months
in a year.
Is a compound statement.
p: There are seven days in a week
q: There twelve months in a year
Operation: and
β’ P: 632 =+ or 2)35()23(5 ββ=ββ .
Is a compound statement.
p: 632 =+
q: 2)35()23(5 ββ=ββ
Operation: or
![Page 9: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/9.jpg)
WUCT121 Logic 9
β’ P: If it is not raining then I will go outside and eat my
lunch.
Is a compound statement
p: It is raining
q: I will go outside
r: I will eat my lunch
Negation of p
Operations: If β¦ then, and
![Page 10: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/10.jpg)
WUCT121 Logic 10
Exercises:
Determine which of the following are simple statements,
and which are not. For those which are not, identify the
simple statement(s) used.
Simple Statement Operation
(i) 532 =+ is a simple Statement
(ii) It is hot and
sunny outside.
p: It is hot
q: It is sunny outside
and
(iii) 632 β + p: 632 =+ negation
(iv) 2β€x p: 2<x
q: 2=x
or
(v) 25 <<β x p: x<β5
q: 2<x
and
(vi) If I study hard
then I will pass
my exam
p: I study hard
q: I will pass my exam
If..then
![Page 11: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/11.jpg)
WUCT121 Logic 11
1.3. Truth Tables
A statement P can hold one of two truth values, true or
false. These are denoted βTβ and βFβ respectively.
Note: Some books may use β1β for true and β0β for false.
When determining the truth value of a compound statement
all possible combinations of the truth values of the
statements comprising it must be considered.
This is done systematically by the use of truth tables. Each
connective is defined by its own unique truth table.
There are five fundamental truth tables which will be
covered in the following sections.
1.3.1. Truth Table Construction
To construct a truth table assign each statement a column.
The number of rows in the table is determined by the
number of statements. For n statements, n2 rows will be
required.
Systematically assign truth vales to each of the statements,
beginning in the first column.
![Page 12: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/12.jpg)
WUCT121 Logic 12
Once all possible truth values for the simple statements are
inserted, determine the truth vales of the compound
statements following the rules for the operations.
Example:
β’ Given three statements P, Q, R. The table setup is:
P Q R Compound Statement
T T T
T T F
T F T
T F F
F T T
F T F
F F T
F F F
![Page 13: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/13.jpg)
WUCT121 Logic 13
1.4. Logical Operations
There are five main operations which when applied to a
statement will return a statement.
If P and Q are statements, the five primary operations used
are:
not P, the negation of P.
P or Q, the disjunction of P and Q.
P and Q, the conjunction of P and Q.
P implies Q, the conditional of P and Q.
P if and only if Q, the biconditional of P and Q.
1.4.1. Negation, βnotβ
Definition: Statement Negation.
If P is a statement, the negation of P is βnot Pβ or βit is not
the case that Pβ and is denoted ~P.
![Page 14: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/14.jpg)
WUCT121 Logic 14
Examples:
β’ There are not seven days in a week
p: There are seven days in a week
β’ P: It is raining outside.
~P: ~(It is raining outside.)
It is not raining outside.
β’ Q: 2>x or 2<x
~Q: ~( 2>x or 2<x )
Simplified: 2=x .
Exercises:
For each statement P, write down ~P.
β’ P: Discrete Maths is interesting.
~P: ~( Discrete Maths is interesting)
Discrete Maths is not interesting.
β’ 012 =βxP
( )01
01~:~2
2
β β
=β
x
xP
![Page 15: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/15.jpg)
WUCT121 Logic 15
1.4.1.1 Truth Table for Negation
The negation of P has the opposite truth value from P,
~P is false when P is true; ~P is true when P is false.
P ~P
T F
F T
Example:
Write down the truth value of the following statements.
P ~P
β’ 752 =+ 752 β +
T F
β’ This room is
empty
This room is not
empty
F T
All possible truth values for P
All possible truth values for ~P depending on the value of P.
![Page 16: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/16.jpg)
WUCT121 Logic 16
Exercise:
Write down the truth value of the following statements.
P ~P
β’ β1 β1 T F
β’ Division is a closed
operation on
Division is not a closed
operation on F T
Note: β’ The truth table for negation tells us that for any
statement P, exactly one of P or ~P is true. So, to prove P
is true, we have two methods:
β Direct: Start with some facts and end up
proving P in a direct step-by-step manner.
β Indirect: Donβt prove P is true directly, but
prove that ~P is false.
β’ Generally, brackets are left out around β P~ β.
Thus, QPβ¨~ means QP β¨)(~ , and not )(~ QPβ¨ .
This is similar to arithmetic where yx +β means ( ) yx +β
and not ( )yx +β .
![Page 17: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/17.jpg)
WUCT121 Logic 17
1.4.2. Disjunction, βorβ
Definition: Disjunction.
If P and Q are statements the disjunction of P and Q is βP
or Qβ, denoted QPβ¨ .
Examples:
⒠Given 532: =+P , 632: =+Q , write down QP⨠.
6532:simplified)632()532(:elyalternativ
632532:
or
orQP
=+=+β¨=+
=+=+β¨
β’ Write 5: β€xP using ββ¨ β. )5()5( =β¨< xx
Exercises:
β’ Write the following statements using ββ¨ β
β I am catching the bus or train home.
(I am catching the bus home) β¨ (I am catching the train
home)
β A month has 30 or 31 days.
(A month has 30 days) β¨ (A month has 31 days)
![Page 18: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/18.jpg)
WUCT121 Logic 18
β’ For the statements P and Q, write down QP β¨ .
β 0:0: => xQxP
( ) ( )0:simplified
00:β₯=β¨>β¨
xxxQP
β P: x is the square of an integer, Q: x is prime
( ) ( )primeisintegeran ofsquare theis : xxQP β¨β¨
1.4.2.1 Truth Table for Disjunction
The disjunction of P and Q is true when either P is true, or
Q is true, or both P and Q are true; it is false only when
both P and Q are false.
P Q QPβ¨
T T T
T F T
F T T
F F F
![Page 19: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/19.jpg)
WUCT121 Logic 19
Example:
Write down the truth value of the following statements.
P Q QPβ¨
β’ 532 =+ 632 =+
T F T
β’ β1 β0
F F F
Exercise:
Write down the truth value of the following statements.
P Q QPβ¨
β’ 12 > 12)1( 22 ++=+ xxx
T T T
β’ 2 is odd 5 is odd
F T T
β’ 12 < This room is empty
F F F
![Page 20: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/20.jpg)
WUCT121 Logic 20
1.4.3. Conjunction, βandβ
Definition: Conjunction.
If P and Q are statements the conjunction of P and Q is βP
and Qβ, denoted QP β§ .
Examples:
β’ Given P: It is hot, Q: It is sunny, write down QP β§ .
QP β§ : (It is hot) β§ (It is sunny)
Simplified: It is hot and sunny
β’ Write 50: << xP using ββ§β. )5()0( <β§< xx
Exercises:
β’ Write the following statements using ββ§β
β Snow is cold and wet.
(Snow is cold) β§ (Snow is wet)
β Natural numbers are positive and whole
numbers.
(Natural numbers are positive numbers) β§ (Natural
numbers are whole numbers)
![Page 21: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/21.jpg)
WUCT121 Logic 21
β’ For the statements P and Q, write down QP β§ .
β 1:0: <> xQxP
( ) ( )10:simplified
10:<<<β§>β§x
xxQP
β P: x is even, Q: x is a natural number
( ) ( )numbernaturalaisevenis : xxQP β§β§
1.4.3.1 Truth Table for Conjunction
The conjunction of P and Q is true when, and only when,
both P and Q are true.
If either P or Q are false, of if both are false, QP β§ is false.
P Q QP β§
T T T
T F F
F T F
F F F
![Page 22: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/22.jpg)
WUCT121 Logic 22
Example:
Write down the truth value of the following statements.
P Q QP β§
β’ 532 =+ 632 =+
T F F
β’ β1 β0
F F F
Exercise:
Write down the truth value of the following statements.
P Q QP β§
β’ 12 > Ο>6
T T T
β’ 2 is odd 5 is odd
F T F
β’ 12 < 324 =
F F F
![Page 23: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/23.jpg)
WUCT121 Logic 23
1.4.4. Conditional, βIf β¦ thenβ, βimpliesβ
Definition: Conditional.
If P and Q are statements the conditional of P by Q is βIf P
then Qβ or βP implies Qβ, and is denoted QP β .
Examples:
β’ Given P: It is raining, Q: I will go home, write down
QP β .
QP β : (It is raining) β (I will go home)
Simplified: If it raining then I will go home
β’ Write βIf x is even then 2x is evenβ using βββ.
evenisevenis 2xx β
Exercises:
β’ Write the following statements using βββ
β If the snow is good then I will go skiing.
(The snow is good) β (I will go skiing)
β If x is a natural number then x is an integer.
(x is a natural number) β (x is an integer)
![Page 24: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/24.jpg)
WUCT121 Logic 24
β’ For the statements P and Q, write down QP β .
β 0:1: >β> xQxP
( ) ( )01: >ββ>β xxQP
β P: x is even, Q: x is a natural number
( ) ( ) number naturala is theneven is If
number naturala is even is :xx
xxQP ββ
1.4.4.1 Truth Table for Conditional
The conditional of P by Q is false when P is true and Q
false, otherwise it is true.
We call P the hypothesis (or antecedent) of the conditional
and Q the conclusion (or consequent).
In determining the truth values for conditional, consider the
following example.
Suppose your lecturer say to you:
βIf you arrive for the lecture on time, then I will mark you
present.
Under what circumstances are you justified in saying the
lecturer lied? In other words under what circumstances is
the above statement false?
![Page 25: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/25.jpg)
WUCT121 Logic 25
It is false when you show up on time and are not marked
present.
The lecturers promise only says you will be marked present
if a certain condition (arriving on time) is met; it says
nothing about what will happen if the condition is not met.
So if the condition (arriving on time) is not met, you cannot
in fairness say the promise is false regardless of whether or
not you are marked present.
This example demonstrates that the only combination of
circumstances in which you have a conditional statement
false is when the hypothesis is true and the conclusion is
false.
Thus the truth table for conditional is:
P Q QP β
T T T
T F F
F T T
F F T
![Page 26: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/26.jpg)
WUCT121 Logic 26
Example:
Write down the truth value of the following statements.
P Q QP β
β’ 532 =+ 632 =+
T F F
β’ β1 β0
F F T
Exercise:
Write down the truth value of the following statements.
P Q QP β
β’ 12 > 12 >
T T T
β’ 2 is even 5 is even
T F F
β’ 12 < 14 <
F F T
![Page 27: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/27.jpg)
WUCT121 Logic 27
Alternative wording for QP β can be:
β’ If P then Q.
β’ P implies Q.
β’ Q if P.
β’ Q provided P.
β’ Q whenever P.
β’ P is a sufficient condition for Q.
β’ Q is a necessary condition for P.
β’ P only if Q.
![Page 28: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/28.jpg)
WUCT121 Logic 28
1.4.5. Biconditional, βIf and only ifβ
Definition: Biconditional.
If P and Q are statements the biconditional of P and Q is
βP if, and only if Qβ and is denoted QP β .
Examples:
β’ Given P: Mark can study algebra, Q: Mark passes
pre-algebra, write down QP β .
QP β : (Mark can study algebra) β (Mark passes
pre-algebra)
Simplified: Mark can study algebra if, and only if, he
passes pre-algebra
β’ Write βWater boils if, and only if, itβs temperature is
over Co100 β using ββ β.
Co100over is etemperaturWatersWater boil β
Exercises:
β’ Write the following statements using ββ β
β I will go swimming if, and only if, the water is
warm.
(I will go swimming) β (The water is warm)
![Page 29: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/29.jpg)
WUCT121 Logic 29
β x is a natural number if, and only if, x is an
integer.
(x is a natural number) β (x is an integer)
β’ For the statements P and Q, write down QP β .
β 0:: >β xQxP
( ) ( )0: >βββ xxQP
β P: x is positive, Q: x is a natural number
( ) ( ) number naturala is positiveis : xxQP ββ
1.4.5.1 Truth Table for Biconditional
The biconditional of P and Q is true if both P and Q have
the same truth value, and is false if P and Q have opposite
truth values.
P Q QP β
T T T
T F F
F T F
F F T
![Page 30: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/30.jpg)
WUCT121 Logic 30
Example:
Write down the truth value of the following statements.
P Q QP β
β’ 532 =+ 632 =+
T F F
β’ β1 β0
F F T
Exercise:
Write down the truth value of the following statements.
P Q QP β
β’ 12 > 12 >
T T T
β’ 2 is odd 5 is odd
F T F
β’ 12 < 14 <
F F T
![Page 31: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/31.jpg)
WUCT121 Logic 31
Alternative wording for QP β can be:
β’ P if, and only if Q.
β’ P iff Q.
β’ P implies and is implied by Q.
β’ P is equivalent to Q.
β’ P is a necessary and sufficient condition for Q.
![Page 32: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/32.jpg)
WUCT121 Logic 32
1.4.6. Order of Operation for Logical Operators.
The order of operation for logical operators is as follows:
1. Evaluate negations first
2. Evaluate β¨ and β§ second. When both are present,
parenthesis may be needed, otherwise work left to right.
3. Evaluate β and β third. When both are present,
parenthesis may be needed, otherwise work left to right.
Note: Use of parenthesis will determine order of operations
which over ride the above order.
Examples: Indicate the order of operations in the following:
β’ { {qp21
~ β§
β’ { { )(~12
qpβ§
β’ { { { )(~231
rqp β¨β§
β’ { { {rqp231
~ β§β
Exercises:
Indicate the order of operations in the following:
β’ { { {rqp321
)~( β§β
β’ { { )(~12
qpβ¨
β’ { { {rqp231
~ β¨β
β’ { { {rqp231
~ β§β
![Page 33: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/33.jpg)
WUCT121 Logic 33
1.4.7. Main Connective
Definition: Main Connective.
The main connective is the operation which βbindsβ the
statement together.
It is the final operation performed and is denoted with β*β.
Examples:
Indicate the main connective in the following:
β’ { {qp*21
~ β§
β’ { { )(~1*2
qpβ§
β’ { { { )(~2*31
rqp β¨β§
β’ { { {rqp2*31
~ β§β
Exercises:
Indicate the main connective in the following:
β’ { { {rqp*321
)~( β§β
β’ { { )(~1*2
qpβ¨
β’ { { {rqp2*31
~ β¨β
β’ { { {rqp2*31
~ β§β
![Page 34: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/34.jpg)
WUCT121 Logic 34
Example:
Construct a truth table for )~(~ qp⧠, indicating order of
operations and the main connective
p q ~ (p β§ ~ q) T T T F F T F F T T F T T F F F F T F T
Step: 3* 2 1
Exercises:
β’ Construct a truth table for pqp β§β~~ , indicating
order of operations and the main connective
p q ~ p β ~ q β§ p T T F T F F T F F T T T F T T F F F F F T F T F
Step: 1 3* 1 2
![Page 35: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/35.jpg)
WUCT121 Logic 35
β’ Construct a truth table for ( ) ( )qrqp β¨β§β¨ , indicating
order of operations and the main connective
p q r (p β¨ q) β§ (r β¨ q) T T T T T T T T F T T T T F T T T T T F F T F F F T T T T T F T F T T T F F T F F T F F F F F F
Step: 1 2* 1
β’ Construct a truth table for ( ) ( )rprq β§β¨β§ ~~ ,
indicating order of operations and the main connective
p q r (~ q β§ r) β¨ ~ (p β§ r) T T T F F F F T T T F F F T T F T F T T T T F T T F F T F T T F F T T F F T T F F T F F F T T F F F T T T T T F F F F T F T T F
Step: 1 2 3* 2 1
![Page 36: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/36.jpg)
WUCT121 Logic 36
1.5. Tautologies and Contradictions
1.5.1. Tautology
Definition: Tautology.
Any statement that is true regardless of the truth values of
the constituent parts is called a tautology or tautological
statement.
Examples:
Complete the truth table for the statement ( )PQP ββ
P Q P β (Q β P) T T T T T F T T F T T F F F T T
Step: 2* 1
![Page 37: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/37.jpg)
WUCT121 Logic 37
Exercises:
β’ Complete the truth table for the statement
QPQP ββ§β ))(( to show it is a tautology.
P Q ((P β Q) β§ P) β Q T T T T T T F F F T F T T F T F F T F T
Step: 1 2 3*
β’ Complete the truth table for the statement
PQQP ~)~)(( ββ§β to show it is a tautology.
P Q ((P β Q) β§ ~Q) β ~ P T T T F F T F T F F F T T F F T T F F T T F F T T T T T
Step: 2 3 1 4* 1
![Page 38: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/38.jpg)
WUCT121 Logic 38
1.5.1.1 Quick Method for Showing a
Tautology
In constructing a truth table for a compound statement
comprised of n statements, there will be n2 combinations of
truth values. This method can be long for large numbers of
statements.
We will consider a quicker method for determining if a
compound statement is a tautology. However, truth tables
are reliable (βsafeβ) and are highly recommended if the
βquickβ method is confusing or leading nowhere!
The quick method relies on the fact that if a truth value of
βFβ can occur under the main connective (for some
combination of truth values for the components), then the
statement is not a tautology. If this truth value is not
possible, then we have a tautology.
Therefore, to determine whether a statement is a tautology,
we place an βFβ under the main connective and work
backwards.
![Page 39: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/39.jpg)
WUCT121 Logic 39
Examples:
β’ Determine if ( )PQP ββ is a tautology, using the
quick method
P β (Q β P) Step 2* 1
1.Place βFβ under main
connective
F
2. For βFβ to occur under the
main connective, P must be
βTβ and β must be βFβ
T F
3. For βFβ to occur under β ,
Q must be βTβ and P must be
βFβ
T F
P cannot be both βTβ and βFβ, thus ( )PQP ββ can only
ever be true and is a tautology.
![Page 40: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/40.jpg)
WUCT121 Logic 40
β’ Determine if ( )SRQP β§ββ§ )( is a tautology, using
the quick method
(P β§ Q) β (R β§ S) Step 1 3* 2
1.Place βFβ under main
connective
F
2. For βFβ to occur under the
main connective, )( QP β§ must
be βTβ and ( )SR β§ must be
βFβ
T F
3. For βTβ to occur under
)( QP β§ , P must be βTβ and Q
must be βTβ
T T
3. For βFβ to occur under
( )SR β§ , R can be βTβ and S
can be βFβ
T F
As there is a valid combination of truth values which gives
βFβ under the main connective, ( )SRQP β§ββ§ )( is not a
tautology.
![Page 41: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/41.jpg)
WUCT121 Logic 41
Exercises:
β’ Use the βquickβ method for the statement
QPQP ββ§β ))(( to determine if it is a tautology.
((P β Q) β§ P) β Q Step 1 2 3*
1. Place βFβ under main
connective.
F
2. For βFβ to occur under the
main connective, β§ must be
βTβ and Q must be βFβ
T F
3. For βTβ to occur under β§ , P
must be βTβ and QP β must
be βTβ
T T
4. For βTβ to occur under
QP β ,when P is βTβ Q must
be βTβ
T T
Q cannot be both βTβ and βFβ, thus QPQP ββ§β ))(( can only
ever be true and is a tautology.
![Page 42: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/42.jpg)
WUCT121 Logic 42
β’ Determine if the statement PQQP ~)~)(( ββ§β is
a tautology, using the βquickβ method.
((P β Q) β§ ~Q) β ~P Step: 2 3 1 4* 1
1.Place βFβ under main
connective
F
2. For βFβ to occur under
the main connective, β§
must be βTβ and ~P must
be βFβ
T F
3. For βTβ to occur under β§ , ~Q must be βTβ and
QP β must be βTβ
T T
4. For βTβ to occur under
QP β ,when P is βTβ, Q
must be βTβ
T T
At step 2, ~P is βFβ, thus P is βTβ. Step 3 shows ~Q is βTβ
thus Q is βFβand step 4 gives Q is βTβ. Q cannot be both βTβ
and βFβ, thus PQQP ~)~)(( ββ§β can only ever be true
and is a tautology.
![Page 43: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/43.jpg)
WUCT121 Logic 43
1.5.2. Contradiction
Definition: Contradiction.
Any statement that is false regardless of the truth values of
the constituent parts is called a contradiction or
contradictory statement.
Examples:
Complete the truth table for the statement
( )PQQP β§ββ§ )(~
P Q ~ (P β§ Q) β (Q β§ P) T T F T F T T F T F F F F T T F F F F F T F F F
Step: 2 1 4* 3
![Page 44: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/44.jpg)
WUCT121 Logic 44
Exercises:
β’ Complete the truth table for the statement
PQP β§β¨ )(~ to show it is a contradiction.
P Q ~(P β¨ Q) β§ P T T F T F T F F T F F T F T F F F T F F
Step: 2 1 3*
β’ Complete the truth table for the statement
QQP ~)( β§β§ to show it is a contradiction.
P Q (P β§ Q) β§ ~Q) T T T F F T F F F T F T F F F F F F T T
Step: 2 3* 1
![Page 45: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/45.jpg)
WUCT121 Logic 45
1.5.2.1 Quick Method for Showing a
Contradiction
The quick method for determining if a compound statement
is a tautology can be used similarly for showing a
contradiction.
The quick method relies on the fact that if a truth value of
βTβ can occur under the main connective (for some
combination of truth values for the components), then the
statement is not a contradiction. If this truth value is not
possible, then we have a contradiction.
Therefore, to determine whether a statement is a
contradiction, we place a βTβ under the main connective
and work backwards.
![Page 46: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/46.jpg)
WUCT121 Logic 46
Example:
β’ Use the βquickβ method for the statement
PQP β§β¨ )(~ to determine if it is a contradiction.
~ (P β¨ Q) β§ P Step: 2 1 3* 1.Place βTβ under main
connective
T
2. For βTβ to occur
under the main
connective, ~ must be
βTβ and P must be βTβ
T T
3. For βTβ to occur
under ~, QP⨠must be
βFβ.
F
4. For βFβ to occur
under QP⨠, P must be
βFβ and Q must be βFβ
F F
P cannot be both βTβ and βFβ, thus PQP β§β¨ )(~ can only
ever be false and is a contradiction.
![Page 47: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/47.jpg)
WUCT121 Logic 47
Exercise:
β’ Use the βquickβ method for the statement
QQP ~)( β§β§ to determine if it is a contradiction.
(P β§ Q) β§ ~QStep: 2 3* 1 1.Place βTβ under main
connective.
T
2. For βTβ to occur under
the main connective,
)( QP β§ must be βTβ and
~Q must be βTβ
T T
3. For βTβ to occur under
)( QP β§ , P must be βTβ
and Q must be βTβ.
T T
At Step 2, ~Q is βTβ, thus Q is βFβ. Step 3 shows Q is
βTβ. Q cannot be both βTβ and βFβ, thus QQP ~)( β§β§
can only ever be false and is a contradiction.
![Page 48: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/48.jpg)
WUCT121 Logic 48
1.5.3. Contingent
Definition: Contingent.
Any statement that is neither a tautology nor a
contradiction is called a contingent or intermediate
statement.
Examples:
Complete the truth table for the statement ( )PQQ ββ¨
P Q Q β¨ (Q β P) T T T T T F T T F T F F F F T T
Step: 2* 1
![Page 49: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/49.jpg)
WUCT121 Logic 49
Exercises:
β’ Complete the truth table for the statement
( ) ( )qprp β§ββ¨ to show it is contingent.
p q r (p β¨ r) β (p β§ q) T T T T T T T T F T T T T F T T F F T F F T F F F T T T F F F T F F T F F F T T F F F F F F T F
Step: 1 3* 2
β’ Complete the truth table for the statement
( )( ) ( )qrrqp βββ¨β§ ~~ to show it is contingent.
p q r ~( (p β§ ~ q) β¨ r) β (r β q)T T T F F F T F T T T F T F F F T T T F T F T T T T F T F F F T T T F T F T T F F F T F T F T F T F F F T T F F T F F T T T F F F F T F T F T T
Step: 4 2 1 3 6* 5
![Page 50: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/50.jpg)
WUCT121 Logic 50
1.6. Logical Equivalence
Definition: Logical Equivalence.
Two statements are logically equivalent if, and only if, they
have identical truth values for each possible substitution of
statements for their statements variables.
The logical equivalence of two statements P and Q is
denoted QP β‘ .
If two statements P and Q are logically equivalent then
QP β is a tautology
1.6.1. Determining Logical Equivalence.
To determine if two statements P and Q are logically
equivalent, construct a full truth table for each statement. If
their truth values at the main connective are identical, the
statements are equivalent.
Alternatively show QP β is a tautology and hence
conclude QP β‘ .
![Page 51: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/51.jpg)
WUCT121 Logic 51
Examples:
β’ Determine if the following statements are logically
equivalent. qpQqpP β¨β :~,:
p q p β q ~p β¨ q T T T F T T F F F F F T T T T F F T T T
Step: 1* 1 2* Since the main connectives * are identical, the statements P
and Q are equivalent. Thus qpqpQP β¨β‘ββ‘ ~i.e.
β’ Determine if the following statements are logically
equivalent. qpQqpP ~:~),(:~ β§β§
p q ~( p β§ q) ~p β§ ~q T T F T F F F T F T F F F T F T T F T F F F F T F T T T
Step: 2* 1 1 2* 1 Since the main connectives * are not identical, the
statements P and Q are not equivalent.
![Page 52: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/52.jpg)
WUCT121 Logic 52
Exercises:
β’ Determine if the following statements are logically
equivalent. qpQqpP ~:~),(:~ β§β¨
p q ~( p β¨ q) ~p β§ ~q T T F T F F F T F F T F F T F T F T T F F F F T F T T T
Step: 2* 1 1 2* 1 Since the main connectives are identical, the statements P
and Q are equivalent. Thus qpqpQP ~~)(~i.e. β§β‘β¨β‘
β’ Determine if qpqp ~~)(~ β¨ββ§ is a tautology, and
hence if qpqp ~~)(~ β¨β‘β§ .
p q ~( p β§ q) β ~p β¨ ~q T T F T T F F F T F T F T F T T F T T F T T T F F F T F T T T T
Step: 2* 1 3* 1 2* 1 Since the main connective is all T, the statement
qpqp ~~)(~ β¨ββ§ is a tautology, and hence
qpqp ~~)(~ β¨β‘β§ .
![Page 53: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/53.jpg)
WUCT121 Logic 53
1.6.2. Substitution
There are two different types of substitution into
statements.
Rule of Substitution: If in a tautology all occurrences of a
variable are replaced by a statement, the result is still a
tautology.
Examples:
β’ We know PP ~β¨ is a tautology.
Thus, by the rule of substitution, so too are:
β QQ ~β¨ , by letting PQ = .
β ))((~))(( rqprqp ββ§β¨ββ§ , by letting
Prqp =ββ§ )( .
Note: We have simply replaced every occurrence of P in
the tautology PP ~β¨ , by some other statement.
![Page 54: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/54.jpg)
WUCT121 Logic 54
Rule of Substitution of Equivalence: If in a tautology we
replace any part of a statement by a statement equivalent to
that part, the result is still a tautology.
Example:
β’ Determine if )(~ PQP β¨β is a tautology.
We know: )( PQP ββ is a tautology and
QPQP β¨β‘β ~)(
By the rule of substitution PQPQ β¨β‘β ~)(
Thus, by the rule of substitution of equivalence,
)(~)( PQPPQP β¨ββ‘ββ , and hence
)(~ PQP β¨β is also a tautology.
Exercise:
β’ )(~~ TST β¨β¨ a tautology? Yes.
We know QPQP β¨β‘β ~)( . So, TSTS β¨β‘β ~)( and
)(~~)(~ TSTTST β¨β¨β‘β¨β (by RoS).
Hence, )()(~~ TSTTST βββ‘β¨β¨ (by SoE).
)( PQP ββ is a known tautology, thus (by (SoE)
)( TST ββ is a tautology, and since
)()(~~ TSTTST βββ‘β¨β¨ , )(~~ TST β¨β¨ is a
tautology.
![Page 55: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/55.jpg)
WUCT121 Logic 55
1.6.3. Laws
The following logical equivalences hold:
1. Commutative Laws:
)()()()()()(
PQQPPQQPPQQP
ββ‘ββ’β§β‘β§β’β¨β‘β¨β’
2. Associative Laws:
( ) ( )( ) ( )( ) ( ))()(
)()()()(
RQPRQPRQPRQPRQPRQP
βββ‘βββ’β§β§β‘β§β§β’β¨β¨β‘β¨β¨β’
3. Distributive Laws:
( ) ( )( ) ( ))()()(
)()()(RPQPRQPRPQPRQP
β§β¨β§β‘β¨β§β’β¨β§β¨β‘β§β¨β’
4. Double Negation (Involution) Law:
PP β‘β’ ~~
5. De Morganβs Laws:
)~(~)(~)~(~)(~
QPQPQPQP
β¨β‘β§β’β§β‘β¨β’
![Page 56: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/56.jpg)
WUCT121 Logic 56
6. Implication Laws:
( )( ) )nalBiconditio()()()(
)nImplicatio(~)(PQQPQP
QPQPββ§ββ‘ββ’
β¨β‘ββ’
7. Identity Laws:
PTPPFP
β‘β§β’β‘β¨β’
)()(
8. Negation (Complement) Laws:
FPPTPP
β‘β§β’β‘β¨β’
)~()~(
9. Dominance Laws:
FFPTTP
β‘β§β’β‘β¨β’
)()(
10. Idempotent Laws:
PPPPPP
β‘β§β’β‘β¨β’
)()(
11. Absorption Laws:
PQPPPQPP
β‘β§β¨β’β‘β¨β§β’
)()(
12. Property of Implication:
( ) ( )( ) ( ))()()(
)()()(RQRPRQPRPQPRQP
ββ§ββ‘ββ¨β’ββ§ββ‘β§ββ’
![Page 57: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/57.jpg)
WUCT121 Logic 57
Example:
Prove the first of De Morganβs Laws using truth tables.
P Q ~( P β¨ Q) ~P β§ ~QT T F T F F F T F F T F F T F T F T T F F F F T F T T T
Step: 2* 1 1 2* 1 Since the main connectives are identical, the statements are
equivalent., and first of De Morganβs Laws is true.
Exercise:
Prove the second of De Morganβs Laws using truth tables.
P Q ~( P β§ Q) ~P β¨ ~QT T F T F F F T F T F F T T F T T F T T F F F T F T T T
Step: 2* 1 1 2* 1 Since the main connectives are identical, the statements are
equivalent, and second of De Morganβs Laws is true.
![Page 58: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/58.jpg)
WUCT121 Logic 58
Example:
Using logically equivalent statements, without the direct
use of truth tables, show: ( ) ( ) pqpqp β‘β¨β§β§~~
( ) ( ) ( )( ) ( ) ( )( ) ( ) ( )
( ) ( )( ) ( )
( )( )Identity NegationF
ityCommutativ~ vityDistributi~ Negation Double~ MorganDe~~~~~
pp
qqpqqp
qpqpqpqpqpqp
β‘β¨β‘
β§β¨β‘β§β¨β‘
β¨β§β¨β‘β¨β§β¨β‘β¨β§β§
Exercises:
Using logically equivalent statements, without the direct
use of truth tables, show:
β’ ( ) ( ) ( )pqqpqp ~~~ β§β¨β§β‘β
( ) ( ) ( )( ) ( )( ) ( ) ( )( ) ( ) ( )
( ) ( ) ( )( ) ( ) ( )Negation Double~~
MorganDe~~~~~~nImplicatio~~~~
MorganDe~~nalBiconditio~~
pqqppqqp
pqqppqqp
pqqpqp
β§β¨β§β‘β§β¨β§β‘
β¨β¨β¨β‘ββ¨ββ‘
ββ§ββ‘β
![Page 59: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/59.jpg)
WUCT121 Logic 59
β’ ( ) ( )pqqp ~~ ββ‘β
( ) ( ) ( )( ) ( )( ) ( )( ) ( )nImplicatio~~
Negation Double~)(~~ityCommutativ~
nImplicatio~
pqpq
pqqpqp
ββ‘β¨β‘
β¨β‘β¨β‘β
β’ )()()( rpqprqp ββ§ββ‘β§β , without using the
property of implication
( )( )( )nImplicatio)()(
veDistributi)(~)(~nImplicatio)(~)(
rpqprpqp
rqprqp
ββ§ββ‘β¨β§β¨β‘
β§β¨β‘β§β
![Page 60: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/60.jpg)
WUCT121 Logic 60
Section 2. Predicate Logic
Discussion:
In Maths we use variables (usually ranging over numbers)
in various ways.
How does x differ in what it represents in the following
statements? x is real.
β’ 02 =x x represents one value, 0=x
β’ 2>x x represents some, but not all values
β’ xx =+ 0 x represents all values
β’ 012 =+x x represents no values
Definition: Predicate
A predicate is a sentence that contains one or more
variables and becomes a statement when specific values are
substituted for the variables.
Definition: Domain
The domain of a predicate variable consists of all values
that may be substituted in place of the variable
![Page 61: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/61.jpg)
WUCT121 Logic 61
Definition: Truth Set
If P(x) is a predicate and x has domain D, the truth set of
P(x) is the set of all elements of D that make P(x) true. The
truth set is denoted )}(:{ xPDxβ and is read βthe set of all
x in D such that P(x).β
Examples:
β’ Let P(x) be the predicate β xx >2 β with βx i.e.
domain the set of real numbers .
Write down )2(),1(),2( βPPP and indicate which are true
and which are false.
Determine the truth set of P(x)
}10:{}:{
True)2(4or)2()2(:)2(False11or1)1(:)1(True24or22:)2(
2
2
2
2
>β¨<β=>β
β>β>ββ>>>>
xxxxxx
PPP
β’ Let Q(n) be the predicate βn is factor of 8β.
Determine the truth set of Q(n) if +βn
}8,4,2,1{}"8offactorais:"{
428,818
=ββ΄
Β±ΓΒ±=Β±ΓΒ±=+ nn
![Page 62: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/62.jpg)
WUCT121 Logic 62
Exercises:
β’ Let P(x) be the predicate β xx >3 β with βx i.e.
domain the set of integers, .
Write down )2(),0(),2( βPPP and indicate which are true
and which are false.
Determine the truth set of P(x)
}1:{}:{
False)2()8(or)2()2(:)2(
False00or0)0(:)0(
True28or22:)2(
3
2
3
3
>β=>β
β>ββ>ββ
>>
>>
xxxxx
P
P
P
β’ Let Q(n) be the predicate βn is factor of 6β.
Determine the truth set of Q(n) if βn
}6,3,2,1{}"6offactorais:"{326,616
Β±Β±Β±Β±=ββ΄Β±ΓΒ±=Β±ΓΒ±=
nn
![Page 63: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/63.jpg)
WUCT121 Logic 63
2.1. Quantifiers
A way to obtain statements from predicates is to add
quantifiers. Quantifiers are words that refer to quantities
such as βallβ, βeveryβ, or βsomeβ and tell for how many
elements a given predicate is true.
2.1.1. Universal Quantifier
The symbol β denotes βfor allβ and is called the universal
quantifier.
Definition: Universal Statement
Let P(x) be a predicate and D the domain of x. A universal
statement is a statement of the form β )(, xPDxββ β. It is
defined to be true if, and only if, P(x) is true for every x in
D. It is defined to be false if, and only if, P(x) is false for at
least one x in D. A value of x for which P(x) is false is
called a counterexample to the universal statement.
Examples:
β’ Write the sentence βAll human beings are mortalβ
using the universal quantifier.
Let H be the set of human beings. mortalis,hHhββ
![Page 64: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/64.jpg)
WUCT121 Logic 64
β’ Consider },,{ 321 xxxA = . With )(, xPAxββ , the
following must hold: )()()( 321 xPxPxP β§β§
Thus there will be 3 predicates which must hold.
Exercises:
Write the following statements using the universal
quantifier. Determine whether each statement is true or
false.
β’ βAll dogs are animalsβ
Let D be the set of dogs and A the set of animals
AdDd βββ , . True
β’ The square of any real number is positive.
0, 2 >ββ xx .
False, consider 22 0,0 =β= xx u0.
Hence the statement is false by counterexample
β’ Every integer is a rational number.
βββ xx , . True
![Page 65: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/65.jpg)
WUCT121 Logic 65
Exercises:
Write the following statements in words. Determine
whether each statement is true or false.
β’ βββ xx ,
The square root of any natural number is a natural number.
False. Consider β=β= 2,2 xx . Hence the
statement is false by counterexample.
β’ 1, 2 ββ ββ xx .
The square of any real number does not equal β1. True.
![Page 66: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/66.jpg)
WUCT121 Logic 66
2.1.2. Existential Quantifier
The symbol β denotes βthere existsβ and is called the
existential quantifier.
Definition: Existential Statement
Let P(x) be a predicate and D the domain of x.
An existential statement is a statement of the form
β )(, xPDxββ β.
It is defined to be true if, and only if, P(x) is true for at least
one x in D.
It is defined to be false if, and only if, P(x) is false for all x
in D.
Examples:
β’ Write the sentence βSome people are vegetariansβ
using the existential quantifier.
Let H be the set of human beings. n vegetariaais,hHhββ
β’ Consider },,{ 321 xxxA = . With )(, xPAxββ , the
following must hold: )()()( 321 xPxPxP β¨β¨
Thus there will be 1 predicate which must hold.
![Page 67: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/67.jpg)
WUCT121 Logic 67
Exercises:
Write the following statements using the existential
quantifier. Determine whether each statement is true or
false.
β’ βSome cats are blackβ
Let C be the set of cats.
blackis,cCcββ . True
β’ There is a real number whose square is negative.
0, 2 <ββ xx .False.
β’ Some programs are structured.
Let P be the set of programs.
structuredis, pPpββ . True
![Page 68: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/68.jpg)
WUCT121 Logic 68
Exercises:
Write the following statements in words. Determine
whether each statement is true or false.
β’ mmm =ββ 2,
There is an integer whose square is equal to itself.
True. Consider mmm ===β= 11,1 22 .
Hence the statement is true.
β’ 1, 2 β=ββ xx .
There is a real number whose square is β1.
False.
β’ βββx
x 1,
The reciprocal of some integer is not rational.
True. Consider β=β=011,0
xx .
Hence the statement is true.
![Page 69: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/69.jpg)
WUCT121 Logic 69
2.1.3. Negation of Universal Statements
Let P(x) be a predicate and D the domain of x. The
negation of a universal statement of the form:
)(, xPDxββ is logically equivalent to )(~, xPDxββ
Symbolically )(~,))(,(~ xPDxxPDx βββ‘ββ
Example:
β’ Write down the negation of the following statement.
xxx 21, 2 β₯+ββ
Negation:
xxx
xxx
xxx
21,
)21(~,
)21,(~
2
2
2
<+βββ‘
β₯+βββ‘
β₯+ββ
False.
![Page 70: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/70.jpg)
WUCT121 Logic 70
Exercises:
β’ Write down the negation of the following statement.
0, 2 β₯ββ xx
Negation:
0,
)0(~,
)0,(~
2
2
2
<βββ‘
β₯βββ‘
β₯ββ
xx
xx
xx
False.
β’ Write down the negation of the following statement.
ββ
βββ
β<
+ββ ββ 110,
yyyy
Negation:
110,
11~0,
11)0(~~,
110~,
110,~
β₯+
β§β βββ‘
ββ
βββ
β<
+β§β βββ‘
ββ
βββ
β<
+β¨β βββ‘
ββ
βββ
β<
+ββ βββ‘
βββ
ββββ
βββ
βββ
β<
+ββ ββ
yyyy
yyyy
yyyy
yyyy
yyyy
True, choose y = 1.
![Page 71: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/71.jpg)
WUCT121 Logic 71
Example:
β’ Write the following statement using quantifiers. Find
its negation and determine whether the statement or its
negation is true, giving a brief reason..
βEvery real number is either positive or negative.β
Statement: 00, >β¨<ββ xxx
Negation:
0,)0()0(,
)0(~)0(~,)00(~,
)00,(~
=βββ‘β€β§β₯βββ‘
>β§<βββ‘>β¨<βββ‘
>β¨<ββ
xxxxx
xxxxxx
xxx
The true statement is the negation because x = 0 is neither
positive nor negative.
![Page 72: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/72.jpg)
WUCT121 Logic 72
Exercises:
β’ Write the following statement using quantifiers. Find
the negation.
βThe square of any integer is positive.β
Statement: 0, 2 >ββ xx
Negation:
0,
)0(~,
)0,(~
2
2
2
β€βββ‘
>βββ‘
>ββ
xx
xx
xx
There is an integer whose square is not positive. The
negation is true, choose x = 0.
β’ Write the following statement using quantifiers. Find
the negation.
βAll computer programs are finite.β
Let C be the set of computer programs
Statement: finiteis, xCxββ
Negation:
( )
finitenot is,finiteis,~
xCxxCx
βββ‘βββ‘
Not all computer programs are finite.
Some computer programs are not finite. True?
![Page 73: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/73.jpg)
WUCT121 Logic 73
2.1.4. Negation of Existential Quantifiers
Let P(x) be a predicate and D the domain of x. The
negation of an existential statement of the form:
)(, xPDxββ is logically equivalent to )(~, xPDxββ
Symbolically )(~,))(,(~ xPDxxPDx βββ‘ββ
Example:
β’ Write down the negation of the following statement.
2, 2 =ββ xx
Negation:
2,
)2(~,
)2,(~
2
2
2
β βββ‘
=βββ‘
=ββ
xx
xx
xx
The negation is true.
![Page 74: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/74.jpg)
WUCT121 Logic 74
Exercises:
β’ Write down the negation of the following statement. )evenis()oddis(, zzz β¨ββ
Negation:
)evennotis()oddnotis(,)evenis(~)oddis(~,
))evenis()oddis((~,))evenis()oddis(,(~
zzzzzz
zzzzzz
β§βββ‘β§βββ‘β¨βββ‘
β¨ββ
The negation is false
β’ Write down the negation of the following statement.
)primeis()evenis(, nnn β§ββ
Negation:
)primenotis()evennotis(,)primeis(~)evenis(~,
))primeis()evenisn((~,))primeis()evenis(,(~
nnnnnn
nnnnn
β¨βββ‘
β¨βββ‘
β§βββ‘
β§ββ
The negation is false.
![Page 75: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/75.jpg)
WUCT121 Logic 75
Example:
β’ Write the following statement using quantifiers. Find
its negation
βSome dogs are vegetarians.β
Let D be the set of dogs.
Statement: vegetarianis, dDd ββ
Negation:
riannot vegetaare dogs Allriannot vegetais,
)vegetarianis(~,)vegetarianis,(~
dDddDd
dDd
βββ‘βββ‘ββ
Exercises:
β’ Write the following statement using quantifiers. Find
the negation.
βThere is a real number that is rational.β
Statement: βββ xx ,
Negation:
rationalnotarenumbersrealAll,
)(~,),(~
ββββ‘ββββ‘
βββ
xxxx
xx
False
![Page 76: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/76.jpg)
WUCT121 Logic 76
β’ Write the following statement using quantifiers. Find
the negation.
P(p): Some computer hackers are over 40.
Let C be the set of computer hackers. 40over is,:)( pCppP ββ
or under 40 are ackerscomputer h Allor under40is,
40over not is,40)over is(~,
40)over is,(~:)(~
pCppCp
pCppCp
pP
βββ‘βββ‘βββ‘ββ
False
β’ Write the following statement using quantifiers. Find
the negation.
βSome animals are dogs.β
Let A be the set of animals
Statement: dogais, xAxββ
Negation:
( )dog a not is,
dog ais,~xAxxAx
βββ‘ββ
All animals are not dogs. False
![Page 77: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/77.jpg)
WUCT121 Logic 77
2.1.5. Multiple Quantifiers
When a statement contains multiple quantifiers their order
must be applied as written and will produce different
results for the truth set.
Examples:
Write the following statements using quantifiers:
β’ βEverybody loves somebody.β
Let H be the set of people.
Statement: ,, HyHx ββββ x loves y.
β’ βSomebody loves everyone.β
Let H be the set of people.
Statement: ,, HyHx ββββ x loves y.
![Page 78: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/78.jpg)
WUCT121 Logic 78
Exercises:
Write the following statements using quantifiers:
β’ βEverybody loves everybody.β
Let H be the set of people.
Statement: ,, HyHx ββββ x loves y.
β’ The Commutative Law of Addition for
Statement: xyyxyx +=+ββββ ,, ,
β’ βEveryone had a mother.β
Let H be the set of humans.
Statement: xyHyHx ofmotherthewas,, ββββ ,
or x was the child of y.
β’ βThere is an oldest person.β
Let H be the set of humans.
Statement: yxHyHx older thanis,, ββββ ,
![Page 79: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/79.jpg)
WUCT121 Logic 79
Examples:
Write the following statements without using quantifiers:
β’ 0,, =+ββββ yxyx ,
Statement: Given any real number, you can find a real
number so that the sum of the two is zero. Alternatively:
Every real number has an additive inverse.
β’ yyxyx =+ββββ ,, ,
Statement: There is a real number, which added to any
other real number results in the other number.
Alternatively: Every real number has an additive identity.
Exercises:
Write the following statements without using quantifiers:
β’ caac colouredis,animals,colours ββββ
Statement: For every colour, there is an animal of that
colour.
Alternatively: There are animals of every colour.
β’ bppb readhas,people,books ββββ
Statement: There is a book everyone has read.
![Page 80: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/80.jpg)
WUCT121 Logic 80
2.1.6. Interpreting Statements with Multiple
Quantifiers
To establish the truth of a statement with more than one
quantifier, take the action suggested by the quantifiers as
being performed in the order in which the quantifiers occur.
Consider },{},,,{ 21321 yyBxxxA == and the
predicate ),( yxP .
There will be 6 possible predicates:
).,(,),(
),,(),,(
),,(,),(
2313
2212
2111
yxPyxP
yxPyxP
yxPyxP
β’ For ),(,, yxPByAx ββββ to be true the following
must hold:
),(),(
),(),(
),(),(
2313
2212
2111
yxPyxP
yxPyxP
yxPyxP
β§β§
β§β§
β§
Thus there will be 6 predicates which must all be true. That
is for all pairs (x, y), P(x, y) must be true. It will be false if
there is one pair (x, y), for which P(x, y) is false.
![Page 81: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/81.jpg)
WUCT121 Logic 81
β’ For ),(,, yxPByAx ββββ to be true, the following
must hold:
),(),(
),(),(
),(),(
2313
2212
2111
yxPyxP
yxPyxP
yxPyxP
β¨β§
β¨β§
β¨
Thus there will be 3 predicates which must be true. That is
for every x there must be at least one y so that P(x, y) is
true. Given any element x in A you can find an element y in
B, so that P(x, y) is true. It will be false if there is one x in A
for which P(x, y) is false for every y in B.
β’ For ),(,, yxPByAx ββββ to be true, the following
must hold:
),(),(
),(),(
),(),(
2313
2212
2111
yxPyxP
yxPyxP
yxPyxP
β§β¨
β§β¨
β§
Thus there will be 2 predicates which must be true. That is
there is one x that when paired with any y, P(x, y) is true.
You can find one element x in A that with all elements y in
B, P(x, y) is true. It will be false if for every x in A, there is
a y in B for which P(x, y) is false.
![Page 82: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/82.jpg)
WUCT121 Logic 82
β’ For ),(,, yxPByAx ββββ to be true, the following
must hold:
),(),(
),(),(
),(),(
2313
2212
2111
yxPyxP
yxPyxP
yxPyxP
β¨β¨
β¨β¨
β¨
Thus there will be 1 predicate which must be true. That is
there is one x that when paired with one y, P(x, y) is true.
You can find one element x in A and one element y in B,
P(x, y) is true. It will be false if for all pairs (x, y), P(x, y) is
false.
Summary:
Statement When true? When false? ),(,, yxPyx ββ P(x, y) is true for
all pairs (x, y) There is a pair (x, y) for which P(x, y) is false
),(,, yxPyx ββ For every x, there is a y for which P(x, y) is true
There is an x such that P(x, y) is false for every y
),(,, yxPyx ββ There is an x such that P(x, y) is true for every y
For every x, there is a y for which P(x, y) is false
),(,, yxPyx ββ There is a pair (x, y) for which P(x, y) is true
P(x, y) is false for all pairs (x, y)
![Page 83: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/83.jpg)
WUCT121 Logic 83
2.1.7. Negation of Statements with Multiple
Quantifiers.
To negate statements with multiple quantifiers, each
quantifier is negated and the predicate must be negated.
β’ To negate ),(,, yxPByAx ββββ
( ) ),(~,,),(,,~ yxPByAxyxPByAx βββββ‘ββββ
β’ To negate ),(,, yxPByAx ββββ
( ) ),(~,,),(,,~ yxPByAxyxPByAx βββββ‘ββββ
β’ To negate ),(,, yxPByAx ββββ
( ) ),(~,,),(,,~ yxPByAxyxPByAx βββββ‘ββββ
β’ To negate ),(,, yxPByAx ββββ
( ) ),(~,,),(,,~ yxPByAxyxPByAx βββββ‘ββββ
Examples:
Write the negation of the following:
β’ Statement: 0,, =+ββββ yxyx ,
Negation:
( )
0then,Take:False0,,0,,~
=β=+β=β +βββββ‘=+ββββ
xxyxxyyxyxyxyx
,
,
![Page 84: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/84.jpg)
WUCT121 Logic 84
β’ Statement: 1,, =ββββ xyyx ,
Negation:
( )
1then,Take:True
1,,1,,~
2 β β=β=
β βββββ‘=ββββ
xxyxy
xyyxxyyx
,
,
Exercises:
Write the negation of the following:
β’ Statement: caac colouredis,animals,colours ββββ
Negation:
( )caac
caaccolourednot is,animals,colours
colouredis,animals,colours~βββββ‘βββββ‘
There is a colour which every animal is not. True, my cat is
not purple.
β’ Statement: bppb readhas,people,books ββββ
Negation:
( )bppb
bppbnot readhas,people,books
readhas,people,books~βββββ‘βββββ‘
There is someone who has not read every book. True, me,
Iβve not read every book.
![Page 85: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/85.jpg)
WUCT121 Logic 85
Section 3. Proofs
3.1. Introduction.
A proof is a carefully reasoned argument which establishes
that a given statement is true. Logic is a tool for the
analysis of proofs. Each statement within a proof is an
assumption, an axiom, a previously proven theorem, or
follows from previous statements in the proof by a
mathematical or logical rules and definitions.
3.1.1. Assumptions.
Assumptions are the statements you assume to be true as
you try to prove the result.
Example:
If you want to prove:
βIf βx and βn is even, then 0>nx β
Your proof should start with the assumptions that βx
and βn is even. Further, you can use the βdefinitionβ of
an even natural number, and write the assumptions as
follows:
Let βx , and βn be even, that is, pnp 2, =ββ .
![Page 86: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/86.jpg)
WUCT121 Logic 86
Assumptions are often thought to be the βgiven
informationβ or information we βknowβ that can be used in
our proof. As in the example above, when you are proving
statements of the form QP β , then the assumption is the
statement P.
Exercise:
Write the statement to be proven in the previous example
using logical notation:
0)]2,:()[( >β=ββββ§β nxpnpnx
3.1.2. Axioms.
Axioms are laws in Mathematics that hold true and require
no proof.
Examples:
β’ xx =
β’ xx =+ 0
β’ )()]()([,,, zxzyyxzyx =β=β§=ββ
![Page 87: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/87.jpg)
WUCT121 Logic 87
3.1.3. Mathematical Rules.
Mathematical Rules are known rules that are often used.
Example:
)()(,,, zyzxyxzyx +=+β=ββ
3.1.4. Logical Rules.
Logical Rules are rules of logic such as Substitution and
Substitution of Equivalence using the laws introduced
earlier
3.2. The Law of Syllogism
If QP β and RQ β are both tautologies, then so is
RP β .
Exercise:
β’ Write the Law of Syllogism using logical notation: )())()(( RPRQQP ββββ§β
![Page 88: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/88.jpg)
WUCT121 Logic 88
β’ Show, using the quick method that the Law of
Syllogism is a tautology.
((P β Q) β§ (Q β R)) β ( P β R) Step: 1 3 2 5* 4 1. F 2. T F 3. T F 4. T T 5. T T F F
1. Place βFβ under main connective
2. For βFβ to occur under the main connective, β§ must be
βTβ and β must be βFβ
3. For βFβ to occur under β , P must be βTβ and R must
be βFβ.
4. For βTβ under β§ , both β must be βTβ
5. For the first β to be true, given P is βTβ, Q must be
βTβ. For the second β to be true, given R is βFβ, Q must
be βFβ.
Q cannot be both βTβ and βFβ, thus
)())()(( RPRQQP ββββ§β can only ever be true
and is a tautology.
![Page 89: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/89.jpg)
WUCT121 Logic 89
Examples:
β’ s is a square β s is a rectangle
s is a rectangle β s is a parallelogram
s is a parallelogram β s is a quadrilateral
β΄ s is a square β s is a quadrilateral.
β’
960
960)96(
0)96(0)3(
0)3(0
22
22
22
22
ββ₯βββ₯β΄
ββ₯βββ₯+β
β₯+βββ₯β
β₯βββ₯
xxx
xxxx
xxx
xx
Exercise:
Complete the following using the Law of Syllogism:
β’ t is studying WUCT121 β t is enrolled in a diploma
t is enrolled in a diploma β t is student at WCA.
β΄ t is studying WUCT121 β t is student at WCA.
β’
ββββ΄βββ
ββββββ
xxxxxxxx
![Page 90: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/90.jpg)
WUCT121 Logic 90
Most results in Mathematics that require proofs are of the
form QP β . The Law of Syllogism provides the most
common method of performing proofs of such statements.
The Law of Syllogism is a kind of transitivity that can
apply to β .
To use the Law of Syllogism, we set up a sequence of
statements, QPPPPPPP n ββββ ,,,, 32211 K .
Then, by successive applications of the law, we have
QP β .
Example.
We wish to prove that for βn , if n is even, then 2n is
even.
In logic notation, we wish to prove:
n is even (P) 2nβ is even (Q).
This has the form QP β and we note that our assumption
includes βn and P: n is even.
![Page 91: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/91.jpg)
WUCT121 Logic 91
Proof:
)()()(
)(
evenis)2(2
)2(24
42,
2,evenis
3
32
21
1
222
2222
22
QPPPPPPP
npn
pnpn
pnpnp
pnpn
ββββ
β=
=β=
=β=ββ
=βββ
K
K
K
K
Completing the proof is simply a matter of applying the
Law of Syllogism three times to get n is even 2nβ is
even.
The previous proof can be simplified to:
evenis
2),2(2
4
2,evenis
2
222
22
n
ppn
pn
pnpn
β
β=β
=β
=βββ
The use of Law of Syllogism is a matter of common sense.
We shall use the Law of Syllogism without direct
reference.
Note. The use of the connective β in the previous proof
seems a little repetitive, albeit valid. For variety, the
connective can be replaced by words such as therefore,
thus, so we have, and hence.
![Page 92: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/92.jpg)
WUCT121 Logic 92
3.3. Modus Ponens
3.3.1. Rule of Modus Ponens:
If P and QP β are both tautologies, then so is Q.
In other words, Modus Ponens simply says that if we know
P to be true, and we know that P implies Q, then Q must
also be true.
Exercise:
β’ Write the rule of Modus Ponens using logical notation:
QQPP βββ§ ))((
![Page 93: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/93.jpg)
WUCT121 Logic 93
β’ Show, using the quick method that the rule of Modus
Ponens is a tautology.
(P β§ (P β Q)) β Q Step 2 1 3*
1. Place βFβ under main
connective.
F
2. For βFβ to occur under the
main connective, β§ must be
βTβ and Q must be βFβ
T F
3. For βTβ to occur under β§ , P
must be βTβ and QP β must
be βTβ
T T
4. For βTβ to occur under
QP β ,when P is βFβ P must
be βFβ
F F
P cannot be both βTβ and βFβ, thus QPQP ββ§β ))(( can only
ever be true and is a tautology.
![Page 94: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/94.jpg)
WUCT121 Logic 94
Examples:
β’ If Zak is a cheater, then Zak sits in the back row
Zak is a cheater
Therefore Zak sits in the back row.
β’ If 2 = 3 then I will eat my hat
2 = 3
Therefore I will eat my hat
Exercise:
Complete the following using Modus Ponens
β’ If Zeus is a God, then Zeus is immortal
Zeus is a God
Therefore Zeus is immortal.
β’ If it is sunny then I will go to the beach
It is sunny
Therefore I will go to the beach
β’ If I study hard then I will pass
I study hard
Therefore I will pass
![Page 95: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/95.jpg)
WUCT121 Logic 95
3.3.2. Universal Rule of Modus Ponens:
If P(x) and Q(x) are predicates, the universal rule of Modus
Ponens is )())())()((( aQaPxQxP ββ§β .
This means Modus Ponens can be applied to predicates
using specific values for the variables in the domain.
Examples:
β’ If x is even [P(x)], then 2x is even [Q(x)]
x = 98374 [P(a)]
Therefore 298374 is even. [Q(a)]
β’ The Principle of Mathematical Induction says that
when you have a statement, Claim(n), that concerns βn ,
If β©β¨β§
ββ+β kkkP
),1(Claim)(Claim)1(Claim
: then Claim(n) is
true for all βn (Q)
Thus we have QP β .
![Page 96: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/96.jpg)
WUCT121 Logic 96
Exercise:
According to Modus Ponens, what must we establish so we
can apply this principle to the following statement and be
able to say βClaim(n) is true for all βn β?
β’ Claim(n): 14 βn is a multiple of 3.
We must show that Claim(n) satisfies P.
So we need to establish two things:
1. Claim(1), i.e. 141 β is a multiple of 3; AND
2. ββ+β kkk ),1(Claim)(Claim , i.e. If 14 βk is a
multiple of 3 for all βk , then ( ) 14 1 β+k is a multiple
of 3.
![Page 97: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/97.jpg)
WUCT121 Logic 97
3.4. Modus Tollens
3.4.1. Rule of Modus Tollens:
If ~Q and QP β are both tautologies, then so is ~P.
In other words, Modus Ponens simply says that if we know
~Q to be true, and we know that P implies Q, then ~P must
also be true. Similarly if we know Q to be false, and we
know that P implies Q, then P must also be false
Exercise:
β’ Write the rule of Modus Ponens using logical notation: PQQP ~)~)(( ββ§β
![Page 98: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/98.jpg)
WUCT121 Logic 98
β’ Show, using the quick method that the rule of Modus
Tollens is a tautology.
((P β Q) β§ ~Q β ~P Step: 2 3 1 4* 5
1.Place βFβ under main
connective
F
2. For βFβ to occur under
the main connective, β§
must be βTβ and ~P must
be βFβ
T F
3. For βTβ to occur under β§ , ~Q must be βTβ and
QP β must be βTβ
T T
4. For βTβ to occur under
QP β ,when P is βTβ, Q
must be βTβ
T T
At step 2, ~P is βFβ, thus P is βTβ. Step 3 shows ~Q is βTβ
thus Q is βFβ and step 4 gives Q is βTβ. Q cannot be both βTβ
and βFβ, thus PQQP ~)~)(( ββ§β can only ever be true
and is a tautology.
![Page 99: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/99.jpg)
WUCT121 Logic 99
Examples:
β’ If Zak is a cheater, then Zak sits in the back row
Zak sits in the front row
Therefore Zak is not a cheater.
β’ If 2 > 3 then Earth is flat
The Earth is not flat
Therefore 2 u 3
Exercise:
Complete the following using Modus Tollens
β’ If Zeus is a God, then Zeus is immortal
Zeus is not immortal
Therefore Zeus is not a God.
β’ If I go to the beach then it is sunny
It is not sunny
Therefore I donβt go to the beach
β’ If I arrive on time then I will be marked present
I was marked absent
Therefore I did not arrive on time.
![Page 100: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/100.jpg)
WUCT121 Logic 100
3.4.2. Universal Rule of Modus Tollens:
If P(x) and Q(x) are predicates, the universal rule of Modus
Tollens is: )(~))(~))()((( aPaQxQxP ββ§β .
This means Modus Tollens can be applied to predicates
using specific values for the variables in the domain.
Example:
β’ If βx , then baxbba =β ββ ,0,,
2=x
Therefore β2 .
Exercise:
Complete the following using the universal rule of Modus
Tollens
β’ If βx , then 1β₯x
1β=x
Therefore ββ1 .
![Page 101: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/101.jpg)
WUCT121 Logic 101
3.5. Proving Quantified Statements
3.5.1. Proving Existential Statements
A statement of the form ( )xPDx ,ββ is true if and only if
( )xP is true for at least one Dx β .
To prove this kind of statement, we need to find one Dxβ
that makes ( )xP true.
Examples:
β’ Prove that there exists an even integer that can be
written two ways as the sum of two primes.
The statement is of the form ( )xPDx ,ββ , where D is the
set of even integers and P(x) is the statement βx can be
written as the sum of two primesβ
Thus we need find only one even integer which satisfies
P(x).
Essentially, to find the appropriate number, we have to
βguessβ.
Consider 7714 += (7 is prime); and 11314 += (3 and 11
are prime).
Therefore, there exists an even integer that can be written
two ways as the sum of two primes.
![Page 102: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/102.jpg)
WUCT121 Logic 102
β’ Let βsr, . Prove ksrk 21822, =+ββ
The statement is of the form ( )kPDk ,ββ , where D is the
set of integers and P(k) is the statement: β ksr 21822 =+ β.
Thus we need find only one integer which satisfies P(k)
β+==
+=+srkk
srsr911where2
)911(21822
Exercises:
β’ Prove 05, =+ββ xx .
Let ββ= 5x , then 0555 =+β=+x .
β’ Prove that if βba, ,then ba 810 + is divisible by 2
(i.e., is even).
( )baba 452810 +=+ and β+ ba 45 .
Thus, ( )ba 8102 + .
![Page 103: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/103.jpg)
WUCT121 Logic 103
3.5.2. Proving Universal Statements
A statement of the form ( )xPDx ,ββ is true if and only if
( )xP is true for at every Dx β .
To prove this kind of statement, we need prove that for
every Dx β , ( )xP is true.
In order to prove this kind of statement, there are two
methods:
Method 1: Method of Exhaustion.
The method of exhaustion is used when the domain is
finite.
Exhaustion cannot be used when the domain is infinite.
To perform the method of exhaustion, every member of the
domain is tested to determine if it satisfies the predicate.
![Page 104: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/104.jpg)
WUCT121 Logic 104
Example:
β’ Prove the following statement:
Every even number between 2 and 16 can be written as a
sum of two prime numbers.
The statement is of the form ( )xPDx ,ββ , where
}14,12,10,8,6,4{=D ,and P(x) is the statement βx can be
written as the sum of two prime numbersβ.
The domain D is finite so the method of exhaustion can be
used.
Thus we must test every number in D to show they can be
written as the sum of two primes.
7714538
7512336
5510224
+=+=
+=+=
+=+=
Thus by the method of exhaustion every even number
between 2 and 16 can be written as a sum of two prime
numbers.
![Page 105: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/105.jpg)
WUCT121 Logic 105
Exercise:
β’ Prove for each integer n with 101 β€β€ n , 112 +β nn is
prime.
The statement is of the form ( )nPDn ,ββ , where
}10,9,8,7,6,5,4,3,2,1{=D ,and P(n) is the statement
β 112 +β nn is primeβ. Thus we must show all numbers in
D satisfy P(n).
primeis101111010)10(
primeis671188)8(
primeis411166)6(
primeis231144)4(
primeis131122)2(
primeis891199)9(
primeis531177)7(
primeis311155)5(
primeis171133)3(
primeis111111)1(
2
2
2
2
2
2
2
2
2
2
=+β=
=+β=
=+β=
=+β=
=+β=
=+β=
=+β=
=+β=
=+β=
=+β=
P
P
P
P
P
P
P
P
P
P
Thus by the method of exhaustion for each integer n with
101 β€β€ n , 112 +β nn is prime.
![Page 106: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/106.jpg)
WUCT121 Logic 106
Method 2: Generalised Proof.
The generalised proof method is used when the domain is
infinite.
It is called the method of generalizing from the generic
particular.
In order to show that every element of the domain satisfies
the predicate, a particular but arbitrary element of the
domain is chosen and shown to satisfy the predicate.
The method to show the predicate is satisfied will vary
depending on the form of the predicate.
Specific techniques of generalized proof will be outlined
later in this section.
![Page 107: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/107.jpg)
WUCT121 Logic 107
Example:
β’ Pick any number, add 3, multiply by 4, subtract 6,
divide by two and subtract twice the original. The result is
3.
Proof:
Choose a particular but arbitrary number, say x, and then
determine if it satisfies the statement.
Step Result
Pick a number x
Add 3 3+x
Multiply by 4 1244)3( +=Γ+ xx
Subtract 6 646124 +=β+ xx
Divide by 2 322)64( +=Γ·+ xx
Subtract twice the original 3232 ==+ xx
In this example, x is particular in that it represents a single
quantity, but arbitrarily chosen as it can represent any
number.
![Page 108: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/108.jpg)
WUCT121 Logic 108
3.6. Disproving Quantified Statements
3.6.1. Disproving Existential Statements
A statement of the form ( )xPDx ,ββ is false if and only
if ( )xP is false for all Dx β .
To disprove this kind of statement, we need to show the for
all Dxβ , ( )xP is false.
That is we need to prove itβs negation: )(~,))(,(~ xPDxxPDx βββ‘ββ
This is equivalent to proving a universal statement and so
the method of exhaustion or the generalized proof method
is used.
Example:
β’ Disprove: There exists a positive number n such that
232 ++ nn is prime.
Proving the given statement is false is equivalent to proving
its negation is true. That is proving that for all numbers n ,
232 ++ nn is not prime. Since this statement is universal,
its proof requires the generalised proof method.
![Page 109: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/109.jpg)
WUCT121 Logic 109
3.6.2. Disproving Universal Statements
A statement of the form ( )xPDx ,ββ is false if and only
if ( )xP is false for at least one Dx β .
To disprove this kind of statement, we need to find one
Dxβ such that ( )xP is false.
That is we need to prove itβs negation: )(~,))(,(~ xPDxxPDx βββ‘ββ
This is known as finding a counterexample.
Example:
β’ Disprove: ).()(,, 22 bababa =β=ββ
Let )()(:),( 22 bababaP =β= .
We need to show ),(~,, baPba ββ
Counterexample:
Let .1,1 β== ba Then 22 ba = however ba β .
Now true β false is false, thus ),( baP is false, and
),(~ baP is true
So, we have shown, by counterexample ),(~,, baPba ββ
![Page 110: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/110.jpg)
WUCT121 Logic 110
Exercises:
β’ Disprove: ).00(, <β¨>ββ xxx
Need to prove: ).00(~, <β¨>ββ xxx
That is ).00(, β₯β§β€ββ xxx
Let 0=x .
β’ Disprove ).oddis2
1()oddis(, ββββ
zzz
Let ).evenis224
215(,)oddis(,5 ==
ββ= zz
β’ Prove or disprove: ).0(,, =+ββββ yxyx
To prove the statement: Find a specific y for each βgeneralβ
x.
Consider an .βx Let ,ββ= xy then
( ) 0=β+=+ xxyx .
![Page 111: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/111.jpg)
WUCT121 Logic 111
3.7. Generalised Proof Methods
Before proving a statement, it is of great use to write the
statement using logic notation, including quantifiers, where
appropriate.
Doing this means you have clearly written the assumptions
you can make AND the conclusion you are aiming to reach.
Example:
β’ Prove: For all integers n, if n is odd, then 2n is odd.
Rewritten using logic notation:
oddisoddis, 2nnn βββ
Here the domain is given as , , and the predicate involves
the statements: P(n) is n is odd, Q(n) is 2n is odd.
The form of the predicate is )()( nQnP β .
Thus the assumption that can be made is P(n) and the
conclusion to be reached is Q(n).
![Page 112: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/112.jpg)
WUCT121 Logic 112
3.7.1. Direct Proof
A direct proof is one in which we begin with the
assumptions and work in a straightforward fashion to the
conclusion.
The steps in the final proof must proceed in the correct
βdirectionβ beginning with the initial assumption and
following known laws, rules, definitions etc. until the final
conclusion is reached. The proof must not start with what
you are trying to prove.
Example:
β’ Prove that if 1593 =βx then 8=x .
Assuming the domain to be , then the statement is of the
form )()(, xQxPx βββ .
Thus the assumption is 1593:)( =βxxP , and the
conclusion 8:)( =xxQ .
83
243
3243
9159931593
=β
=β
=β+=+ββ=β
x
xxxx
![Page 113: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/113.jpg)
WUCT121 Logic 113
Exercise:
β’ Prove: For all integers n, if n is odd, then 2n is odd.
Rewritten using logic notation:
oddisoddis, 2nnn βββ
Here the domain is given as , , and the predicate involves
the statements: P(n) is n is odd, Q(n) is 2n is odd.
The form of the predicate is )()( nQnP β .
Thus the assumption that can be made is P(n) and the
conclusion to be reached is Q(n).
Proof:
oddofdefinitionoddis
2212
1)22(2
144
)12(
oddofdefinition12oddis
2
22
22
22
22
n
ppqqn
ppn
ppn
pn
ppnn
β
β+=+=β
++=β
++=β
+=β
β+=β
![Page 114: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/114.jpg)
WUCT121 Logic 114
When the statement to be proven is of the form:
)()( xQxP β , the assumption which begins the proof is
).(xP
If the form is not )()( xQxP β , or )(xP is not clear, it may
be necessary to examine what you are aiming to prove and
establish an assumption from which to begin.
Example:
β’ Prove that for ( ) 212, 2 β€++ββ xxx .
(Do not start with this!)
In this case, the form is not )()( xQxP β .
By examining what we are aiming to prove, i.e.
( ) 2122 β€++β xx a beginning to the proof can be found.
( )βͺβͺβ©
βͺβͺβ¨
β§
β₯ββ
β₯+ββ
ββ₯ββββ€++β
true.is 01
012
212212
:working2
2
22
x
xx
xxxx
We can now put the proof together:
We know that ( ) 01 2 β₯βx for any .βx
Thus,
![Page 115: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/115.jpg)
WUCT121 Logic 115
1bygmultiplyin212
sidesbothfrom2gsubtractin212
expanding012
knowniswhat0)1(
2
2
2
2
ββ₯++ββ
ββ₯βββ
β₯+ββ
β₯β
xx
xx
xx
x
Note. In the example, we did NOT start with the statement
( ) 2122 β€++β xx , as we technically do not know whether
it is true or not. We started our proof with a statement we
know to be true.
Exercise:
β’ Prove the following:
If the right angled triangle XYZ with sides of length x and y
and hypotenuse z has an area of 4
2z , then the triangle is
isosceles.
z
Z
y
Y x
X
![Page 116: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/116.jpg)
WUCT121 Logic 116
The form of statement is )()( xQxP β .
What is known. i.e. the assumptions that can be made are:
β’ Area of the triangle: 4
2zA = , (1)
β’ Area of any triangle:
( ) ( ) xy21
21 height base =ΓΓ= (2)
β’ The sides are of length x and y and hypotenuse
z so by Pythagoras: 222 yxz += . (3)
What is to be proven: That triangle XYZ is isosceles. Thus
we must show two sides have equal length.
Proof:
Substituting (3) into (1) and equating with (2) gives:
24
22 xyyx=
+
( )
( )yxyx
yxyx
xyyxxyyx
=β=ββ
=+ββ
=+β=+
0
02
4by sidesboth gmultiplyin224
2
22
2222
So two sides are equal and thus triangle XZY is isosceles.
![Page 117: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/117.jpg)
WUCT121 Logic 117
3.8. Indirect Proofs.
3.8.1. Method of Proof by Contradiction
The method of proof by contradiction can be used when the
statement to be proven is not of the form )()( xQxP β .
The method is as follows:
1. Suppose the statement to be proven is false. That is,
suppose that the negation of the statement is true.
2. Show that this supposition leads to a contradiction
3. Conclude that the statement to be proven is true.
Example:
β’ Prove there is no greatest integer.
Suppose not, that is suppose there is a greatest integer. N.
Then nN β₯ for every integer n. Let 1+= NM . Now M is
an integer since it is the sum of integers. Also NM > since
1+= NM
Thus M is an integer that is greater than N. So N is the
greatest integer and N is not the greatest integer, which is a
contradiction.
Thus the assumption that there is a greatest integer is false,
hence there is no greatest integer is true.
![Page 118: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/118.jpg)
WUCT121 Logic 118
Exercise:
β’ Prove there is no integer that is both even and odd.
Suppose not, that is suppose there is a greatest integer an
integer n, that is both even and odd.
By the definition of even )1(,2 Kβ= kkn , and by the
definition of odd )2(,12 Kβ+= lln .
If n is both even and odd then equation (1) and (2) gives:
β=ββ
=ββ=ββ
+=
21
1)(2122
122
lk
lklk
lk
Now since k and l are integers, the difference k β l must be
an integer. However β=β21lk . Thus k β l is an integer
and k β l is not an integer, which is a contradiction.
Thus the supposition is false and hence the statement
βThere is no integer that is both even and oddβ is true.
![Page 119: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/119.jpg)
WUCT121 Logic 119
3.8.2. Proof by Contraposition
Recall the following logical equivalence: ).~(~)( PQQP ββ‘β
)~(~ PQ β is known as the contrapositive of )( QP β .
This equivalence indicates that if )~(~ PQ β is a true
statement, then so too is )( QP β .
Thus, in order to prove )( QP β , we prove the
contrapositive, that is )~(~ PQ β , is true.
The method of proof by contraposition can be used when
the statement to be proven is of the form )()( xQxP β .
The method is as follows:
1. Express the statement to be proven in the form: ).()(, xQxPDx βββ
2. Rewrite the statement in the contrapositive
form: ).(~)(~, xPxQDx βββ
3. Prove the contrapositive by a direct proof.
a. Suppose that x is a particular but arbitrary
element of D, such that Q(x) is false.
b. Show that P(x) is false.
![Page 120: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/120.jpg)
WUCT121 Logic 120
Example:
β’ Prove that for all integers n if 2n is even, n is even.
The statement can be expressed in the form:
.evenisevenis, 2 nnn βββ
Thus the contrapositive is
.evennot isevennot is, 2nnn βββ That is
.oddisoddis, 2nnn βββ
To prove the contrapositive:
Let n be any odd integer.
Then )1(,12 Kβ+= kkn
Show 2n is odd, i.e. show β+= lln ,122
β+=+=
++=
++=
+=
kkll
kk
kk
bykn
2212
1)22(2
144
)1()12(
2
2
2
22
So 2n is odd, and the contrapositive is true.
Hence the statement βfor all integers n if 2n .is even, n is
evenβ is also true.
![Page 121: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/121.jpg)
WUCT121 Logic 121
Exercise:
β’ Prove that for all integers n if 2|5 n/ .then n|5 / .
The statement can be expressed in the form:
.|5|5, 2 nnn /β/ββ
Thus the contrapositive is .|5|5, 2nnn βββ
To prove the contrapositive:
Let n be any odd integer.
Then )1(,5|5 Kβ=β kknn
Show 2|5 n , i.e. show β= lln ,52
β==
=
=
=
2
2
2
22
55
)5(5
25
)1()5(
kll
k
k
bykn
So 2|5 n , and the contrapositive is true.
Hence the statement βfor all integers n if 2|5 n/ .then n|5 / β
is also true.
![Page 122: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/122.jpg)
WUCT121 Logic 122
Exercise:
β’ Prove if y is irrational, then y + 7 is irrational.
The statement can be expressed in the form: β+ββββ 7, yyy
Thus the contrapositive is βββ+ββ yyy 7,
To prove the contrapositive:
Let. β+β 7, yy , so 0,,,7 β β=+ bbabay .
Show βy , that is 0,,, β β= ddcdcy
0,,7
7
77
β β=β==β
β=β
β=β=+
dbdbacdcy
bbay
bay
bay
Therefore βy , and the contrapositive is true.
Hence the statement βif y is irrational, then y + 7 is
irrationalβ is also true.
![Page 123: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/123.jpg)
WUCT121 Logic 123
3.8.3. Proof by Cases
When the statement to be proven is of the form, or can be
written in the form: RQP ββ¨ )( , the method of proof by
cases can be used.
It relies on the logical equivalence ).)(())()(( RQPRQRP ββ¨β‘ββ§β
The method is as follows:
1. Prove RP β
2. Prove .RQ β
3. Conclude .)( RQP ββ¨
If the statement is not written in the form RQP ββ¨ )( , it
is necessary to establish the particular cases by exhaustion.
![Page 124: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/124.jpg)
WUCT121 Logic 124
Example:
β’ Prove: If 0β x or 0β y , then 022 >+ yx .
The statement can be expressed in the form:
0)0()0( 22 >+ββ β¨β yxyx
We assume βyx, , thus .0,0 22 β₯β₯ yx
Proof:
Case 1: Prove 00 22 >+ββ yxx
Let 0β x , then 02 >x and 02 β₯y .
Thus 022 >+ yx .
Case 2: Prove 00 22 >+ββ yxy
Let 0β y , then 02 >y and 02 β₯x .
Thus 022 >+ yx .
Therefore If 0β x or 0β y , then 022 >+ yx .
![Page 125: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/125.jpg)
WUCT121 Logic 125
Exercise.
β’ Prove: If 2ββ€x or 2β₯x , then 042 β₯βx .
The statement can be expressed in the form:
04)2()2( 2 β₯βββ₯β¨ββ€ xxx
Proof:
Case 1: Prove 042 2 β₯ββββ€ xx
04
4
2
2
2
β₯ββ
β₯β
ββ€
x
x
x
Therefore 042 2 β₯ββββ€ xx
Case 2: Prove 042( 2 β₯βββ₯ xx
04
4
2
2
2
β₯ββ
β₯β
β₯
x
x
x
Therefore 042 2 β₯βββ₯ xx
Thus if 2ββ€x or 2β₯x , then 042 β₯βx .
![Page 126: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/126.jpg)
WUCT121 Logic 126
If the statement is not written in the form RQP ββ¨ )( , it
is necessary to establish the particular cases by exhaustion.
Example.
β’ Prove: 1, 2 ++ββ mmm is odd.
The statement is not in the form .)( RQP ββ¨ However by
considering )oddis()evenis( mmm β¨ββ . Then the
statement can be expressed in the form:
oddis1)oddis()evenis( 2 ++ββ¨ mmmm
Case 1: Prove oddis1evenis 2 ++β mmm
)1(,2evenis Kβ=β ppmm .
( )
( )( ) β+=+=
++=
++=
++=++
ppkk
pp
pp
ppmm
2
2
2
22
2 where,12
122
124
)1(by1221
Therefore, oddis1evenis 2 ++β mmm .
![Page 127: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/127.jpg)
WUCT121 Logic 127
Case 2: Prove oddis1oddis 2 ++β mmm
)2(,12oddis Kβ+=β qqmm .
( )
( )( ) β++=+=
+++=
+++=
+++++=
++++=++
132 where,12
11322
1264
112144
)2(by112121
2
2
2
2
22
qqll
qqq
qqmm
Therefore, oddis1oddis 2 ++β mmm .
Therefore, oddis1)oddis()evenis( 2 ++ββ¨ mmmm .
Therefore, 1, 2 ++ββ mmm is odd.
![Page 128: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/128.jpg)
WUCT121 Logic 128
Exercise.
β’ Prove: 3, 2 +βββ nnn is odd.
The statement is not in the form .)( RQP ββ¨ However by
considering )oddis()evenis( nnn β¨ββ . Then the
statement can be expressed in the form:
oddis3)oddis()evenis( 2 +βββ¨ nnnn
Case 1: Prove oddis3evenis 2 +ββ nnn
)1(,2evenis Kβ=β ppnn .
( )
( )( ) β+β=+=
++β=
++β=
+β=+β
12 where,12
1122
1224
)1(by3223
2
2
2
22
ppkk
pp
pp
ppnn
Therefore, oddis3evenis 2 +ββ nnn .
![Page 129: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/129.jpg)
WUCT121 Logic 129
Case 2: Prove oddis3oddis 2 +ββ nnn
)2(,12oddis Kβ+=β qqnn .
( )
( )( ) β++=+=
+++=
+++=
+ββ++=
++β+=+β
12 where,12
1122
1224
312144
)2(by3)12(123
2
2
2
2
22
qqll
qqq
qqnn
Therefore, oddis3oddis 2 +ββ nnn .
Therefore, oddis3)oddis()evenis( 2 +βββ¨ nnnn .
Therefore, 3, 2 +βββ nnn is odd.
![Page 130: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/130.jpg)
WUCT121 Logic 130
Section 4. Set Theory
4.1. Definitions
A set may be viewed as any well defined collection of
objects, called elements or members of the set.
Sets are usually denoted with upper case letters, A, B, X,
Y,β¦ while lower case letters are used to denote elements a,
b, x, y,β¦of a set.
Membership in a set is denoted as follows:
β’ Sa β denotes that a is a member or element of a
set S. Similarly Sba β, denotes that a and b are both
elements of a set S.
β’ Sa β denotes that a is not an element of a set S.
Similarly Sba β, denotes that neither of a and b are
elements of a set S.
In Set Theory, we work within a Universe, U, and consider
sets containing elements from U.
![Page 131: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/131.jpg)
WUCT121 Logic 131
A set may be specified in essentially two ways:
1. The elements of the set are listed within braces, {
}, and separated by commas.
Technically, the listing of elements can be done only for
finite sets. However, if an infinite set is defined by a
βsimpleβ rule, we sometimes write a few elements and then
use ββ¦β to mean roughly βand so onβ or βby the same
ruleβ.
Examples:
β’ }9,7,5,3,1{=A . The set A is the finite collection of
odd integers, 1 to 9 inclusive
β’ },4,2,0,2,4,{ KK ββ=B . The set B is the infinite
collection of even integers.
Exercises:
β’ List a finite set, C, containing even integers between
10 and 20 inclusive. }20,18,16,14,12,10{=C
β’ List an infinite set, D, containing natural numbers that
are divisible by 3 },9,6,3,0{ K=D
![Page 132: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/132.jpg)
WUCT121 Logic 132
2. A statement defining the properties which
characterise the elements in the set is written within braces
Examples:
β’ )}91oddis(:{ β€β€β§β= zzzA . The set A is the
finite collection of odd integers, 1 to 9 inclusive
β’ }2,:{ kzkzB =βββ= . The set B is the infinite
collection of even integers.
Exercises:
β’ Define a finite set, C, containing even integers
between 10 and 20 inclusive
)}2010evenis(:{ β€β€β§β= zzzC
β’ Define an infinite set, D, containing natural numbers
that are divisible by 3
}|3:{ nnD β=
![Page 133: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/133.jpg)
WUCT121 Logic 133
4.1.2. Axiom of Specification.
Given a Universe U and any statement )(xP involving
Uxβ , then there exists a set A such that
)).((, xPAxUx ββββ Further, we write
)}.(:{ xPUxA β=
In other words, the Axiom of Specification says that we can
pick a set and a property and build a new set. This is why
the notation for A is sometimes referred to as set-builder
notation.
Example:
Let U = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10} and )(xP be the
statement βx is oddβ.
\ by the Axiom of Specification, }.oddis:{ xUxA β=
Notes:
1. We know an element x belongs to the set
)}(:{ xPUxA β= if x satisfies the condition )(xP .
2. This notation is more simply written
)}(:{ xPDxβ .
This is called set builder notation. In using this notation, the
elements of the domain, D, must belong to the Universe, U,
![Page 134: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/134.jpg)
WUCT121 Logic 134
and ( )xP can be any predicate involving x. D could be all
of U.
Examples:
β’ The interval [0, 1] can be written in set builder
notation as:
{ } { }10:10: β€β€β=β€β€β§β xxxxx
β’ The set of all rational numbers, β can be written as:
ββ¬β«
β©β¨β§ β β§β==
ββ¬β«
β©β¨β§ β β§β=
0,::
0,:
bbabaxx
bbaba
β’ }1,1,0{}:{ 3 β==β xxx .
Exercises:
Write down the following sets by listing their elements:
β’ }1{}:{ 3 ==β xxx
β’ }3,3{}9:{ 2 β==β xx
β’ }{}7:{ 2 ==β xx
![Page 135: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/135.jpg)
WUCT121 Logic 135
4.2. Venn Diagrams
Venn diagrams are a pictorial method of demonstrating the
relationship between set. The universal set, U, is
represented by a rectangle and sets within the universe are
depicted with circles.
While a Venn diagram may be used to demonstrate the
relationship between sets, it does not provide a method of
proving those relationships.
![Page 136: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/136.jpg)
WUCT121 Logic 136
4.3. Special Sets
4.3.1. The Singleton Set
Sets having a single element are frequently called singleton
sets.
Example:
β’ {1} is read βsingleton 1β.
β’ If Uaβ , then }{}:{ aaxUx ==β
Note: The singleton set { }a is NOT the same as the element
a.
4.3.2. The Empty Set
The empty set or null set is a set which contains no
elements.
It is denoted by the symbol β or by empty braces { }.
Using set builder notation, one way of defining the empty
set is: }:{ xxx β β= β
![Page 137: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/137.jpg)
WUCT121 Logic 137
4.4. Subsets
4.4.1. Definition: Subset.
If A and B are sets, then A is called a subset of B, written
BA β , if and only if, every element in A is also in B.
Examples:
β’ }3,2,1{}2,1{ β
β’ The Venn diagram demonstrating BA β is:
Exercises:
β’ Write the definition of subset using logic notation.
),( BxAxUxBA βββββββ
β’ Is {cat, dog} β {bird, fish, cat, dog}? Yes
![Page 138: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/138.jpg)
WUCT121 Logic 138
4.4.2. Definition: Proper Subset.
If A and B are sets, then A is called a proper subset of B,
written BA β , if and only if, every element in A is also in
B but there is at least one element of B that is not in A.
A is a proper subset of B if BA β but BA β .
Examples:
β’ }3,2,1{}2,1{ β
Exercises:
β’ Draw a Venn diagram demonstrating BA β , where
}2,1{=A and }5,4,3,2,1{=B
β’ Is },,{},,{ abccba β ? No
![Page 139: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/139.jpg)
WUCT121 Logic 139
Notes.
1. If BA β , then each element of A belongs to B, or
for each Axβ , it is true that Bxβ .
2. If A is a subset of B, then B is sometimes called a
superset of A.
3. If A and B are sets, then to prove BA β , we need
to prove BxAxx ββββ ,
4. If A is a proper subset of B, there must be at least
one element in B that is not in A.
5. If A and B are sets, to prove A is not a subset of B,
denoted BAβ , we need to prove )(~ BA β :
)(,)(~,
)(~,),(~
BxAxxBxAxx
BxAxxBxAxx
ββ§βββ‘ββ¨βββ‘βββββ‘ββββ
6. The following relationships hold in the number
system: βββββ
![Page 140: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/140.jpg)
WUCT121 Logic 140
4.4.3. The null set as a subset.
For any set A in a Universe U, Aββ
Proof:
Suppose )(~ Aββ . Then, there exists ββx such that
Ax β . This, therefore, means that β is not empty, which is
a contradiction. Therefore, Aββ .
4.4.4. Distinction between elements and subsets
Examples:
β’ }3,2,1{2β , }3,2,1{2β
β’ }3,2,1{}2{ β , }3,2,1{}2{ β
β’ }1:{1 2 =ββ xx , }1:{}1{ 2 =ββ xx
Exercises:
Let S be a set in a Universe U. Determine whether the
following are true or false.
β’ SS β
False
β’ }{SS β
True
β’ }{SS β
False
β’ }{Sββ
True
![Page 141: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/141.jpg)
WUCT121 Logic 141
β’ }{Sββ
False
β’ }{}{ Sββ
False
4.5. Set Equality
4.5.1. Definition: Set Equality.
If A and B are sets, then A equals B, written BA = , if and
only if, every element in A is also in B and every element in
B is also in A.
Equivalently, BA = if, and only if BA β and AB β .
Note: To prove that two sets are equal two things must be
shown:: BA β and AB β .
Examples:
β’ The Venn diagram demonstrating BA = is:
![Page 142: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/142.jpg)
WUCT121 Logic 142
Exercises:
β’ Write the definition of set equality using logic
notation.
),(),(
ABBAUxAxBxBxAxUxBA
ββ§ββββββββ§ββββββ=
4.5.2. Axiom of Extent.
If A and B are sets then ),( BxAxUxBA ββββββ= .
The Axiom of Extent says that a set is completely
determined by its elements, the order in which the elements
are listed is irrelevant, as is the fact that some members
may be listed more than once.
Examples:
β’ }2,1{}2,1{ =
β’ },,{},,{ abccba =
Exercises:
β’ Is },,,{},,,{ cadbdcba = Yes
β’ Is }CalAnn,Cal,Bob,{}CalBob,Ann,{ = Yes
![Page 143: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/143.jpg)
WUCT121 Logic 143
4.5.3. Theorem: Equality by Specification
Let U be a universe and let ( )xP be a statement.
If ))()((, xQxPUx βββ , that is ))()((, xQxPUx β‘ββ
then )}(:{)}(:{ xQUxxPUx β=β
The Theorem states that subsets of the same universe U
which are defined by equivalent statements are equal sets.
This theorem allows the use of tautologies of logic to prove
set theoretic statements, as will be outlined later.
Example:
β’ We know that ( )1112 β=β¨=β= xxx .
Therefore
( ) { }1,1}11{}1:{ 2 β=β=β¨===β xxxx
β’ If Uaaaa n βK,,, 321 , then we can write
{ }{ }n
naaaa
axaxaxUxAK
K
,,,:
321
21=
=β¨β¨=β¨=β=
In other words, if we know the elements of a set, we know
the set.
β’ { } { }3,2,1321: ==β¨=β¨=β= xxxxA
![Page 144: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/144.jpg)
WUCT121 Logic 144
Exercise:
β’ Are the following sets equal? Using logic, can you
prove your answer?
}3,2,1{},1,2,3{},2,1,3,1{ Yes
}3,2,1{}321:{}231:{
}2311:{}2131:{}2,1,3,1{
==β¨=β¨=β==β¨=β¨=β=
=β¨=β¨=β¨=β==β¨=β¨=β¨=β=
xxxxxxxx
xxxxxxxxxx
β’ Are the following two sets equal? Give reasons.
{ }even is : nnE :β= and even} is :{ 2nnT :β= .
Yes, previously is has been proven that
even is even is 2nn β , thus by equivalence of statements,
the two sets are equal.
![Page 145: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/145.jpg)
WUCT121 Logic 145
4.6. Power Sets
4.6.1. Definition: Power Set
If X is any set, then }:{ XAA β is the power set of X.
The power set of X is often written as )( X .
So }:{)( XAAX β= .
A power set is a set whose elements are sets.
If the elements of X are in a universe U, those of )( X are
in a universe )(U .
Examples:
β’ Let }1{=X and let S be the set of all subsets of X.
Write down the set S by listing its elements.
}:{ XAAS β= .
}1{ββ and }1{}1{ β .
Thus }}1{,{β=S
β’ Let }2,1{=X and }:{ XAAS β= . Write down the
set S by listing its elements.
}2,1{ββ , }2,1{}1{ β , }2,1{}2{ β , and }2,1{}2,1{ β . Thus
}}2,1{},2{},1{,{β=S
![Page 146: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/146.jpg)
WUCT121 Logic 146
Exercises:
β’ Let }3,2,1{=X .
o Write down the set )( X by listing its elements.
}}3,2,1{},3,2{},3,1{},2,1{},3{},2{},1{,{)( β=X
o How many elements are there in )( X ? 8
o Is )( Xββ ? Yes
o Is )( Xββ ? Yes
o Is )(1 Xβ ? No
o Is )(}1{ Xβ ? Yes
o Is )(}2{ Xβ ? No
o Is )(}}2,1{{ Xβ ? Yes
![Page 147: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/147.jpg)
WUCT121 Logic 147
4.7. Hasse Diagrams
The elements of )( X can be represented by diagrams
using the following procedure:
1. An upward directed line between two sets indicates
that the βlowerβ set is a subset of the βupperβ set.
2. β is at the bottom and X is at the top.
3. Each pair of sets is joined by an upward directed
line to the βsmallestβ set which contains each as a subset.
4. Each pair of sets is joined by a downward directed
line to the βlargestβ set which is a subset of each.
Example:
Let }2,1{=X , thus }}2,1{},2{},1{,{)( β=X and the
Hasse diagram is given by:
{1, 2}
ΓΈ
{2} {1}
![Page 148: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/148.jpg)
WUCT121 Logic 148
4.8. Set Operations
There are five main set theoretic operations, one
corresponding to each of the logical connectives.
Set Operation Name Logical
Connective
Name
A Complement P~ Negation
BAβͺ Union QP β¨ Disjunction
BA β© Intersection QP β§ Conjunction
BA β Subset QP β Conditional
BA = Equality QP β
QP β‘
Biconditional
Equivalence
The set operations can be defined in terms of the
corresponding logical operations. This means that each of
the tautologies proved by truth tables for the logical
connectives will have a corresponding theorem in set
theory.
![Page 149: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/149.jpg)
WUCT121 Logic 149
We have seen how the logical conditional operator, QP β
is related to subset, BA β and how the logical
biconditional operator, QP β (or equivalence, QP β‘ ) is
related to set equality, BA = .
The following sections will cover the three remaining set
operations: complement, union and intersection.
In our discussion of set theory, we will let U be a fixed set
and all other sets, whether denoted A, B, C, etc, will be
subsets of U. In other words, )(,, UCBA β . Thus, each
result should start with a statement similar to βLet A, B, C
be subsets of a universal set Uβ or βLet )(,, UCBA β β.
4.8.1. Definition: Compliment
Let U be a universal set, and let UA β . Then the
complement of A, denoted by A, is given by
( ){ } { }AxUxAxUxA ββ=ββ= :~: .
Notes.
1. AU \ , Aβ² and cA are also used for A in some
books.
![Page 150: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/150.jpg)
WUCT121 Logic 150
2. If the set U is fixed in a discussion, then A is
sometimes written as { }AxxA β= :
Example:
β’ The shaded area in the following Venn diagram
depicts A:
Exercises:
Let =U . Write down A for the following sets:
β’ { }3,2,1=A
{ }321: β β§β β§β β= xxxxA
β’ { }evenis: xxA β=
{ }oddis: xxA β=
β’ { }00: <β¨>β= xxxA
{ }0=A
![Page 151: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/151.jpg)
WUCT121 Logic 151
4.8.2. Definition: Union
Let A and B be subsets of a universe U. Then the union of
A and B, denoted by BA βͺ , is given by
{ }BxAxUxBA ββ¨ββ=βͺ : .
Example:
β’ The shaded area in the following Venn diagram
depicts BA βͺ :
Exercises:
β’ Let =U . Write down BA βͺ for the following sets:
o { }1=A and { }2=B .
{ }2,1=βͺ BA
o A is the set of all even integers, B is the set of all odd
integers.
=βͺ BA .
![Page 152: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/152.jpg)
WUCT121 Logic 152
o { }20: β€β€β= xxA and { }31: β€β€β= xxB
[ ]3,0}30:{ =β€β€β=βͺ xxBA
β’ If UA β and UB β , is it true that UBA ββͺ ?
Yes.
UxUxUxBxAxBAx
ββββ¨ββββ¨βββͺβ
4.8.3. Definition: Intersection
Let A and B be subsets of a universe U. Then the
intersection of A and B, denoted by BAβ© , is given by
{ }BxAxUxBA ββ§ββ=β© : .
Example:
β’ The shaded area in the following Venn diagram
depicts BAβ© :
![Page 153: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/153.jpg)
WUCT121 Logic 153
Exercises:
β’ Let =U . Write down BAβ© for the following sets:
o { }5,3,2,1=A and { }6,5,4,1=B .
{ }5,1=β© BA .
o A is the set of all even integers, B is the set of all odd
integers.
=β© BA .
o { }20: β€β€β= xxA and { }31: β€β€β= xxB
[ ]2,1}21:{ =β€β€β=β© xxBA
β’ If UA β and UB β , is it true that UBA ββ© ?
Yes.
UxUxUxBxAxBAx
ββββ§ββββ§βββ©β
4.8.4. Definition: Difference
Let A and B be subsets of a universe U. Then the
difference of A and B, denoted by BA β , is given by
{ }BxAxUxBA ββ§ββ=β : .
![Page 154: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/154.jpg)
WUCT121 Logic 154
Example:
β’ The shaded area in the following Venn diagram
depicts BA β :
Notes.
1. The difference of BAβ is sometimes called the
relative complement of B in A.
2. If we let UA = , then we have
{ }{ }B
BxUx
BxUxUxBU
=
ββ=
ββ§ββ=β
:
:
3. Using Definitions for complement and intersection, we
can simplify the definition of difference as follows:
{ }{ }
BA
BxAxUx
BxAxUxBA
β©=
ββ§ββ=
ββ§ββ=β
:
:
![Page 155: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/155.jpg)
WUCT121 Logic 155
Exercises:
β’ Let =U . Write down BA β for the following sets:
o { }5,3,2,1=A and { }6,5,4,1=B .
{ }3,2=β BA .
o A is the set of all even integers, B is the set of all odd
integers. ABA =β .
o { }20: β€β€β= xxA and { }31: β€β€β= xxB
)1,0[}10:{ =<β€β=β xxBA
β’ If UA β and UB β , is it true that UBA ββ ?
Yes.
UxUxUxBxAxBAx
ββββ§ββββ§ββββ
β’ Let =U , { }3,2,1=A , { }2=B , { }4,3,2=C and
[ ] { }10:1,0 β€β€β== xxD .Write down:
o { }1=β CA
o =β CB
o DBD =β
o { }10: <β€β=β xxAD
o { }3,2=β DA
![Page 156: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/156.jpg)
WUCT121 Logic 156
4.8.5. Definition: Disjoint sets
Let A and B be subsets of a universe U. Then A and B are
said to be disjoint if =β© BA .
Example:
β’ The following Venn diagram depicts disjoint sets A
and B:
Note. Disjoint sets have no elements in common.
Exercises:
β’ Let =U , { }3,2,1=A , { }2=B , { }4,3,2=C and
[ ] { }10:1,0 β€β€β== xxD . Which pairs of sets from A,
B, C, D are disjoint?
B and D are disjoint, as are C and D.
![Page 157: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/157.jpg)
WUCT121 Logic 157
4.9. Order of Operations for Set Operators.
The order of operation for set operators is as follows:
1. Evaluate complement first
2. Evaluate βͺ and β© second. When both are present,
parenthesis may be needed, otherwise work left to right.
3. Evaluate β and = third. When both are present,
parenthesis may be needed, otherwise work left to right.
Note: Use of parenthesis will determine order of operations
which over ride the above order.
Examples: Indicate the order of operations in the following:
β’ {{BA21β©
β’ {321
21
)( BAβ©
β’ {{ { )(231
CBA βͺβ©
β’ {{ {CBA231β©β
![Page 158: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/158.jpg)
WUCT121 Logic 158
Exercises:
Indicate the order of operations in the following:
β’ {{ {CBA321
)( β©β
β’ {321
21
)( BAβͺ
β’ {{ {CBA231βͺβ
β’ {{ {CBA231β©=
Notes.
1. βͺ and β© are operations on sets, thus βͺ and β© can
only be put between two sets.
2. β¨ and β§ are operations on statements, thus β¨ and β§
can only be placed between statements.
Example:
β’ If A, B, and C are sets then CACBBA ββββ§β )(
is interpreted as )())()(( CACBBA ββββ§β
β’ ))(()( CBBACBBA ββ§ββ‘/ββ§β
![Page 159: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/159.jpg)
WUCT121 Logic 159
4.10. Set Laws
Let A, B, and C be subsets of a universal set U. That is
)(,, UCBA β . Then for all sets A, B, and C following set
laws hold:
1. Commutative Laws:
)()()()()()(
ABBAABBAABBA
===β’β©=β©β’βͺ=βͺβ’
2. Associative Laws:
( ) ( )( ) ( )( ) ( ))()(
)()()()(
CBACBACBACBACBACBA
=====β’β©β©=β©β©β’βͺβͺ=βͺβͺβ’
3. Distributive Laws:
( ) ( )( ) ( ))()()(
)()()(CABACBACABACBA
β©βͺβ©=βͺβ©β’βͺβ©βͺ=β©βͺβ’
4. Double Complement (Involution) Law:
AA =β’ )(
5. De Morganβs Laws:
)()(
)()(
BABA
BABA
βͺ=β©β’
β©=βͺβ’
![Page 160: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/160.jpg)
WUCT121 Logic 160
6. Identity Laws:
AUAAA
=β©β’=βͺβ’
)()(
7. Negation (Complement) Laws:
U
U
AA
UAA
=β’
=β’
=β©β’
=βͺβ’
)(
)(
8. Dominance Laws:
=β©β’=βͺβ’
)()(
AUUA
9. Idempotent Laws:
AAAAAA
=β©β’=βͺβ’
)()(
10. Absorption Laws:
ABAAABAA
=β©βͺβ’=βͺβ©β’
)()(
11. Set Difference
BABA β©=ββ’
![Page 161: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/161.jpg)
WUCT121 Logic 161
12. Subset properties of βͺ and β©
( ) ( )( ) ( ))()()(
)()()(CBCACBACABACBA
ββ§ββββͺβ’ββ§βββ©ββ’
13. Subset property inclusion of intersection
BBAABA
ββ©β’ββ©β’
14. Subset property inclusion in union
BABBAA
βͺββ’βͺββ’
15. Transitive Property.
)())()(()())()((
CACBBACACBBA
=β=β§=β’ββββ§ββ’
![Page 162: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/162.jpg)
WUCT121 Logic 162
4.11. Proving and Disproving Set Statements.
4.11.1. Proof by Exhaustion
To prove set results for finite sets, the method of
exhaustion is used. That is every element in the set is tested
to ensure it satisfies the condition.
Example:
β’ Let }2,1{=A , }4,3,2,1{=B . Prove BAA βͺβ .
To prove the statement, we must show every element in A
is in BAβͺ .
Now }4,3,2,1{=βͺ BA
BAABAA
βͺβββͺββ
2,21,1
Thus all elements in A are in BAβͺ , and so by exhaustion
BAA βͺβ .
![Page 163: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/163.jpg)
WUCT121 Logic 163
Exercise:
β’ Let }2,1{=A , }4,3,2,1{=B . Prove BAA β©= .
To prove the statement, we must show every element in A
is in BAβ© and every element in BAβ© is in A.
Now }2,1{=β© BA
BAABAA
β©βββ©ββ
2and21and1
Thus all elements in A are in BAβ© and vice versa, and so
by exhaustion BAA β©= .
Exercise:
β’ Give an example of three sets A, B and C such that
BAC β©β .
Let }2,1{=A , }4,3,2,1{=B , }1{=C .
To prove BAC β©β , we must show every element in C is
in BAβ© .
Now }2,1{=β© BA
BAC β©ββ 1and1
Thus all elements in C are in BAβ© and so, for the given
sets A, B and C, BAC β©β .
![Page 164: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/164.jpg)
WUCT121 Logic 164
4.11.2. Disproof by Counterexample.
A set result can be disproven by giving a counterexample.
To find a counterexample often creating a Venn diagram
will be of benefit.
Example:
β’ Disprove BAA β©β .
To disprove the statement, we must give a counterexample.
Let }2,1{=A , }4,3{=B
Now =β© BA
,1 Aβ however =β©β BA1
Thus by counterexample BAA β©β .
Exercise:
β’ Disprove BAA ββ .
To disprove the statement, we must show a
counterexample.
Let }2,1{=A , }4,3,2,1{=B . Now =β BA
,1 Aβ however =ββ BA1
Thus by counterexample BAA ββ .
![Page 165: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/165.jpg)
WUCT121 Logic 165
4.11.3. Proof by Typical Element.
To prove set results for infinite sets, generalised methods
must be used. The typical element method considers a
particular but arbitrary element of the set and by applying
knows laws, rules and definitions prove the result.
It is the method for proving subset relationships.
So prove that BA β , we must show that
)(, BxAxx ββββ
Begin by letting Axβ , that is, we take x to be a particular
but arbitrary element of A. Using the definitions, we prove
that Bxβ . As long as we use no special properties of the
element x, we can conclude that )(U , which is what we
wanted to prove.
This method can be used to prove set equalities. By using
the definition )( ABBABA ββ§ββ= and showing
ABBA ββ§β , that is proving )(, BxAxx ββββ and
)(, AxBxx ββββ , the result BA = follows. Using this
definition is sometimes called a βdouble containmentβ
proof.
![Page 166: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/166.jpg)
WUCT121 Logic 166
Examples:
β’ Let U be a set and let A and B be elements of )(U .
Prove BAA βͺβ .
Need to prove )(, BAxAxx βͺββββ
Let Axβ , then
BAABAx
BxAxAx
βͺββ΄βͺβͺβ
ββ¨ββββ
ofdefinitionnotesee
Note: Appling rules of logic, we know QPP β¨β is a
tautology. Let BxxQAxxP ββ :)(,:)( . Thus
BxAxAx ββ¨βββ is a tautology in the proof above.
β’ Let U be a set and let A and B be elements of )(U .
Prove BBABA =βͺββ .
Need to prove two parts:
1. BBABA =βͺββ
2. BABBA ββ=βͺ
![Page 167: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/167.jpg)
WUCT121 Logic 167
β’ Proof of 1:
KNOW: BA β , that is )1()(, KBxAxx ββββ
PROVE: BBA =βͺ .
Need to prove two parts:
i. BBA ββͺ
ii. BAB βͺβ
Proof of i.:
Let BAx βͺβ then
BBAPPPBxBx
BxBxBxAxBAx
ββͺβ΄β‘β¨
βͺ
ββ¨βββ¨βββ¨β
ββββͺβ
ruleLogic(1)by
ofdefinition
Proof of ii.:
Let Bxβ then
BABBAx
BxAxBx
βͺββ΄βͺβͺβ
ββ¨ββββ
ofdefinitionexampleprevioussee
Since BBA ββͺ and BAB βͺβ , BBA =βͺ
Thus BBABA =βͺββ .
![Page 168: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/168.jpg)
WUCT121 Logic 168
Proof of 2:
KNOW: BBA =βͺ , that is )2()(, KBxBAxx βββͺββ
PROVE: BA β .
Let Axβ then
BABx
BAxBxAxAx
ββ΄
βͺβ
βͺβββ¨β
ββββ
(2)byofdefinition
exampleprevioussee
Thus BABBA ββ=βͺ
Since BBABA =βͺββ and BABBA ββ=βͺ it is
proven that BBABA =βͺββ .
Exercise:
β’ Let U be a set and let A and B be elements of )(U .
Prove ABA ββ© .
that is, prove )(, AxBAxx βββ©ββ
Let BAx β©β , then
ABAAx
BxAxBAx
ββ©β΄
β©β
ββ§ββββ©β ofdefinition
![Page 169: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/169.jpg)
WUCT121 Logic 169
4.11.4. Proof by Equivalence of Statements.
If A can be written as )}(:{ xPUxA β= and
)}(:{ xQUxB β= , the equality of specification theorem to
show that BA = by showing that )()( xQxP β‘ , that is, by
showing that )()( xQxP β is a tautology.
Examples:
β’ Let }1:{ 2 β€β= xxA and }11:{ β€β€ββ= xxB .
Prove BA =
Let 1:)( 2 β€xxP and 11:)( β€β€β xxQ . Now
BAxQxP
xx
=β΄ββ΄
β€β€βββ€)()(
1112
β’ Let U be a set and let A and B be elements of )(U .
Prove that ( ) BABA βͺ=β© .
We need to show that the statements defining the sets
( )BAβ© and BAβͺ are equivalent.
( ) ABAxUxBA ofdefinition)}(:~{ β©ββ=β©
}:{ BAxUxBA βͺββ=βͺ
![Page 170: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/170.jpg)
WUCT121 Logic 170
Let )(:~)( BAxxP β©β , and BAxxQ βͺβ:)(
( ) ( )( )( )
( ) BABA
xPxQBAx
BxAxABxAx
BxAxBAx
βͺ=β©β΄
β‘β΄β©β©ββ‘
ββ§ββ‘ββ¨ββ‘
βͺββ¨ββ‘βͺβ
)()( of definitionby ~
sMorgan' Deby Logic~ofdefinition~~ of definitionby
Exercise:
β’ Let U be a set and let A and B be elements of )(U .
Prove that ( ) BABA β©=βͺ .
We need to show that the statements defining the sets
( )BAβͺ and BAβ© are equivalent.
( ) ionspecificat ofaxiom )}(:~{ BAxUxBA βͺββ=βͺionspecificat ofaxiom }:{ BAxUxBA β©ββ=β©
Let )(:~)( BAxxP βͺβ , and BAxxQ β©β:)(
( ) ( )( )( )
( ) BABA
xPxQBAx
BxAxABxAx
BxAxBAx
β©=βͺβ΄
β‘β΄β©βͺββ‘
ββ¨ββ‘ββ§ββ‘
β©ββ§ββ‘β©β
)()( of definitionby ~
sMorgan' Deby Logic~ofdefinition~~ of definitionby
![Page 171: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/171.jpg)
WUCT121 Logic 171
β’ Let U be a set and let A, B and C be elements of P(U).
Prove that ( ) ( ) BCACBA ββ=ββ .
Let CBAxxP βββ )(:)( , and BCAxxQ βββ )(:)(
( ) ( )( )
( )( )
( )( )
( )
( ) ( ) BCACBAxQxP
BCAxBxCAx
BxCxAxBxCxAxCxBxAx
CxBxAxCxBAxCBAx
ββ=βββ΄ββ΄
ββββββ§βββ
ββ§ββ§ββββ§ββ§ββββ§ββ§ββββ§ββ§ββ
ββ§ββββββ
)()(
β’ Let U be a set and let X and Y be elements of )(U .
Prove that YXYX β©=β .
Let YXxxP ββ:)( , and YXxxQ β©β:)(
YXYXxQxP
YXxYxXxYxXxYXx
β©=ββ΄
β‘β΄β©ββ‘
ββ§ββ‘
ββ§ββ‘ββ
)()(onintersecti of Definition
complement of Definitiondifferenceset of Definition
![Page 172: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/172.jpg)
WUCT121 Logic 172
4.11.5. Proof by Set Laws.
Set equalities can be proven by using known set laws
Examples:
β’ Let U be a set and let A, B and C be elements of P(U).
Prove ( ) ( ) BCACBA ββ=ββ
( ) ( )( )
( )( )
( )( )( ) differenceset
differenceset
ityassociativ
itycommutativ
ityassociativ
differenceset
differenceset
BCABCA
BCA
BCA
CBA
CBA
CBACBA
ββ=β©β=
β©β©=
β©β©=
β©β©=
β©β©=
β©β=ββ
![Page 173: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/173.jpg)
WUCT121 Logic 173
4.11.6. Further Examples.
Examples:
β’ Let U be a set and let A, B and B be elements of P(U).
Using the following:
(i) BBABA =βͺββ ,
(ii): ABABA =β©ββ ,
(iii): ( )BABA β©=βͺ .
Prove that ABBA βββ .
Proof:
( )
(i)by part
(iii)by part
scomplement by taking
(ii)by part
AB
ABA
ABA
ABABA
ββ
=βͺβ
=β©β
=β©ββ
β’ Let U be a set and let A, B and C be elements of P(U).
Disprove that ( ) ( ) CBACBA ββ=ββ .
Let { }3,2,1=A , { }3,2=B , { }3=C .
( ) { } { }3,12 =β=ββ ACBA
( ) { } { } ( )CBACCBA βββ =β=ββ 11
![Page 174: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/174.jpg)
WUCT121 Logic 174
β’ Let U be a set and let X and Y be elements of )(U .
Use a typical element argument to prove YXYX β©=β .
Need to prove two parts:
1. YXYX β©ββ
2. YXYX βββ©
Proof of 1:Let YXx ββ be a typical element.
{ }{ }{ }{ } onintersecti of Def:
complement of Def:differenceset of Def:
ionSpecificat of Axiom:
YXxUxYxXxUxYxXxUx
YXxUxYX
β©βββ
ββ§βββ
ββ§βββ
ββββ‘β
( )YXYX
YXxYXxUxβ©βββ΄
β©βββββββ΄
Proof 2: Let YXx β©β be a typical element.
{ }{ }{ }{ } differenceset of Def:
complement of Def:onintersecti of Def:
ionSpecificat of Axiom:
YXxUxYxXxUxYxXxUx
YXxUxYX
ββββ
ββ§βββ
ββ§βββ
β©βββ‘β©
( )YXYX
YXxYXxUxβββ©β΄
ββββ©ββββ΄
( )
extent ofAxiom ,..
,
YXYXYXYXYXYXei
YXxYXxUx
β©=ββ΄
βββ©β§β©ββ
β©βββββββ΄
![Page 175: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/175.jpg)
WUCT121 Logic 175
Section 5. Relations and Functions
5.1. Cartesian Product
5.1.1. Definition: Ordered Pair
Let A and B be sets and let Aa β and Bbβ .
An ordered pair ),( ba is a pair of elements with the
property that:
)()(),(),( dbcadcba =β§=β= .
Notes:
β A pair set },{ ba is NOT an ordered pair, since
},{},{ abba = .
β It should be clear from the context when ),( ba is an
ordered pair, and when }:{),( bxaxba <<β= is an
open interval of real numbers.
![Page 176: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/176.jpg)
WUCT121 Logic 176
Examples:
β’ Points in the plane 2 are represented as ordered
pairs.
x
y
-4 -3 -2 -1 0 1 2 3 4
-3
-2
-1
1
2
3
(1, 2)
(2, 1)
(-1, -2)
(-2, -1)
From the graph it can be seen )1,2()2,1( β and
)1,2()2,1( βββ ββ .
β’ Complex numbers iba + where 1β=i and βba, ,
are ordered pairs in the sense that,
)()( dbcaidciba =β§=β+=+ .
![Page 177: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/177.jpg)
WUCT121 Logic 177
5.1.2. Definition: Cartesian Product
Let A and B be sets, then the Cartesian Product of A and B,
denoted BAΓ , is defined by
( ){ }BbAabaBA ββ§β=Γ :, .
Example:
β’ }::),{( ββ§β=Γ yxyx .
Sketch a graph of Γ , otherwise known as 2 . 2 is the usual Cartesian plane with the usual graph.
x
y
-6 -4 -2 0 2 4 6
-4
-2
2
4
![Page 178: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/178.jpg)
WUCT121 Logic 178
Exercises:
β’ Let }3{=A and }3,2{=B . Write down BAΓ . Sketch
a graph of BAΓ in 2 .
)}3,3(),2,3{(=ΓBA
x
y
-6 -4 -2 0 2 4 6
-6
-4
-2
2
4
6
(3, 2)
(3, 3)
β’ Let }11:{ β€β€ββ= xxC and }2,1{=D . Write
down DC Γ . Sketch a graph of DC Γ in 2 .
)}2,1(11:),{( ββ§β€β€β=Γ yxyxDC
x
y
-4 -3 -2 -1 0 1 2 3 4
-4
-2
2
4
![Page 179: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/179.jpg)
WUCT121 Logic 179
5.2. Relations
5.2.1. Definition: Binary Relation
Let A and B be sets. We say that R is a (binary) relation
from A to B if BAR Γβ .
Notes:
β If AAR Γβ , we say that R is a relation on A.
β If Rba β),( , we will frequently write aRb and say
that βa is in the relation R to bβ.
β Every relation is a subset of a Cartesian product
Examples:
β’ Let A be the set of all male human beings and let B be
the set of all human beings. The relation T from A to B is
given by ( ){ }yxyxT offather theis :,= .
β’ ( ) ( ) ( ){ }Ο,5,1,2,2,1=W .
Note: W cannot be defined by a βruleβ. Sometimes relations
are simply defined by a listing of elements.
![Page 180: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/180.jpg)
WUCT121 Logic 180
β’ Let R be the relation on , defined by
}1:),{( 22 =+= yxyxR . Sketch the graph of R in 2
x
y
-2 -1 0 1 2
Exercise:
β’ Let S be the relation on , defined by
}44:),{( =+= yxyxS . Sketch the graph of S in 2
x
y
-2 -1 0 1 2
2
4
![Page 181: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/181.jpg)
WUCT121 Logic 181
Example:
Consider the relation R on given by ( ){ }yxyxR == :,
β’ Sketch the graph of R in 2
x
y
-4 -3 -2 -1 0 1 2 3 4
-4
-2
2
4
β’ Are the following true or false?
o 1R1 True
o 1R2.2 False
o Rββ )3,3( False
β’ If aR100, what is the value of a? 100
Note. The relation R in this example is called the identity
relation on and is usually written ( ){ }β= xxxR :, .
![Page 182: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/182.jpg)
WUCT121 Logic 182
Exercises:
β’ Let { }3,2,1,0=X , and let the relation R on X be
given by ( ){ }yzxzyxR =+ββ= ,:, .
o What is an easier way of expressing the relation R?
( ){ }yxXyxyxR <β§β= ,:,
o List all the elements of R.
( ) ( ) ( ) ( ) ( ) ( ){ }3,2,3,1,2,1,3,0,2,0,1,0=R
o Sketch XX Γ , and circle the elements of R.
x
y
0 1 2 3 4
2
β’ Let S be the relation on { }0β given by
( ){ }yxzzyxS =ββ= ,:,
o Describe the relation S.
x is a factor of y, or yx | .
![Page 183: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/183.jpg)
WUCT121 Logic 183
o Are the following true or false?
( ) S4,2 ββ True, since 4|2 β .
0S3β False, since { }00 ββ .
( ) S5,3 β False, since 3F5.
β’ Let R be the relation on given by
( ) }:,{ 2xyyxR == and let S be the relation on given
by ( ) }:,{ 2xyyxS == .
o Sketch each relation. What difference does the
inputβ set make to the elements in each relation.
x
y
-4 -3 -2 -1 0 1 2 3 4
2
4
6
8
R is a set of isolated points.
![Page 184: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/184.jpg)
WUCT121 Logic 184
x
y
-3 -2 -1 0 1 2 3
-1
1
2
3
S is a continuous curve.
Note. Care must be taken when writing relations. As can be
seen from this example, it must be very clear the sets a
relation is from and to.
β’ Let { }1,0=A and { }1,0,1β=B . Let two relations
from A to B be given by ( ) ( ) ( ){ }0,1,1,1,1,01 ββ=R , and
)}1,1(),1,1(),0,0{(2 β=R .
Determine:
o ( ){ }1,1RR 21 β=β© .
o ( ) ( ) ( ) ( ) ( ){ }1,1,0,1,1,1,0,0,1,0RR 21 ββ=βͺ
![Page 185: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/185.jpg)
WUCT121 Logic 185
β’ Let 3R and 4R be relations on defined by
( ){ }yxyxR == :,3 , and ( ){ }yxyxR β== :,4 .
Determine:
o
( ){ }( ){ }( ){ }yxyx
yxyxyxyxyxRR
==
Β±==β=β¨==βͺ
:,:,:,43
o ( ){ }0,043 =β© RR
![Page 186: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/186.jpg)
WUCT121 Logic 186
5.2.2. Definition: Domain
Let R be a relation from A to B.
Then the domain of R, denoted Dom R, is given by
{ }xRyyxR ,:Dom β= .
Notes:
β Let R be a relation from A to B, then AR βDom .
β Dom R is the set of all first elements in the ordered
pairs that belong to R.
5.2.3. Definition: Range
Let R be a relation from A to B.
Then the range of R, denoted Range R, is given by
{ }xRyxyR ,: Range β= .
Notes:
β Let R be a relation from A to B, then BR β Range .
β Range R is the set of all second elements in the
ordered pairs that belong to R.
![Page 187: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/187.jpg)
WUCT121 Logic 187
Examples:
β’ Let { }3,2,1,0=A and let 1R be the relation on A
given by { })0,3(),2,0(),1,0(),0,0( 1 =R .
Determine:
o { }3,0Dom 1 =R
o { }2,1,0 Range 1 =R
Exercises:
β’ Let 2R be the relation on given by
( ){ }0:,2 β = xyyxR .
Determine:
o { }0Dom 2 β= R
o { }0 Range 2 β= R .
β’ Let 3R be the relation from to given by
( ){ }x
yxyxR 13 0:, =β§β = .
Determine:
o { }0Dom 3 β= R
o { }0: Range 13 β β§β= nnR
n
![Page 188: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/188.jpg)
WUCT121 Logic 188
5.2.4. Definition: Inverse Relations
Let R be a relation from A to B. The inverse relation,
denoted 1βR , from B to A is defined as
( ) ( ){ }R,:,1 β=β yxxyR .
Notes:
β For a relation R from A to B, the inverse relation 1βR can be defined by interchanging the elements of all the
ordered pairs of R. This turns out to be easier for a finite
(listed) relation than an infinite (given by formula) relation.
β BRR β=β RangeDom 1 and
ARR β=β Dom Range 1 .
Examples:
β’ Define a relation R on as ( ){ }xyyxR 2:, == .
o Write down 3 elements of R.
( ) ( ) ( )6,3,4,2,2,1
o Write down 3 elements of 1βR
( ) ( ) ( )3,6,2,4,1,2
![Page 189: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/189.jpg)
WUCT121 Logic 189
o Sketch a graph of R and 1βR on coordinate axis,
circle elements of 1βR .
x
y
-1 0 1 2 3 4 5 6 7
-1
1
2
3
4
5
6
o Write down a simple definition for 1βR .
( ){ }( ){ }( ){ }xyyx
yxyxxyxyR
21
1
:,
2:,2:,
==
====β
Exercise:
β’ Let S be the identity relation on the set of reals. What
is 1βS ?
( ){ }β= xxxS :,
( ){ }S
xxxS=
β=β :,1
![Page 190: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/190.jpg)
WUCT121 Logic 190
5.2.5. Directed Graph of a Relation
When a relation R is defined on a set A, we can represent it
with a directed graph. This is a graph in which an arrow is
drawn from each point in A to each related point.
Ayx ββ , , there is an arrow from x to y yxRβ ,
( ) Ryx ββ ,
If a point is related to itself, a loop is drawn that extends
out from the point and goes back to it.
Example:
β’ Let { }3,2,1,0=A and let 1R be the relation on A
given by { })0,3(),2,0(),1,0(),0,0( 1 =R . Draw the directed
graph of 1 R .
0
3
2
1
![Page 191: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/191.jpg)
WUCT121 Logic 191
Exercise:
β’ Let { }3,2,1,0=A and let 2R be the relation on A
given by { })2,2(),2,1(),0,0( 2 =R .
Draw the directed graph of 2R .
0
1
2
![Page 192: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/192.jpg)
WUCT121 Logic 192
5.2.6. Properties of Relations
Let R be a relation on the set A.
Reflexivity:
R is reflexive on A if and only if ( ) RxxAx βββ ,, .
Example:
β’ Let 1R be the relation on defined by
( ){ }yxyxR offactor a is :,1 = .
For each βx , we know that x is a factor of itself. Thus,
( ) 1, Rxx β , and so 1R is reflexive
Symmetry:
R is symmetric on A if and only if
( ) ( )( )RxyRyxAyx βββββ ,,,, .
Example:
β’ Let 2R be the identity relation on .
For βyx, , if yx = , then xy = , that is, if ( ) 2, Ryx β ,
then ( ) 2, Rxy β and so 2R is symmetric
![Page 193: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/193.jpg)
WUCT121 Logic 193
Transitivity:
R is transitive on A if and only if
( ) ( )( ) ( )( )RzxRzyRyxAzyx ββββ§βββ ,,,,,, .
Example:
β’ Let 3R be the relation on defined by
( ){ }yxyxR <= :,3 .
For βzyx ,, , if yx < and zy < , then zx < , that is, if
( ) 3, Ryx β and ( ) 3, Rzy β , then ( ) 3, Rzx β and so 3R is
transitive.
Notes:
β A relation R on a set A is reflexive if each element
in A is in relation to itself.
β A relation R on a set A is symmetric if you can
βswapβ the ordered pairs around and still get elements of R.
β A relation R on a set A is transitive if pairs of
elements are βrelated viaβ a third element (x and z related
via y).
![Page 194: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/194.jpg)
WUCT121 Logic 194
Exercises:
Which of the three properties do the following relations
satisfy? Give reasons why or why not.
β’ 1R on , given by ( ){ }yxyxR |:,1 = .
1),(.|, Rxxxxx ββ΄ββ Thus 1R is reflexive.
Consider 1)4,2( Rβ , since 4|2 , however 1)2,4( Rβ , as
4 F 2, so 1R is not symmetric.
.|||,,, zxzyyxzyx ββ§ββ
111 ),(),(),( RzxRzyRyx βββ΄ββ΄β§ββ΄ , thus 1R is
transitive.
β’ 2R , the identity relation on
Reflexive: Yes
Symmetric: Yes
Transitive: Yes
β’ 3R on given by ( ){ }yxyxR <= :,3
Reflexive: No
Symmetric: No
Transitive: Yes
![Page 195: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/195.jpg)
WUCT121 Logic 195
β’ 4R on given by }:),{( 24 xyyxR ==
Reflexive: No
Symmetric: No
Transitive: No
β’ 5R on A where A is the set of all people.
( ){ }yxyxR offamily in the is :,5 =
Reflexive: Yes
Symmetric: Yes
Transitive: Yes
β’ 6R on A where A is the set of all people.
( ){ }yxyxR loves :,6 =
Reflexive: ?
Symmetric: ?
Transitive: ?
![Page 196: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/196.jpg)
WUCT121 Logic 196
5.2.7. Definition: Equivalence Relation
Let R be a relation on the set A. R is an equivalence relation
on A if and only if R is reflexive, symmetric and transitive
on A.
Example:
From the previous exercises, 2R and 5R are equivalence
relations.
Notes:
β If R is a relation on a set A, you must be able to
either prove or disprove the statement
βR is an equivalence relation.β
β To prove a relation R is an equivalence relation, it is
necessary to prove all three properties hold.
β To disprove that a relation R is an equivalence
relation, it is sufficient to show that one of the three
properties does not hold. This can usually be shown by
counterexample.
![Page 197: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/197.jpg)
WUCT121 Logic 197
Example:
β’ Let 1R be the identity relation on .
Prove or disprove 1R is an equivalence relation.
Proof:
Reflexive:
aaa =ββ , , that is ( ) 1, Raa β . Thus 1R is reflexive.
Symmetric:
abbaba ==ββ then ,if ,, , that is,
( ) ( ) 11 ,, RabRba βββ . Thus 1R is symmetric.
Transitive:
cacbbacba ===ββ then ,and if,,, , that is
111 ),()),(),(( RcaRcbRba ββββ§β . Thus 1R is
transitive.
Since 1R is reflexive, symmetric and transitive, 1R is an
equivalence relation.
![Page 198: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/198.jpg)
WUCT121 Logic 198
Exercises:
β’ Let βn . Consider the relation 2R on given by
( ) ( ){ }nbabaR mod:,2 β‘= .
Prove or disprove 2R is an equivalence relation.
Recall: ( ) nkbaknba =βββββ‘ ,mod .
Proof:
Reflexive:
00, Γ==βββ naaa , which implies that
( )naa modβ‘ , ( ) 2, Raa ββ΄ Thus 2R is reflexive.
Symmetric:
( ) nkbanbaba =ββ‘ββ then ,mod if,,
( )knnkab β=β=ββ΄ , giving ( )nab modβ‘ . Thus
( ) ( ) 22 ,, RabRba βββ . So 2R is symmetric.
Transitive:
( ) ( )ncbnbacba mod andmod if,,, β‘β‘ββ , then
)()( nlcbnkba =ββ§=β , nplknca =+=ββ΄ )( ,
so ( )nca modβ‘ . That is
222 ),()),(),(( RcaRcbRba ββββ§β . Thus 2R is
transitive.
Since 2R is reflexive, symmetric and transitive, 2R is an
equivalence relation.
![Page 199: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/199.jpg)
WUCT121 Logic 199
β’ Let 3R be the relation on given by
( ){ }0:,3 β = abbaR .
o Prove or disprove 3R is an equivalence relation.
Disprove:
Reflexive:
We must show 0, β Γββ aaa .
However 000and,0 =Γβ .
Thus ( ){ }0:,3 β = abbaR and so 3R is not
reflexive.
Therefore 3R is not an equivalence relation.
o Is 3R symmetric or transitive?
e transitiv000symmetric00
β΄β ββ β§β β΄β ββ acbcab
baab
o How can we adjust the relation so it becomes an
equivalence relation?
3R on { }0β .
![Page 200: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/200.jpg)
WUCT121 Logic 200
β’ Let { }2,1,0=A and let R be the relation on A given by
( ) ( ) ( ) ( ) ( ){ }0,1,1,0,2,2,1,1,0,0=R .
Prove or disprove R is an equivalence relation on A.
Reflexive:
For ( ) Ra β= 0,0:0 . For ( ) Ra β= 1,1:1 .
For ( ) Ra β= 2,2:2 .
So, ( ) RaaAa βββ ,, . Thus R is reflexive.
Symmetric:
For ( ) ( ) ( )2,2and 1,1,0,0 symmetry obviously holds.
( ) ( ) RR βββ 0,11,0 , ( ) ( ) RR βββ 0,10,1 ,
So, ( ) ( ) RabRba ββββ ,, , thus R is symmetric.
Transitive:
( ) ( ) ( ) RR βββ 1,01,0,0,0 , ( ) ( ) ( ) RR βββ 0,10,1,1,1 ,
( ) ( ) ( ) RR βββ 1,01,1,1,0 , ( ) ( ) ( ) RR βββ 0,00,1,1,0
( ) ( ) ( ) RR βββ 1,11,0,0,1 , ( ) ( ) ( ) RR βββ 0,10,0,0,1 ,
So ( ) ( ) ( ) RcaRcbba ββββ§β ,,, , thus R is transitive.
Therefore, since R is reflexive, symmetric and transitive, R
is an equivalence relation.
![Page 201: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/201.jpg)
WUCT121 Logic 201
5.2.8. Directed Graphs of Equivalence Relations
The directed graph of an equivalence relation on A has the
following properties:
β Each point of the graph has an arrow looping
around from it back to itself. (Reflexivity)
β In each case where there is an arrow going from one
point to a second, there is an arrow going from the second
point back to the first. (Symmetry)
β In each case where there is an arrow going from one
point to a second and from a second point to a third, there is
an arrow going from the first point to the third.
(Transitivity)
![Page 202: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/202.jpg)
WUCT121 Logic 202
Example:
β’ Let { }2,1,0=A and let R be the relation on A given
by ( ) ( ) ( ) ( ) ( ){ }0,1,1,0,2,2,1,1,0,0=R .
Draw the directed graph for R.
Previously R was shown to be an equivalence relation on A.
The directed graph is then :
1 0
2
![Page 203: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/203.jpg)
WUCT121 Logic 203
Exercise:
β’ Let { }9,7,6,4,3,2=A , and define a relation R on A
by ( ) ( ){ }3mod:, babaR β‘= .
Draw the directed graph for R.
Solution:
( ) ( ) ( ) ( ) ( ) ( ) ( )( ) ( ) ( ) ( ) ( ) ( ) ( )}4,7,7,4,6,9,9,6,3,9,9,3,3,6
,6,3,9,9,7,7,6,6,4,4,3,3,2,2{=R
It can be shown that R is an equivalence relation, and thus
the directed graph is:
9
6
3 2
4
7
![Page 204: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/204.jpg)
WUCT121 Logic 204
5.2.9. Equivalence Class
The fundamental property of equivalence relations which
makes them important is that each one determines a
partition of the set A into a family of disjoint sets.
Definition:
Let R be an equivalence relation on the set A. Then for each
Aa β , we define the equivalence class of a as
( ){ }RbaAba ββ= ,:)(class .
Example:
β’ Let { }2,1,0=A and let R be the relation on A given
by ( ) ( ) ( ) ( ) ( ){ }0,1,1,0,2,2,1,1,0,0=R . For each element in
A, we define equivalence classes as follows:
( ) ( ){ } { }1,0,0:0class =ββ= RbAb
( ) ( ){ } { } ( )0class0,1,1:1class ==ββ= RbAb
( ) ( ){ } { }2,2:2class =ββ= RbAb
![Page 205: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/205.jpg)
WUCT121 Logic 205
Exercises:
β’ Let 1R be the identity relation on . Write down the
following equivalence classes:
o ( ) { }11class =
o ( ) { }ΟΟ =class
o ( ) { }21
21class =
o For any βx , ( ) { }xx =class .
β’ Consider the relation 2R on given by
( ) ( ){ }3mod:,2 babaR β‘= .
What kind of numbers are in class(2) (otherwise written as
[2])?
( ) { }KKK ,23,,11,8,5,2,1,42class +ββ= k .
β’ Let 3R on A, the set of all people, be given by
( ){ }babaR offamily in the is :,3 = .
Who is in your equivalence class?
![Page 206: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/206.jpg)
WUCT121 Logic 206
5.3. Functions
5.3.1. Definition
If F is a relation from A to B, then we say F is a function
from A to B, if and only if the domain of F is all of A and
for each element Axβ , there is only one value Byβ such
that Fyx β),( .
Note:
A relation from A to B becomes a function if the domain is
all of A and if every first element is related to only one
second element. This last property is sometimes known as
the vertical line test.
Examples:
β’ Is 1R on , }:),{( 21 xyyxR == a function?
x
y
-3 -2 -1 0 1 2 3
-1
1
2
3
Dom =1R , vertical line test holds, thus 1R is a function.
![Page 207: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/207.jpg)
WUCT121 Logic 207
β’ Is 2R on , }:),{( 22 yxyxR == a function?
x
y
-1 0 1 2 3
-3
-2
-1
1
2
3
Dom =2R , vertical line test fails, thus 2R is not a
function.
Exercises:
β’ Is 3R on { }0: β₯β= xxA , }:),{( 23 yxyxR ==
a function?
x
y
-1 0 1 2 3
-1
1
2
3
Dom AR =3 , vertical line test holds, thus 3R is a function.
![Page 208: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/208.jpg)
WUCT121 Logic 208
β’ Is 4R on , }:),{(4 xyyxR == a function?
x
y
-1 0 1 2 3
-1
1
2
3
Dom β β= ),0[4R , thus 4R is not a function.
Notes:
When determining if a relation is a function:
β Infinite Case: Is the domain is the entire set A.
Finite Case: Is every element of A a first element in
an ordered pair?
β Infinite Case: Graph the relation and apply the
vertical line test.
Finite Case: List the ordered pairs and check each
first element appears only once.
![Page 209: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/209.jpg)
WUCT121 Logic 209
Exercises:
β’ Let { }6,4,2=A and let { }5,3,1=B . Which of the
following relations from A to B are functions?
o ( ){ } ( ) ( ){ }5,4,3,21:,1 ==+= yxyxR
Dom { } AR β = 4,21 .
Thus 1R is not a function.
o ( ) ( ) ( ) ( ){ }5,6,5,4,1,4,5,22 =R .
Dom { } AR == 6,4,22 .
However, ( ) ( ) 22 5,41,4 RR ββ§β
Thus 2R is not a function.
o ( ) ( ) ( ){ }5,6,1,4,5,23 =R .
Dom AR =3 , and each first element only appears
once.
Thus 3R is a function.
![Page 210: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/210.jpg)
WUCT121 Logic 210
β’ Which of the following are functions?
o 1F , the identity relation on { }10,5,1=A .
( ) ( ) ( ){ }10,10,5,5,1,11 =F
Dom AF =1 , and each first element only appears
once.
Thus 1F is a function
o 2F on , ( ){ }1:,2 == yyxF .
x
y
-3 -2 -1 0 1 2 3
-1
1
2
Dom =2F , vertical line test holds, thus 2F is a
function.
![Page 211: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/211.jpg)
WUCT121 Logic 211
o 3F on , ( ){ }1:,3 +== xyyxF .
x
y
-3 -2 -1 0 1 2 3
-2
-1
1
2
3
4
Dom =3F , vertical line test holds, thus 3F is a
function.
![Page 212: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/212.jpg)
WUCT121 Logic 212
5.3.2. One-to-one
Let F be a function from A to B. F is one-to-one if and only
if ( ) ( )( )212121 ,,,, xxyxyxAxx =β=ββ .
For one-to-one functions, any given element from the
Range is related to only one element from the Domain.
That is each element in both the domain and the range is
related to just one element.
Notes:
β Only functions can be one-to-one.
β It is often the case that if a function F is one-to-one,
it satisfies a horizontal line test.
β To establish if a relation is one-to-one show if the
relation is, in fact, a function. Then determine if it is
one-to-one.
β To show a function is one-to-one, show each
element in the range occurs once in an ordered pair.
β To show a function is not one-to-one, give a
counterexample, that is, find an element of the
range that is related to two elements in the domain.
![Page 213: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/213.jpg)
WUCT121 Logic 213
Examples:
β’ Consider the relation 1F on given by
}:),{( 21 xyyxF == . Is 1F a one-to-one function?
x
y
-3 -2 -1 0 1 2 3
-1
1
2
3
Dom =1F , vertical line test holds, thus 1F is a function.
Horizontal line test fails: FF ββ§ββ )1,1()1,1( 1 , therefore
1F is not a one-to-one function
![Page 214: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/214.jpg)
WUCT121 Logic 214
β’ Consider the relation 2F on { }0: β₯β=+ xx
given by }:),{( 22 xyyxF == . Is 2F a one-to-one
function?
x
y
-3 -2 -1 0 1 2 3
-1
1
2
3
4
Dom += 2F , vertical line test holds, thus 2F is a
function. Horizontal line test holds, therefore 2F is a one-
to-one function
β’ Let { }3,2,1,0=X .
Consider the function 3F from )( X to given by
( ){ }AnnAF set in the elements of number theis :,3 = .
Is 3F a one-to-one function?
Consider { } )(1,0 XA β= and { } )(2,1 XB β= .
Then ( ) 32, FA β and ( ) 32, FB β , that is, β2 appears
twice.
Thus, 3F is not a one-to-one function.
![Page 215: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/215.jpg)
WUCT121 Logic 215
Exercises:
Which of the following relations are one-to-one functions?
β’ 1F on { }3,2,1=A , ( ) ( ) ( ){ }1,3,3,2,2,11 =F .
x
y
0 1 2 3
-2
-1
1
2
3
4
5
Dom AF =1 , vertical line test holds, thus 1F is a function. Horizontal line test holds, therefore 1F is a one-to-one function.
β’ 2F on { }3,2,1=A , ( ) ( ) ( ){ }1,3,1,2,2,12 =F .
x
y
0 1 2 3
-2
-1
1
2
3
4
5
Dom AF =2 , vertical line test holds, thus 1F is a function. Horizontal line test fails: 22 )1,3()1,2( FF ββ§β , therefore
2F is not a one-to-one function.
![Page 216: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/216.jpg)
WUCT121 Logic 216
β’ 3F on , ( ){ }xyyxF 2:,3 == .
x
y
-3 -2 -1 0 1 2 3
-4
-3
-2
-1
1
2
3
4
Dom =3F , vertical line test holds, thus 3F is a function.
Horizontal line test holds, therefore 3F is a one-to-one
function
β’ 4F from { }0β to , ( ){ }1:, 24 β== xyyxF .
x
y
-3 -2 -1 0 1 2 3
-1
1
2
3
4
Dom { }04 β= F , vertical line test holds, thus 4F is a
function.
Horizontal line test fails: 44 )0,1()0,1( FF βββ§β ,
therefore 4F is not a one-to-one function.
![Page 217: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/217.jpg)
WUCT121 Logic 217
5.3.3. Onto
Let F be a function from A to B. F is onto if and only if
Range BF = , that is,
FyxAxBy βββββ ),(,, .
For a function to be onto, every given element from the
range must be related to at least one element from the
domain.
Notes:
β Only functions can be onto.
β To establish if a relation is onto show if the relation
is, in fact, a function. Then determine if it is onto.
β To show a function F from A to B is onto, show that
Range BF = , that is every element in the range
occurs at least once in an ordered pair.
β To show a function is not onto, give a
counterexample, that is, find an element of the
range that is not related to an element in the
domain.
![Page 218: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/218.jpg)
WUCT121 Logic 218
Example:
β’ Consider the relation 1F from
}11:{ β€β€ββ= xxA to given by
}1:),{( 21 xyyxF β== . Is 1F an onto function?
x
y
-2 -1 0 1 2
Dom AxxF =β€β€ββ= }11:{1 , vertical line test holds,
thus 1F is a function.
Range β β€β€β= }10:{1 yyF , thus 1F is not an onto
function.
By defining the function to 2F from
}11:{ β€β€ββ= xxA to }10:{ β€β€β= xxB given by
}1:),{( 22 xyyxF β== .
Now Range ByyF =β€β€β= }10:{2 , thus the function
2F is an onto function
![Page 219: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/219.jpg)
WUCT121 Logic 219
Exercises:
Which of the following functions are onto?
β’ 1F from }5,4,3,2,1{=A to },,,{ dcbaB = ,
)},5(),,4(),,3(),,2(),,1{(1 ddccaF =
Range BdcaF β = },,{1 . Therefore 1F is not an onto
function.
β’ 2F from }5,4,3,2,1{=A to },,,{ dcbaB = ,
)},5(),,4(),,3(),,2(),,1{(2 adcbaF = .
Range BdcbaF == },,,{2 . Therefore 2F is an onto
function.
β’ 3F on , }14:),{(3 β== xyyxF .
For each βy , let β+
=4
1yx , then
3),(,, Fyxxy βββββ . Thus Range =3F . Therefore
3F is an onto function.
β’ 4F on , }14:),{(4 β== xyyxF .
Consider β= 0y , then for 4)0,( Fx β requires
β+
=4
10x . Thus Range β 4F . Therefore 4F is not an
onto function
![Page 220: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/220.jpg)
WUCT121 Logic 220
5.3.4. Inverse
Every relation has an inverse and this holds for functions
also.
For any function, there is an inverse relation; however, this
inverse relation is not always a function.
The inverse of a function F will also be a function when F
is one-to-one and onto.
Example:
Consider the relation F on the interval
}11:{]1,1[ β€β€ββ=β xx , given by
}1:),{( 2xyyxF β== .
β’ Sketch F. Is F a one-to-one and onto function?
x
y
-2 -1 0 1 2
![Page 221: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/221.jpg)
WUCT121 Logic 221
Dom ]1,1[β=F , and the vertical line test holds. Thus F is
a function. Horizontal line test fails, thus F is not a one-to-
one function. Range ]1,1[]1,0[ ββ =F , thus F is not an
onto function.
β’ Sketch 1βF . Is 1βF a function?
Since F is function, and thus a relation, there is an inverse
relation 1βF on ]1,1[β given by
}1:),{( 21 yxyxF β==β .
x
y
-2 -1 0 1 2
Dom ]1,1[]1,0[1 ββ =βF , and the vertical line test fails.
Thus 1βF is not a function.
![Page 222: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/222.jpg)
WUCT121 Logic 222
Exercises:
Consider the relation F on }0:{ β₯β= xxA given by
}:),{( 2xyyxF == .
β’ Sketch F. Is F a one-to-one and onto function?
x
y
0 1 2
2
4
6
8
Dom AF = , vertical line test holds, horizontal line test
holds, Range AF = , thus F is one-to-one and onto
function.
β’ Sketch 1βF . Is 1βF a function?
x
y
0 1 2
2
Dom AF =β1 , vertical line test holds, thus 1βF a function.
![Page 223: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/223.jpg)
WUCT121 Logic 223
5.4. Permutations
5.4.1. Definition
Let A be a set and let F be a function on A. Then F is a
permutation of A if F is one-to-one and onto.
Example:
Let { }3,2,1,0=A . Define { })0,3(),3,2(),2,1(),1,0(=F .
F is a one-to-one and onto function on A and thus is a
permutation of the elements of A.
Using conventional function notation each ordered pair in F
can be written as: 0)3(,3)2(,2)1(,1)0( ==== FFFF
βMatrixβ representation can also be used for permutations.
The function F can be written as
ββ
βββ
β=
03213210
F
F is one possible permutation of the set A.
Other permutations are:
ββ
βββ
β=
32103210
I , ββ
βββ
β=
23013210
G , ββ
βββ
β=
02313210
H
![Page 224: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/224.jpg)
WUCT121 Logic 224
There will be 1234!4 ΓΓΓ= total different permutations
of the set A.
I is known as the identity permutation, where each element
in A is mapped to itself.
Notes:
β In general, if A is a set with n elements, there are n!
different permutations of A.
β The set of all permutations on a set A with n
elements is often denoted by nS .
Exercises:
Let { }3,2,1,0=A and let ββ
βββ
β=
23013210
G and
ββ
βββ
β=
02313210
H be permutation on A.
Write down the following.
β’ 0)1( =G
β’ 2)3( =G
β’ 1)0( =H
β’ 3)1( =H
β’ 0))0(( =HG
β’ 2))1(( =HG
![Page 225: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/225.jpg)
WUCT121 Logic 225
5.4.2. Cycle notation
Obviously, the matrix notation for permutations can be
confusing when we start to combine permutations.
This notation can be mistaken for βnormalβ matrix
multiplication. Therefore, we introduce what is called cycle
notation for permutations.
Example:
Let { }5,4,3,2,1=A and let F be a permutation on A given
by ββ
βββ
β=
1543254321
F
we note that:
1 βgoes toβ 2
2 βgoes toβ 3
3 βgoes toβ 4
4 βgoes toβ 5
5 βgoes toβ 1.
This can be written as a cycle: ( )54321 .
Diagrammatically, this can be represented as
(1 2 3 4 5)
![Page 226: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/226.jpg)
WUCT121 Logic 226
If an element is mapped onto itself, then it is left out of the
cycle.
Examples:
Write the following permutations using cycle notation.
β’ Let { }3,2,1,0=A
( )2030123210
=ββ
βββ
β=F
β’ { }5,4,3,2,1=A
( )( )54214531254321
=ββ
βββ
β=G
β’ { }3,2,1=A
( ) ( ) ( ) ( )( )( )321or 3or 2or 1321321
=ββ
βββ
β=I
![Page 227: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/227.jpg)
WUCT121 Logic 227
Exercises:
Write down the following permutations on
{ }3,2,1,0=A , using cycle notation.
β’ ( )3112303210
=ββ
βββ
β=F
β’ ( )231020313210
=ββ
βββ
β=G
β’ ( )( )321023013210
=ββ
βββ
β=H
![Page 228: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/228.jpg)
WUCT121 Logic 228
5.4.3. Composition
In traditional Calculus, composition of functions is defined
to be ))(())(( xfgxfg =o .
The same idea is used when considering composition of
permutations.
Examples:
Let { }4,3,2,1=A and let )4321(=F ,
)43)(21(=G be permutations on A.
Write down the following:
β’ 3)2())1(( == GFG
β’ 4)3())2(( == GFG
β’ 3)4())3(( == GFG
β’ 2)1())4(( == GFG
What is FG o written using cyclic notation?
)42(=FG o
![Page 229: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/229.jpg)
WUCT121 Logic 229
This could be calculated by writing each function in cyclic
notation in the appropriate order, then determining the
resultant permutation.
)43)(21)(4321(== FGFG o
1 βgoes toβ 2 in the first cycle, then 2 βgoes toβ 1 in the
second. Thus, 1 βgoes toβ 1 overall.
2 βgoes toβ 3 in the first cycle, then 3 βgoes toβ 4 in the
third. Thus, 2 βgoes toβ 4 overall.
3 βgoes toβ 4 in the first cycle, then 4 βgoes toβ 3 in the
third. Thus, 3 βgoes toβ 3 overall.
4 βgoes toβ 1 in the first cycle, then 1 βgoes toβ 2 in the
second. Thus, 4 βgoes toβ 2 overall.
These calculations give )42(== FGFG o .
( )( )( ) ( )422341432143214321 =ββ ββ
ββ=
![Page 230: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/230.jpg)
WUCT121 Logic 230
Exercises:
Calculate the following compositions of permutations on
{ }3,2,1,0=A .
β’ ( )( ) ( )2030123210
20121 =ββ
βββ
β=
β’ ( )( )( ) ( )2030123210
32103210 =ββ
βββ
β=
β’ ( )( ) ( )3112303210
23321 =ββ
βββ
β=
5.4.4. Inverse Permutations
Permutations are one-to-one and onto functions, thus their
inverses are also functions which are one-to-one and onto.
Thus, the inverse of a permutation is also a permutation.
Recall that to find the inverse of a relation or function, we
simply reverse the ordered pairs. For permutations, the
process is identical.
![Page 231: WUCT121 Discrete Mathematics Logic](https://reader030.vdocuments.us/reader030/viewer/2022012301/61e18fef56f4e5622631066e/html5/thumbnails/231.jpg)
WUCT121 Logic 231
Examples:
Let { }4,3,2,1=A and let )3421(=F .
In F:
1 βgoes toβ 2. Thus, in 1βF , 2 βgoes toβ 1.
2 βgoes toβ 4. Thus, in 1βF , 4 βgoes toβ 2.
3 βgoes toβ 1. Thus, in 1βF , 1 βgoes toβ 3.
4 βgoes toβ 3. Thus, in 1βF , 3 βgoes toβ 4.
Putting all these calculations together, we have
)1243()2431()3421( 11
=== ββF
Note that 1βF is just F written in the reverse order.
Exercises:
Let { }3,2,1,0=A Write down the following.
β’ ( ) ( )123321 1 =β
β’ ( ) ( )031130 1 =β