Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
18 views82 pages

Chap4 Complete

Chapter 4 covers the fundamentals of propositional logic, including definitions and examples of propositions, logical connectives (conjunctions, disjunctions, implications, and biconditionals), and truth tables. It explains how to translate English sentences into logical expressions and discusses the applications of propositional logic in various contexts. The chapter also introduces quantifiers and nested quantifiers, providing a foundation for understanding more complex logical structures.

Uploaded by

Nazetta
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views82 pages

Chap4 Complete

Chapter 4 covers the fundamentals of propositional logic, including definitions and examples of propositions, logical connectives (conjunctions, disjunctions, implications, and biconditionals), and truth tables. It explains how to translate English sentences into logical expressions and discusses the applications of propositional logic in various contexts. The chapter also introduces quantifiers and nested quantifiers, providing a foundation for understanding more complex logical structures.

Uploaded by

Nazetta
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 82

Chapter 4: Logic

2022

1/80
Outline
Propositional Logic Existential Quantifiers
Propositions Negating Quantified
Conditional Statements Expressions
Truth Tables of Translating from english
Compound Propositions into logical expressions
Applications of Propositional
Logic Nested Quantifiers
Translating English The order of quantifiers
Sentences Translating Mathematical
Logic Puzzles Statements into
Logic Circuits Statements Involving
Propositional Equivalences Nested Quantifiers
Logical Equivalences Translating from Nested
Constructing New Logical Quantifiers into English
Equivalences Translating English
Predicates and Quantifiers Sentences into Logical
Predicates Expressions
Quantifiers Negating Nested
Universal Quantifiers Quantifiers
2/80
Propositions

Key Point
A proposition is a declarative sentence that is either true or
false, but not both.

Example
All of the following are propositions.
1. Kuala Lumpur is the capital of Malaysia.
2. Shanghai is the capital of China.
3. 1 + 1 = 5.
4. 3 ⇥ 3 = 9.
Propositions 1 and 4 are true, whereas 2 and 3 are false.

3/80
Propositions

Example
All of the following are not propositions.
1. Who are you?
2. Where are you going?
3. Compute this sum. (instruction)
4. 1 + y = 5.
5. a2 + b 2 = c 2 .
1, 2 and 3 are not propositions because they are not
declarative sentences. 4 and 5 are not proposition because
they are neither true or false.

4/80
Propositions
I We use letters to denote propositional variables (or
statement variables), that is, variables that represent
propositions, just as letters are used to denote numerical
variables.
I The conventional letters used for propositional variables
are p, q, r , s, . . ..
I The truth value of a proposition is true, denoted by T ,
if it is a true proposition, and the truth value of a
proposition is false, denoted by F , if it is a false
proposition.
I The area of logic that deals with propositions is called the
propositional calculus or propositional logic.
I Many mathematical statements are constructed by
combining one or more propositions. New propositions,
called compound propositions, are formed from existing
propositions using logical operators. 5/80
Propositions
Definition
Let p be a proposition. The statement

“It is not the case that p”


is another proposition, called the negation of p and is
denoted by ¬p. The proposition ¬p is read “not p.”

Example
1. If q = “I have black hair”, then the ¬q = “I do not have
black hair”.
2. If r = “2 is a positive integer”, then the ¬r = “2 is not a
positive integer”.
6/80
Propositions

Table: Truth table for the negation of a proposition

p ¬p
T F
F T

Example
If r = “ 2 is a positive integer ”, then the
| {z }
T
¬r = “ 2 is not a positive integer ”.
| {z }
F

7/80
Propositions
Definition
Let p and q be propositions. The proposition “p and q”,
denoted p ^ q, is the proposition that is true when both p and
q are true and is false otherwise. The proposition p ^ q is
called the conjunction of p and q.

Table: Truth table for the conjuction of two propositions

p q p^q
T T T
T F F
F T F
F F F

8/80
Propositions
Remark
I ‘^’ points up like an ‘A’, and it means ‘AND’.
I Note that in logic the word “but” sometimes is used
instead of “and” in a conjunction.

Example
Let p is the proposition “Today is Monday” and q is the
proposition “It is sunny today”. Find the conjunction of the
propositions p and q.
Solution
p ^ q = “Today is Monday and it is sunny today”.
This proposition is true on sunny Mondays and is false on any
day that is not a Monday and on Mondays when it is rainy. 9/80
Propositions

Example
Consider the following four statements:
2 = 4} ) T.
(i) |Ice floats{zin water} and |2 + {z
T T
2 = 5} ) F.
(ii) |Ice floats{zin water} and |2 + {z
T F
(iii) Malaysia is in Europe and |2 + {z 2 = 4} ) F.
| {z }
F T
(iv) Malaysia is in Europe and |2 + {z 2 = 5} ) F.
| {z }
F F

10/80
Propositions
Definition
Let p and q be propositions. The proposition “p or q”,
denoted p _ q, is the proposition that is false when p and q
are both false and true otherwise. The proposition p _ q is
called the disjunction of p and q.

Remark Table: Truth table for the


