Section-1 5
Section-1 5
Section-1 5
5
Section Summary
Nested Quantifiers
Order of Quantifiers
Translating from Nested Quantifiers into English
Translating Mathematical Statements into Statements
involving Nested Quantifiers.
Translated English Sentences into Logical Expressions.
Negating Nested Quantifiers.
Nested Quantifiers
Nested quantifiers are often necessary to express the
meaning of sentences in English as well as important
concepts in computer science and mathematics.
Example: “Every real number has an inverse” is
x y(x + y = 0)
where the domains of x and y are the real numbers.
We can also think of nested propositional functions:
x y(x + y = 0) can be viewed as x Q(x) where Q(x) is
y P(x, y) where P(x, y) is (x + y = 0)
Thinking of Nested Quantification
Nested Loops
To see if xyP (x,y) is true, loop through the values of x :
At each step, loop through the values for y.
If for some pair of x andy, P(x,y) is false, then x yP(x,y) is false and both
the outer and inner loop terminate.
x y P(x,y) is true if the outer loop ends after stepping through each x.
To see if x yP(x,y) is true, loop through the values of x:
At each step, loop through the values for y.
The inner loop ends when a pair x and y is found such that P(x, y) is true.
If no y is found such that P(x, y) is true the outer loop terminates as x
yP(x,y) has been shown to be false.
x y P(x,y) is true if the outer loop ends after stepping through each x.
If the domains of the variables are infinite, then this process can not actually be
carried out.
Order of Quantifiers
Example: 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.”
∀x∀yP(x, y) and ∀y∀xP(x, y) have the same meaning, and
both are true.
Order of Quantifiers
EXAMPLE: 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).”
No matter what value of y is chosen, there is only one value of
x for which x + y = 0. 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.
Order of Quantifiers
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.
This example illustrates that the order in which
quantifiers appear makes a difference. The statements
∃y∀xP(x, y) and ∀x∃yP(x, y) are not logically equivalent.
Order of Quantifiers
EXAMPLE: 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,” is true.
Order of Quantifiers
The order of the quantification here is important, because
the quantification ∃z∀x∀yQ(x, y, z), which is the
statement
“There is a real number z such that for all real numbers x and
for all real numbers y it is true that x + y = z,”
is false, because there is no value of z that satisfies the
equation x + y = z for all values of x and y.
Questions on Order of Quantifiers
Example 1: Let U be the real numbers,
Define P(x,y) : x ∙ y = 0
What is the truth value of the following:
1. xyP(x,y)
Answer: False
2. xyP(x,y)
Answer: True
3. xy P(x,y)
Answer: True
4. x y P(x,y)
Answer: True
Questions on Order of Quantifiers
Example 2: Let U be the real numbers,
Define P(x,y) : x / y = 1
What is the truth value of the following:
1. xyP(x,y)
Answer: False
2. xyP(x,y)
Answer: False
3. xy P(x,y)
Answer: False
4. x y P(x,y)
Answer: True
Quantifications of Two Variables
Statement When True? When False
P(x,y) is true for every There is a pair x, y for
pair x,y. which P(x,y) is false.