0% found this document useful (0 votes)
17 views26 pages

Nestedquantifiers: Presenter Yukun Wang Computer Science and Technology

Uploaded by

frogboynayeem
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)
17 views26 pages

Nestedquantifiers: Presenter Yukun Wang Computer Science and Technology

Uploaded by

frogboynayeem
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/ 26

Nested Quantifiers

P r e s e n t e r : Yu k u n Wa n g

C o m p u t e r s c i e n c e a n d Te c h n o l o g y
1 Understanding
Statements Involving
Nested Quantifiers
Understanding Statements Involving Nested Quantifiers
Introduction
• Nested quantifiers, one quantifier is within the scope of another, such as
x y(x + y = 0),
note that everything within the scope of a quantifier can be thought of as a
propositional function.

•For example, x y(x + y = 0) is the same thing as xQ(x), where Q(x) is yP(x, y),
where P(x, y) is x + y = 0.
Understanding Statements Involving Nested Quantifiers
Nested Quantifiers
•To understand statements involving nested quantifiers, we need to unravel what
the quantifiers and predicates that appear mean. This is illustrated in Example 1.

Example 1:
•Assume that the domain for the variables x and y consists of all real numbers. The
statement x y(x + y = y + x) says that x + y = y + x for all real numbers x and y.
This is the commutative law for addition of real numbers.

•Likewise, the statement x y(x + y = 0) says that for every real number x there is
a real number y such that x + y = 0. This states that every real number has an
additive inverse.

•Similarly, the statement x y z(x + (y + z) = (x + y) + z) is the associative law for


addition of real numbers.
Thinking of Quantifiers as Loops

In working with quantifications of more than one variable, it is sometimes


helpful to think in terms of nested loops.

For example, to see whether x yP(x, y) is true, we loop through the values for x,
and for each x we loop through the values for y. If we find that for all values of x that
P(x, y) is true for all values of y, we have determined that x yP(x, y) is true. If we
ever hit a value x for which we hit a value y for which P(x, y) is false, we have
shown that x yP(x, y) is false.
2
The Order of Quantifiers
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.

These remarks are illustrated by Examples 2–4.


The Order of Quantifiers

Example 2: Let P(x, y) be the statement “x + y = y + x.” What are the truth values
of the quantifications x yP(x, y) and y xP(x, y), where the domain for all
variables consists of all real numbers?
Solution:
•The quantification x yP(x, y) denotes the proposition “For all real numbers x, for
all real numbers y, x + y = y + x.”
•P(x, y) is true for all real numbers x and y (the commutative law for addition), the
proposition x yP(x, y) is true.
•The statement y xP(x, y) says “For all real numbers y, for all real numbers x, x +
y = y + x.” This has the same meaning as the statement “For all real numbers x, for
all real numbers y, x + y = y + x.”
•The order of nested universal quantifiers in a statement without other quantifiers
can be changed without changing the meaning of the quantified statement.
The Order of Quantifiers

Example 3: Let Q(x, y) denote “x + y = 0.” What are the truth values of the
quantifications y xQ(x, y) and x yQ(x, y), where the domain for all variables
consists of all real numbers?

Solution:
• The quantification∃y∀xQ(x, y) denotes the proposition “There is a real number y such that for
every real number x, Q(x, y).”Because there is no real number y such that x + y = 0 for all real
numbers x, the statement ∃y∀xQ(x, y) is false.
•The quantification∀x∃yQ(x, y) denotes the proposition “For every real number x there is a real
number y such that Q(x, y).”Given a real number x, there is a real number y such that x + y = 0;
namely, y = −x. Hence, the statement ∀x∃yQ(x, y) is true.
•If ∃y∀xP(x, y) is true, then ∀x∃yP(x, y) must also be true. However, if ∀x∃yP(x, y) is true, it is not
necessary for ∃y∀xP(x, y) to be true.
•∀x∃yP(x, y) and ∃y∀xP(x, y) are different.
The Order of Quantifiers

Table 1. summarizes the meanings of the different possible quantifications


involving two variables.

TABLE 1 Quantifications of Two Variables.


Statement When True? When False?
∀x∀yP(x, y) P(x, y) is true for every pair x, y. There is a pair x, y for which P(x, y)
is false.
∀y∀xP(x, y)
∀x∃yP(x, y) For every x there is a y for which There is an x such that
P(x, y) is true. P(x, y) is false for every y.
∃x∀yP(x, y) There is an x for which P(x, y) is For every x there is a y for which
true for every y. P(x, y) is false.
∃x∃yP(x, y) There is a pair x, y for which P(x, y) P(x, y) is false for every pair x, y.
∃y∃xP(x, y) is true.
The Order of Quantifiers

Example 4: Let Q(x, y, z) be the statement “x + y = z.” What are the truth values
of the statements x y zQ(x, y, z) and z x yQ(x, y, z), where the domain of all
variables consists of all real numbers?