The use of the connective or in a disjunction of two propositions
disjunction corresponds to one of
the two ways the word or is used
p q p_q
in English, namely, in an inclusive T T T
way. Thus, a disjunction is true T F T
when at least one of the two F T T
propositions in it is true. F F F
11/80
Propositions

Example
Let p is the proposition “Today is Monday” and q is the
proposition “It is sunny today”. Find the disjunction of the
propositions p and q.
Solution
p _ q = “Today is Monday or it is sunny today”.
This proposition is true on any day that is either a Monday or
sunny day (including sunny Fridays). It is only false on days
that are not Mondays when it also not a sunny day.

12/80
Propositions

Example
Consider the following four statements:
2 = 4} ) T.
(i) |Ice floats{zin water} or 2| + {z
T T
2 = 5} ) T.
(ii) |Ice floats{zin water} or 2| + {z
T F
(iii) Malaysia is in Europe or 2| + {z 2 = 4} ) T.
| {z }
F T
(iv) Malaysia is in Europe or 2| + {z 2 = 5} ) F.
| {z }
F F

13/80
Propositions (logic gate

Sometimes, we use or in an exclusive sense. When the


exclusive or is used to connect the propositions p and q, the
proposition “p or q (but not both)” is obtained.
Definition
Let p and q be propositions. The proposition exclusive or of
p and q, denoted by p q, is the proposition that is true when
exactly one of p and q is true and is false otherwise.

Table: Truth table for the exclusive or of two propositions

p q p q
T T F
T F T
F T T
F F F
14/80
Propositions
Example
Let p is the proposition “I will get an A in this course” and q
is the proposition “I will drop this course”.
p q = “I will either get an A in this course or I will drop it
(but not both!)”.

Example
Let p is the proposition “Students who have taken calculus
can enroll in this class” and q is the proposition “Students
who have taken computer science can enroll in this class”.
p q = “Students who have taken calculus or computer
science, but not both, can enroll in this class”.

15/80
Conditional Statements
Definition
Let p and q be propositions. The conditional statement or
implication p ! q is the proposition that is false when p is
true and q is false and true otherwise. Here p is called the
hypothesis (antecedent or premise) and q is called the
conclusion (or consequence).

Table: Truth table for the implication p ! q

p q p!q
T T T
T F F Ip true
, a false)

F T T
F F T
16/80
Conditional Statements
Other ways to express implication:
1. if p, then q 9 is a conclusion

pis hypothesis
a

2. p implies q
3. p only if q
4. if p, q
5. p is sufficient for q
6. a sufficient condition for q is p
7. q if p
8. q whenever p
9. q is necessary for p
10. a necessary condition for p is q
11. q follows from p
12. q unless ¬p
17/80
Conditional Statements

I A useful way to understand the truth value of a


conditional statement is to think of an obligation or a
contract.
I Consider a statement that a professor might make: “If
you get 100% on the final, then you will get an A.”
I If you manage to get a 100% on the final, then you would
expect to receive an A. If you do not get 100% you may
or may not receive an A depending on other factors.
However, if you do get 100%, but the professor does not
give you an A, you will feel cheated.
conclusion can be true even hypothesis is
wrong
.

18/80
Converse, Contrapositive & Inverse
* Suppose that we have an implication p ! q.
1. q ! p is the converse of p ! q,
2. ¬q ! ¬p is the contrapositive of p ! q, (negation of
converse implication)
3. ¬p ! ¬q is the inverse of p ! q.
Example inverse switching back to original

Consider an implication ”The Sarawak Football Team wins


whenever it is raining”.
“q whenever p” means p ! q, i.e.
“ If it is raining, then |the Sarawak Football
{z Team wins} ”.
| {z }
p q
Converse: “If the Sarawak Football Team wins, then it is
q P
raining”.
Contrapositive: “If the Sarawak Football Team does not
win, then it is not raining”.
Inverse: “If it is not raining, then the Sarawak Football Team
does not win”. 19/80
Biconditionals
Definition
different from exclusive statement
Let p and q be propositions. The biconditional statement
p $ q (p if and only if q, p i↵ q) is the proposition that is
true when p and q have the same truth values, and is false
otherwise. Biconditional statements are also called
bi-implications.

Table: Truth table for the biconditional p $ q

p q p$q
T T T
T F F
F T F
F F T
20/80
Biconditionals
Other ways to express p $ q:
1. p is necessary and sufficient for q
2. if p then q, conversely
3. p i↵ q

Example
Let p be “You can take the flight” and q be “you buy a
ticket”. Thus p $ q is “You can take the flight if and only if
you buy a ticket”

Remark
Note that p $ q has exactly the same truth value as
(p ! q) ^ (q ! p).

21/80
Truth Tables of Compound Propositions
I We have now introduced four important logical
connectives—conjunctions, disjunctions, conditional
statements, and biconditional statements—as well as
negations.
I We can use these connectives to build up complicated
compound propositions involving any number of
propositional variables.
I We can use truth tables to determine the truth values of
these compound propositions.
I We use a separate column to find the truth value of each
compound expression that occurs in the compound
proposition as it is built up.
I The truth values of the compound proposition for each
combination of truth values of the propositional variables
in it is found in the final column of the table.
22/80
Truth Tables of Compound Propositions

Example
Construct the truth table of the compound proposition:
(p _ ¬q) ! (p ^ q)
2xa = 4 lines

-4
Solution:
p q ¬q p _ ¬q p^q (p _ ¬q) ! (p ^ q)
T T F T T T
T F T T F F
F T F F F T
F F T T F F

23/80
Precedence of Logical Operators

I ¬p ^ q means (¬p) ^ q and not


priority level ¬(p ^ q)
Operator Precedence I p ^ q _ r means (p ^ q) _ r
¬ 1 rather than p ^ (q _ r )
^ 2 I p _ q ! r is the same as
_ 3 (p _ q) ! r
! 4
I We will use parentheses when
$ 5
the order of the conditional
operator and biconditional
operator is at issue

24/80
Translating English Sentences
Example
Translate “You can access the Internet from campus only if
you are a computer science major or you are not a first year
student” into a logical expresion.
Solution:
I Although it is possible to represent the sentence by a
single propositional variable, such as p, this would not be
useful when analyzing its meaning or reasoning with it.
I Instead, we will use propositional variables to represent
each sentence part and determine the appropriate logical
connectives between them.
I Let
a = “You can access the Internet from campus”
c = “You are a computer science major”
f = “You are a first year student” 25/80
Translating English Sentences

Thus, “You are not a first year student” ) ¬f


“You are a computer science major or you are not a first year
student” ) c _ ¬f
“You can access the Internet from campus only if you are a
computer science major or you are not a first year student”
) a ! (c _ ¬f ).
bracket or it will look like
must use

a is implies <

26/80
Logic Puzzles
Example
An island has two kinds of inhabitants, knights, who always
tell the truth, and their opposites, knaves, who always lie. You
encounter two people A and B. What are A and B if A says
“B is a knight” and B says “The two of us are opposite
types?”
Solution:
I Let p and q be the statements that A is a knight and B is
a knight, respectively, so that ¬p and ¬q are the
statements that A is a knave and B is a knave,
respectively.
I We first consider the possibility that A is a knight; that is
p is true. If A is a knight, then he is telling the truth
when he says that B is a knight, so that q is true, and A
and B are the same type. 27/80
p
:
a knight q
: B is a knight
B knave
Ip : a as knave Eg : in a

A : Bis b
a ight

:
/ oppeate =(p14g) (VG paq).

A is a knight :
a is Nue . Pic
. Howeve when both
AlzB are knights ,
what
B said is false
.

② A is I 9 false
: g is

= Bis &
Logic Puzzles

I However, if B is a knight, then B’s statement that A and


B are of opposite types, the statement
(p ^ ¬q) _ (¬p ^ q), would have to be true, which it is
not, because A and B are both knights. Consequently, we
can conclude that A is not a knight, that is, that p is
false.
I If A is a knave, then because everything a knave says is
false, A’s statement that B is a knight, that is, that q is
true, is a lie. This means that q is false and B is also a
knave. Furthermore, if B is a knave, then B’s statement
that A and B are opposite types is a lie, which is
consistent with both A and B being knaves. We can
conclude that both A and B are knaves.

28/80
Logic Circuits
I Propositional logic can be applied to the design of computer
hardware.
I A logic circuit (or digital circuit) receives input signals
p1 , p2 , . . . , pn , each a bit [either 0 (o↵) or 1 (on)], and
produces output signals s1 , s2 , . . . , sn , each a bit.
I Complicated digital circuits can be constructed from three
basic circuits, called gates.
I The inverter, or NOT gate, takes an input bit p, and
produces as output ¬p. The OR gate takes two input signals
p and q, each a bit, and produces as output the signal p _ q.
Finally, the AND gate takes two input signals p and q, each
a bit, and produces as output the signal p ^ q.

29/80
Logic Circuits
I Given a circuit built from the basic logic gates and the
inputs to the circuit, we determine the output by tracing
through the circuit
Example

We see that the AND gate takes input of p and ¬q, the
output of the inverter with input q, and produces p ^ ¬q.
Next, we note that the OR gate takes input p ^ ¬q and ¬r ,
the output of the inverter with input r , and produces the final
output (p ^ ¬q) _ ¬r . 30/80
Logic Circuits

Example
Build a digital circuit that produces the output
(p _ ¬r ) ^ (¬p _ (q _ ¬r )) when given input bits p, q, and r .

Solution:
left to the right

31/80
Logical Equivalences
Definition
A compound proposition that is always true, no matter what
the truth values of the propositional variables that occur in it,
is called a tautology. A compound proposition that is always
false is called a contradiction. A compound proposition that
is neither a tautology nor a contradiction is called a
contingency.

Example
Show that p _ ¬p is a tautology and p ^ ¬p is a contradiction.
p ¬p p _ ¬p p ^ ¬p
T F T F
F T T F

32/80
Logical Equivalences