Solution:
• Suppose that x and y are assigned values. Then, there exists a real number z such
that x + y = z. Consequently, the quantification x y zQ(x, y, z),which is the
statement “For all real numbers x and for all real numbers y there is a real number z
such that x + y = z,”
3
Tr a n s l a t i n g S t a t e m e n t s I n v o l v i n g
Nested Quantifiers
Translating Statements involving Nested Quantifiers

Example 5:Translate the statement “The sum of two positive integers is always
positive” into a logical expression.

Solution:
•First rewrite it so that the implied quantifiers and a domain are shown: “For every
two integers, if these integers are both positive, then the sum of these integers is
positive.”
x y((x > 0) (y > 0) → (x + y > 0))
•Next, we introduce the variables x and y to obtain “For all positive integers x and
y, x + y is positive.”
x y(x + y > 0)
Translating from Nested Quantifiers into English

Expressions with nested quantifiers expressing statements in English can be


quite complicated.
The first step in translating such an expression is to write out what the
quantifiers and predicates in the expression mean. The next step is to express
this meaning in a simpler sentence.
This process is illustrated in Example 6.
Translating from Nested Quantifiers into English

Example 6:Translate the statement x(C(x) y(C(y) F(x, y)))

into English, where C(x) is “x has a computer,” F(x, y) is “x and y are friends,” and the
domain for both x and y consists of all students in your school.

Solution:
•The statement says that for every student x in your school, x has a computer or
there is a student y such that y has a computer and x and y are friends.
•In other words, every student in your school has a computer or has a friend who
has a computer.
Translating from Nested Quantifiers into English

Example 7:Translate the statement x y z((F(x, y) F(x, z) (y ≠ z)) → ¬F(y,


z)) into English, where F(a, b) means a and b are friends and the domain for x, y, and
z consists of all students in your school.

Solution:
•This expression says that if students x and y are friends, and students x and z are
friends, and furthermore,if y and z are not the same student, then y and z are not
friends.
• “There is a student x such that for all students y and all students z other than y, if x
and y are friends and x and z are friends, then y and z are not friends.”
•In other words, there is a student none of whose friends are also friends with each
other.
Translating English Sentences into Logical Expressions

In this section we show how to translate sentences into logical express-
ions using nested quantifiers.
Translating from Nested Quantifiers into English

Example 8: 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.

Solution:
• The statement can be expressed as “For every person x, if person x is female and
person x is a parent,then there exists a person y such that person x is the mother of
person y.”
•The propositional functions F(x) to represent “x is female,” P(x) to represent “x is a
parent,” and M(x, y) to represent “x is the mother of y.” The original statement can
be represented as x((F(x) P(x)) → yM(x, y)).
Translating from Nested Quantifiers into English

Solution:
•Using the null quantification rule, we can move y to the left so that it appears just
after x, because y does not appear in F(x) P(x). We obtain the logically
equivalent expression x y((F(x) P(x)) → M(x, y)).
Translating from Nested Quantifiers into English

Example 9: Use quantifiers to express the statement “There is a woman who has
taken a flight on every airline in the world.”

Solution:
•Let P(w, f) be “w has taken f ” and Q(f, a) be “f is a flight on a.” We can express
the statement as w a f(P(w, f) Q(f, a)), where the domains of discourse for w, f
, and a consist of all the women in the world, all airplane flights, and all airlines,
respectively.
3
Negating Nested Quantifiers
Negating Nested Quantifiers

Statements involving nested quantifiers can be negated by successively


applying the rules for Assessment negating statements involving a single
quantifier.
This is illustrated in Examples 10–11.
Negating Nested Quantifiers

Example 10: Express the negation of the statement x y(xy = 1) so that no


negation precedes a quantifier.

Solution:
•By successively applying De Morgan’s laws for quantifiers,we can move the
negation in ¬ x y(xy = 1) inside all the quantifiers.
•¬ x y(xy = 1) is equivalent to x¬ y(xy = 1), which is equivalent to x y¬(xy =
1).
•Because ¬(xy = 1) can be expressed more simply as xy ≠ 1, we conclude that our
negated statement can be expressed as x y(xy ≠ 1).
Negating Nested Quantifiers

Example 11: Use quantifiers to express the statement that “There does not exist a
woman who has taken a flight on every airline in the world.”
Solution:
• By Example 9, the statement can be expressed as ¬ w a f(P(w, f) Q( f, a)),
where P(w, f) is “w has taken f ” and Q( f, a) is “f is a flight on a.”
• By successively applying De Morgan’s laws for quantifiers to move the negation
inside successive quantifiers and by applying De Morgan’s law for negating a
conjunction in the last step,we have this sequence of statements:
Negating Nested Quantifiers

Solution:
• w¬ a f(P(w, f) Q( f, a)) ≡ w a¬ f(P(w, f) Q( f, a))
≡ w a f¬(P(w, f) Q( f, a))
≡ w a f(¬P(w, f) ¬Q( f, a)).
Exercise

Section 1.5 P57 T8,T24

You might also like