Definition
The propositions p and q are called logical equivalent if
p $ q is a tautology. The notation p ⌘ q denotes that p and
q are logically equivalent.
One way to determine whether two propositions are equivalent
is to use a truth table. In particular, the propositions p and q
are equivalent if and only if the columns giving their truth
values agree.

33/80
Logical Equivalences
Example
Show that the propositions p ! q and ¬p _ q are logically
equivalent.
Solution

p q ¬p ¬p _ q p!q
T T F T T
T F F F F
F T T T T
F F T T T

Since the truth values of ¬p _ q and p ! q agree, these


propositions are logically equivalent.
34/80
Logical Equivalences
Example
Show that the propositions ¬(p _ q) and ¬p ^ ¬q are logically
equivalent.
Solution

p q p_q ¬(p _ q) ¬p ¬q ¬p _ ¬q
T T T F F F F
T F T F F T F
F T T F T F F
F F F T T T T

Since the truth values of ¬(p _ q) and ¬p ^ ¬q agree, these


propositions are logically equivalent.
35/80
Logical Equivalences

Example
Show that the propositions p _ (q ^ r ) and (p _ q) ^ (p _ r ) are logically
equivalent. 23 G
=

Solution
p q r q ^ r p _ (q ^ r ) p _ q p _ r (p _ q) ^ (p _ r )
T T T T T T T T
T T F F T T T T
T F T F T T T T
T F F F T T T T
F T T T T T T T
F T F F F T F F
F F T F F F T F
F F F F F F F F
Since the truth values of p _ (q ^ r ) and (p _ q) ^ (p _ r ) agree, these
propositions are logically equivalent.

36/80
Logical Equivalences

Table: Logical equivalences

Equivalences Name
p^T⌘p
Identity laws
p_F⌘p
p_T⌘T
Domination laws p^F⌘F
p_p ⌘p
Idempotent laws
p^p ⌘p
Double negation law ¬(¬p) ⌘ p
p_q ⌘q_p
Commutative laws p^q ⌘q^p

*T denotes the compound proposition that is always true and F


denotes the compound proposition that is always false.
37/80
Logical Equivalences + v)
+ pr
px(a
=
pq

Table: Logical equivalences continued ...

Equivalences Name
(p _ q) _ r ⌘ p _ (q _ r )
Associative laws (p ^ q) ^ r ⌘ p ^ (q ^ r )
p _ (q ^ r ) ⌘ (p _ q) ^ (p _ r )
Distributive laws p ^ (q _ r ) ⌘ (p ^ q) _ (p ^ r )
¬(p ^ q) ⌘ ¬p _ ¬q
De Morgan’s laws
¬(p _ q) ⌘ ¬p ^ ¬q
p _ (p ^ q) ⌘ p
Absorption laws
p ^ (p _ q) ⌘ p
p _ ¬p ⌘ T
Negation laws
p ^ ¬p ⌘ F

38/80
Logical Equivalences

Table: Logical equivalences


involving conditional statements
Table: Logical equivalences
combination of junction and can
combine
w other operators
. involving biconditionals
p ! q ⌘ ¬p _ q statements
p ! q ⌘ ¬q ! ¬p
p _ q ⌘ ¬p ! q
p ^ q ⌘ ¬(p ! ¬q) p $ q ⌘ (p ! q) ^ (q ! p)
¬(p ! q) ⌘ p ^ ¬q p $ q ⌘ ¬p $ ¬q
(p ! q) ^ (p ! r ) ⌘ p ! (q ^ r ) p $ q ⌘ (p ^ q) _ (¬p ^ ¬q)
(p ! r ) ^ (q ! r ) ⌘ (p _ q) ! r ¬(p $ q) ⌘ p $ ¬q
(p ! q) _ (p ! r ) ⌘ p ! (q _ r )
(p ! r ) _ (q ! r ) ⌘ (p ^ q) ! r

39/80
Constructing New Logical Equivalences

Example
Show that ¬(p ! q) and p ^ ¬q are logically equivalent.
LIS or RAS
Solution
We could use a truth table to show that these compound
propositions are equivalent. However, we want to illustrate
how to use logical identities that we already know to establish
new logical identities. If the equestion ask you to illustrate
the logical . Show this
a

¬(p ! q) ⌘ ¬(¬p _ q) by log. equiv. for implication


⌘ ¬(¬p) ^ ¬q by second De Morgan law
⌘ p ^ ¬q by double negation law

40/80
Constructing New Logical Equivalences
Example LIS is
longer
Show that ¬(p _ (¬p ^ q)) and ¬p ^ ¬q are logically
equivalent by developing a series of logical equivalences.
two sets of propositions
Solution

¬(p _ (¬p ^ q)) ⌘ ¬p ^ ¬(¬p ^ q) 2nd De Morgan’s law


⌘ ¬p ^ [¬(¬p) _ ¬q] 1st De Morgan’s law
⌘ ¬p ^ (p _ ¬q) double negation law
⌘ (¬p ^ p) _ (¬p ^ ¬q) 2nd distributive law
⌘ F _ (¬p ^ ¬q) negation law
⌘ (¬p ^ ¬q) _ Fjustcommutative
remove
law
⌘ ¬p ^ ¬q identity law

Consequently ¬(p _ (¬p ^ q)) and ¬p ^ ¬q are logically equivalent.


41/80
Constructing New Logical Equivalences

Example
Show that (p ^ q) ! (p _ q) is a tautology using logical
equivalences laws.
Solution
change into implication that
you can solve
(p ^ q) ! (p _ q) ⌘ ¬(p ^ q) _ (p _ q) involving implications

·
⌘ (¬p _ ¬q) _ (p _ q) 1st De Morgan’s law
⌘ (¬p _ p) _ (¬q _ q) associative law
⌘ T_T negation law
⌘ T domination law

Consequently (p ^ q) ! (p _ q) is a tautology.

42/80
Predicates
I In this section we will introduce a more powerful type of
logic called predicate logic.
I Statements involving variables, such as

x > 3, x + y = 5, a2 + b 2 = c 2 ,

are neither true nor false when the values of the variables
are not specified.
I In this section, we will discuss the ways that propositions
can be produced from such statements.
I Consider the statement “x > 3”, i.e. “x is greater than
3”.
x is greater than 3
|{z} | {z }
subject predicate

43/80
Predicates
I Let P be the predicate “is greater than 3” and x is the
variable.
I Then P(x) denotes the statement “x is greater than 3”.
I P(x) is also said to be the value of the propositional
function P at x.
Example
Let P(x) denote the statement “x > 3”. What are the truth
values of P(4) and P(2). In is have value
now
to test)

Solution

P(x) : x > 3
P(4) : 4 > 3 ! true
P(2) : 2 > 3 ! false
44/80
Predicates
I We can also have statements that involve more than one
variable. For instance, consider the statement
“x = y + 3.”
I We can denote this statement by Q(x, y ), where x and y
are variables and Q is the predicate.
I When values are assigned to the variables x and y , the
statement Q(x, y ) has a truth value.
Example
Let Q(x, y ) denote the statement “x = y + 3”. What are the
truth values of Q(1, 2) and Q(3, 0).
Solution
Q(x, y ) : x = y + 3
Q(1, 2) : 1 = 2 + 3 ! false Q(3, 0) : 3 = 0 + 3 ! true
45/80
Predicates
Example
Let R(x, y , z) denote the statement “x + y = z”. What are
the truth values of R(1, 2, 3) and R(0, 0, 1).
n variables inside predicate
Solution

R(x, y , z) : x + y = z
R(1, 2, 3) : 1 + 2 = 3 ! true
R(0, 0, 1) : 0 + 0 = 1 ! false

Remark
In general, a statement involving the n variables x1 , x2 , . . . , xn
can be denoted by P(x1 , x2 , . . . , xn ).
46/80
Quantifiers
I Another important way to create a proposition from a
propositional function is quantification,
I Quantification expresses the extent to which a predicate
is true over a range of elements.
I In English, the words all, some, many, none, and few are
used in quantifications. We will focus on two types of
quantification here:
1. universal quantification, which tells us that a predicate
is true for every element under consideration,
2. existential quantification, which tells us that there is
one or more element under consideration for which the
predicate is true.
I The area of logic that deals with predicates and
quantifiers is called the predicate calculus.
47/80
of
Universal Quantifiers universal
quantification

Definition Y
The universal quantification of P(x) denoted by 8xP(x) is
the proposition
“P(x) is true for all values of x in the universe of discourse
(domain)”.
Here 8 is called the universal quantifier. 8x P(x) is read as
“for all x P(x)” or “for every x P(x)”. An element for which
P(x) is false is called a counterexample of 8xP(x).

this is how to rewrite in .
english

I The meaning of the universal quantification of P(x)


changes when we change the domain.
I The domain must always be specified when a universal
quantifier is used; without it, the universal quantification
of a statement is not defined.
48/80
Universal Quantifiers p(n)
=
e

ntR become take when


will m=

Statement When True? When False?


8xP(x) P(x) is true for every x. There is an x for which
P(x) is false.

Example
Let P(x) be the statement “x + 1 > x”. What is the truth
value of the quantification 8x P(x), where the domain consists
of all real numbers?
Solution
Since P(x) is true for all real numbers x, the quantification
8x P(x) is true.

49/80
Universal Quantifiers
Example
Let Q(x) be the statement “x < 2”. What is the truth value
of the quantification 8x Q(x), where the domain consists of all
real numbers?
Solution
Q(x) is not true for every real numbers x, e.g. Q(3) is false..
Thus 8x Q(x) is false.

Remark
When all the elements in the domain can be listed—say,
x1 , x2 , . . . , xn —it follows that the universal quantification
8xP(x) is the same as the conjunction

8x P(x) = P(x1 ) ^ P(x2 ) ^ · · · ^ P(xn ).


50/80
Universal Quantifiers
Example
What is the true value of 8x P(x), where P(x) is the
statement “x 2 < 10” and the domain consists of the positive
integers not exceeding 4?
n - 4
Solution
8x P(x) = P(1) ^ P(2) ^ P(3) ^ P(4)
Since P(4) is false, so 8x P(x) is false.

Remark
To show that a statement of the form 8x P(x) is false, we
only need to show one value of x where P(x) is false. This is
called a counterexample to the statement 8x P(x).

51/80
Universal Quantifiers P(n) = n
=
2x

Example
What is the truth value of 8x(x 2 x) if the domain consists of all
real numbers? What is the truth value of this statement if the
domain consists of all integers?
Solution * you read what is the domain

1. The universal quantification 8x(x 2 x), where the domain


consists of all real numbers, is false. For example,
✓ ◆2
1 1
⇤ . Note that x 2 x if and only if
2 2
x 2 x = x(x 1) 0. Consequently, x 2 x if and only if
x  0 or x 1. It follows that 8x(x 2 x) is false if the
domain consists of all real numbers (because the inequality is
false for all real numbers x with 0 < x < 1).
2. If the domain consists of the integers, 8x(x 2 x) is true,
because there are no integers x with 0 < x < 1.
52/80
Existential Quantifiers
Definition
The existential quantification of P(x) denoted by 9x P(x)
is the proposition
“There exists an element x in the universe of discourse
(domain) such that P(x) is true”.
Here 9 is called the existential quantifier.

I A domain must always be specified when a statement


9xP(x) is used.
I The existential quantification can be expressed in many
other ways, such as by using the words “for some,” “for
at least one,” or “there is.”
I The existential quantification 9xP(x) is read as
I There is an x such that P(x),
I There is at least one x such that P(x), or
I For some x P(x).
53/80
Existential Quantifiers

Statement When True? When False?


9xP(x) There is an x for which P(x) is false for every x.
P(x) is true.

Example
Let P(x) be the statement “x > 3”. What is the truth value
of the quantification 9x P(x), where the domain consists of all
real numbers?
Solution trevalue can be taken by P(m)

Since P(x) is true, e.g. when x = 4, the quantification


9x P(x) is true.

54/80
Existential Quantifiers
Example
Let Q(x) be the statement “x = x + 1”. What is the truth
value of the quantification 9x P(x), where the domain consists
of all real numbers?
Solution
Since Q(x) is false for every real number x, the quantification
9x P(x) is false.
Remark
When all the elements in the domain can be listed—say,
x1 , x2 , . . . , xn —the existential quantification 9xP(x) is the
same as the disjunction

9x P(x) = P(x1 ) _ P(x2 ) _ · · · _ P(xn )


55/80
Existential Quantifiers

Example
What is the true value of 9x P(x), where P(x) is the
statement “x 2 < 10” and the domain consists of the positive
integers not exceeding 4?
Solution
Because the domain is {1, 2, 3, 4}, the proposition 9xP(x) is
the same as the disjunction

P(1) _ P(2) _ P(3) _ P(4).

Because P(4), which is the statement “42 > 10,” is true, it


follows that 9xP(x) is true.

56/80
The Uniqueness Quantifier

not common is question but

it's good to know .

I The uniqueness quantifier, denoted by 9! or 9!1 states


“There exists a unique x such that P(x) is true.”
I Other phrases for uniqueness quantification include “there
have
is exactly one” and “there is one and only one.” you no
but to choose
choice
one .

I For instance, 9!x(x 1 = 0), where the domain is the set


of real numbers, states that there is a unique real number
x such that x 1 = 0. This is a true statement, as x = 1
is the unique real number such that x 1 = 0.

57/80
Precedence of Quantifiers

I The quantifiers 8 and 9 have higher precedence than all


logical operators from propositional calculus.
I For example, 8xP(x) _ Q(x) is the disjunction of 8xP(x)

and Q(x). predicate (there
is quantifier (
no

I In other words, it means (8xP(x)) _ Q(x) rather than


8x(P(x) _ Q(x)).

58/80
Negating Quantified Expressions

Key Point
negation law
negation of some
I ¬9x P(x) ⌘ 8x ¬P(x) -Jn = (n + P(x)

I ¬8x P(x) ⌘ 9x ¬P(x) IV =


Fa = P(x)

I ¬9x P(x)
I If P(x) is false for every x ) True
I If there is an x for which P(x) is true ) False
I ¬8x P(x)
I If there is an x for which P(x) is false ) True
I If P(x) is true for every x ) False

59/80
Negating Quantified Expressions

Example
What is the negation of the statement “All Malaysians eat
nasi lemak”.
Solution
Suppose that the domain is all Malaysians. inside

O-galways
use the variable

Let N(x) = x eats nasi lemak. Then “All Malaysians eat nasi
n reflects the subject .

lemak” = 8x N(x).not all -

So the negation is ¬8x N(x) = 9x ¬N(x) .


In English, “There is a Malaysian who does not eat nasi
lemak.”

60/80
Negating Quantified Expressions

Example
What is the negation of the statement “There is an
international student in this class”.
Solution
Suppose that the domain is all students in this class.
Let I (x) = x is an international student in this class. Then
“There is an international student in this class” = 9x I (x).
So the negation is ¬9x I (x) = 8x ¬I (x). I
In English, “All students in this class are not international
student.”
ine in
Sinarnation
class
:

students
61/80
Negating Quantified Expressions

Example
What are the negations of the statements 8x (x 2 > x) and
9x (x 2 = 2).

Solution
The negation of 8x (x 2 > x) is

¬8x (x 2 > x) = 9x ¬(x 2 > x) = 9x (x 2  x)

The negation of 9x (x 2 = 2) is

¬9x (x 2 = 2) = 8x ¬(x 2 = 2) = 8x (x 2 6= 2)

62/80
Translating from english into logical expressions
Example
Express the statement “Every student in the this class has

studied calculus”. subjectE domain

Solution I
Let the domain (universe of discourse) be all students in this
class.
Rewrite the statement:
For every student in this class, that student has studied
calculus.
Next introduce variable x:
For every student x in this class, x has studied calculus.
Let C (x) = “x has studied calculus”, thus we have 8x C (x).
63/80
Translating from english into logical expressions
Alternative Solution
Let the domain (universe of discourse) be all students in
UNIMAS.
Rewrite the statement:
For every student in UNIMAS, if that student is in this class,
then that student has studied calculus.
Next introduce variable x:
For every student x in UNIMAS, if student x is in this class,
then student x has studied calculus.
Let C (x) = “student x has studied calculus” and P(x) =
“student x is in this class”, thus we have 8x (P(x) ! C (x)).
Caution! Our statement cannot be expressed as
8x(P(x) ^ C (x)) because this statement says that all students
in UNIMAS are students in this class and have studied
cannot combine different domain
to another domain
calculus!]
,

64/80
Translating from english into logical expressions

Alternative Solution
When we are interested in the background of people in
subjects besides calculus, we may prefer to use the
two-variable quantifier Q(x, y ) for the statement “student x
has studied subject y .” Then we would have
I 8xQ(x, calculus) if the domain is all students in this class.
I 8x(P(x) ! Q(x, calculus)) if the domain is all students
in UNIMAS.

65/80
Translating from english into logical expressions
Example
Express the statement “Some student in the this class has
visited Melaka”.
Solution
Let the domain be all students in this class.
Rewrite the statement:
There is a student in this class with the property that the
student has visited Melaka.
Next introduce variable x:
There is a student x in this class having the property that x
has visited Melaka.
Let M(x) = “x has visited Melaka”, thus we have 9x M(x).
66/80
Translating from english into logical expressions
Alternative Solution
Let the domain be all students in UNIMAS.
Rewrite the statement:
There is a student in UNIMAS with the property that student
is in this class and that student has visited Melaka.
Next introduce variable x:
There is a student x in UNIMAS with the property that
student x is in this class and x has visited Melaka.
Let M(x) = “student x has visited Melaka” and P(x) =
“student x is in this class”, thus we have 9x (P(x) ^ M(x)).
[Caution! Our statement cannot be expressed as
9x(P(x) ! M(x)), which is true when there is someone not
in the class because, in that case, for such a person x,
P(x) ! M(x) becomes either F ! T or F ! F, both of
which are true.]
67/80
Translating from english into logical expressions
Example
Express the statement “Every student in the this class has
visited either Penang or Melaka”.
Solution
Let the domain be all students in this class.
Rewrite the statement:
For every student in this class, that student has visited either
Melaka or that student has visited Penang.
Next introduce variable x:
For every student x in this class, x has visited either Melaka or
x has visited Penang.
Let M(x) = “x has visited Melaka” and P(x) = “x has visited
Penang”, thus we have 8x (M(x) _ P(x)).
68/80
Translating from english into logical expressions
Alternative Solution
Let the domain be all students in UNIMAS.
Rewrite the statement:
For every student in UNIMAS, if that student is in this class
then that student has visited either Melaka or that student has
visited Penang.
Next introduce variable x:
For every student x in UNIMAS, if that student x is in this
class then that student x has visited either Melaka or that
student x has visited Penang
Let M(x) = “student x has visited Melaka”, P(x) = “student
x has visited Penang” and D(x) = “student x is in this class”,
thus we have 8x (D(x) ! (M(x) _ P(x))).
69/80
Nested Quantifiers
I Nested quantifiers are quantifiers that occur with in the
scope of other quantifiers, e.g.

8x9y (x + y = 0).


all some , there is
Example
Assume that the domain for the variables x and y consists of
all real numbers.
I 8x8y (x + y = y + x)
) For all real numbers x and y , x + y = y + x.
I 8x9y (x + y = 0)
) For all real number x, there is a real number y such
that x + y = 0.
I 8x8y ((x > 0) ^ (y < 0) ! (xy < 0))
) For all real numbers x and y , if x > 0 and y < 0, then
xy < 0. 70/80
The order of quantifiers
It is important to note that the order of the quantifiers is
important, unless all the quantifiers are universal quantifiers or all
are existential quantifiers.
Example
predicate
Let P(x, y ) be the statement “x + y = y + x.” What are the truth
Quantified factors
values of the quantifications 8x8yP(x, y ) and 8y 8xP(x, y ) where
the domain for all variables consists of all real numbers?
domain

Solution:
I 8x8yP(x, y ) ) For all real numbers x, for all real numbers y ,
x + y = y + x. Because P(x, y ) is true for all real numbers x
and y (it is the commutative law for addition), the
proposition 8x8yP(x, y ) is true. g. (1
e + .
2 1) (pnq
= 2 + gup)
,
=

I 8y 8xP(x, y ) ) For all real numbers y , for all real numbers x,


x + y = y + x. 8x8yP(x, y ) and 8y 8xP(x, y ) have the same
meaning, and both are true.
71/80
The order of quantifiers

Example
Let Q(x, y ) denote “x + y = 0”. What are the truth values of
the quantifications 9y 8x Q(x, y ) and 8x9y Q(x, y ), where the
domain for all variables consists of all real numbers?
n ER
Solution: YER
9y 8x Q(x, y ) ) “There is a real number y such that for every
real number x, x + y = 0”.
No matter what value of y is chosen, there is ONLY ONE
value of x for which x + y = 0. Since there is no real number
y such that x + y = 0 for all real numbers x, the statement
9y 8x Q(x, y ) is false.

72/80
The order of quantifiers
8x9y Q(x, y ) ) “For every real number x, there is a real
number y such that x + y = 0”.
Given a real number x, there is a real number y such that
x + y = 0; i.e. y = x. Hence, the statement 8x9y Q(x, y ) is
true.

Remark
This example illustrates that the order in which quantifiers
appear makes a di↵erence. The statement 9y 8x P(x, y ) and
8x9y P(x, y ) are not logically equivalent, i.e.

9y 8x P(x, y ) 6⌘ 8x9y P(x, y )

73/80
The order of quantifiers

74/80
Translating Mathematical Statements into
Statements Involving Nested Quantifiers
Example
Translate the statement “The sum of two positive integers is
always positive” into a logical expression.
Solution
Let the domain for both variables consists of all integers.
Rewrite the statement:
“For every two integers, if these integers are both positive,
then the sum of these integers is positive.”
Introduce the variables x and y to obtain
“For all positive integers x and y , x + y is positive”.
Thus, we have
8x8y ((x > 0) ^ (y > 0) ! (x + y > 0)).
75/80
Translating Mathematical Statements into
Statements Involving Nested Quantifiers

Alternative Solution
Let the domain for both variables consists of all positive
integers.
Rewrite the statement:
“For every two positive integers, the sum of these integers is
positive.”
Thus, we have
8x8y (x + y > 0).

76/80
Translating from Nested Quantifiers into English
Example
so as
is
Translate the statement
every call)
or

Mere
8x (I (x) _ 9y (I (y ) ^ F (x, y )))
I (y) is "y has an
iPad"
into English, where I (x) is “x has an iPad,” F (x, y ) is “x and
y are friends,” and the domain for both x and y consists of all
students in UNIMAS.
Solution
For every student x in UNIMAS, x has an iPad or there is a
student y such that y has an iPad and x and y are friends.
OR
Every student in UNIMAS has an iPad or has a friend who has
an iPad.
77/80
T
Translating English Sentences into Logical mother
ACL

Expressions VE
daughter

-
for every
Y
Example
↑ 27 female
Express the statement “If a person is female and is a parent,
then this person is someone’s mother” as a logical expression
involving predicates, quantifiers with a domain consisting of all
people, and logical connectives. nE R

R ) all people
=

Solution
Rewrite the statement as “For every person x, if person x is
female and person x is a parent, then there exists a person y
such that that person x is the mother of person y ”.
↑ female
Let F (x) = “x is female”
parent
P(x) = “x is a parent”
M(x, y ) = “x is the mother of y ”
↓ mother
78/80
Translating English Sentences into Logical
Expressions IF
mother
u is a
h is a female mother
I
is a

↑ ↑ X of y
(someone

Thus, we have 8x((F (x) ^ P(x)) ! 9y M(x, y )).

We can move 9y to the left so that it appears just after 8x,


because y does not appear in F (x) ^ P(x). We obtain the
logically equivalent expression

8x9y ((F (x) ^ P(x)) ! M(x, y ))

79/80
Negating Nested Quantifiers
Statements involving nested quantifiers can be negated by
successively applying the rules for negating statements
involving a single quantifier.
Example
Express the negation of the statement 8x9y (xy = 1) so that
no negation precedes a quantifier.
- (nP(n) = Jn + P(x)
Solution In P(n)
7
= Xx > P(a)

(pg .
59/80)

¬8x9y (xy = 1) = 9x¬9y (xy = 1)
-

= 9x8y ¬(xy = 1)
= 9x8y (xy 6= 1)

80/80
Negating Nested Quantifiers
Statements involving nested quantifiers can be negated by
successively applying the rules for negating statements
involving a single quantifier.
Example
Express the negation of the statement 8x9y (xy = 1) so that
no negation precedes a quantifier.
Solution

¬8x9y (xy = 1) = 9x¬9y (xy = 1)


= 9x8y ¬(xy = 1)
= 9x8y (xy 6= 1)

80/80

You might also like