L005: Rosen, 1.5 Nested Quantifiers

Discrete Structures
CMSC 2123
Introduction
EXAMPLE 1
EXAMPLE 2
Lecture 5
1.5 Nested Quantifiers
Express βˆ€π‘₯π‘₯βˆƒπ‘¦π‘¦(π‘₯π‘₯ + 𝑦𝑦 = 0) without the existential quantifier.
Solution: βˆ€π‘₯π‘₯βˆƒπ‘¦π‘¦(π‘₯π‘₯ + 𝑦𝑦 = 0) is the same as βˆ€π‘₯π‘₯π‘₯π‘₯(π‘₯π‘₯) where 𝑄𝑄(π‘₯π‘₯) is βˆƒπ‘¦π‘¦π‘¦π‘¦(π‘₯π‘₯, 𝑦𝑦)
and 𝑃𝑃(π‘₯π‘₯, 𝑦𝑦) = π‘₯π‘₯ + 𝑦𝑦 = 0
Translate βˆ€π‘₯π‘₯βˆ€π‘¦π‘¦((π‘₯π‘₯ > 0) ∧ (𝑦𝑦 < 0) β†’ π‘₯π‘₯π‘₯π‘₯ < 0)) into English.
Solution: This statement says that for every real number x and for every real
number y, if π‘₯π‘₯ > 0 and 𝑦𝑦 < 0, then π‘₯π‘₯π‘₯π‘₯ < 0. That is, this statement says that
for real numbers x and y, if x is positive and y is negative, then xy is negative.
The can be stated more succinctly as β€œThe product of a positive real number
and a negative real number is always a negative real number.
The Order of Quantifiers
EXAMPLE 3
Let 𝑃𝑃(π‘₯π‘₯, 𝑦𝑦) be the statement β€œπ‘₯π‘₯ + 𝑦𝑦 = 𝑦𝑦 + π‘₯π‘₯. " What are the truth values of
the quantifications βˆ€π‘₯π‘₯βˆ€π‘¦π‘¦π‘¦π‘¦(π‘₯π‘₯, 𝑦𝑦) and βˆ€π‘¦π‘¦βˆ€π‘₯π‘₯π‘₯π‘₯(π‘₯π‘₯, 𝑦𝑦) where the domain for all
variables consists of all real numbers.
Solution: The quantification
βˆ€π‘₯π‘₯βˆ€π‘¦π‘¦π‘¦π‘¦(π‘₯π‘₯, 𝑦𝑦)
denotes the proposition
β€œFor all real numbers x, for all real numbers y, π‘₯π‘₯ + 𝑦𝑦 = 𝑦𝑦 + π‘₯π‘₯.”
Because 𝑃𝑃(π‘₯π‘₯, 𝑦𝑦) is true for all real numbers x and y (it is the commutative law
for addition which is an axiom for the real numbers), the proposition
βˆ€π‘₯π‘₯βˆ€π‘¦π‘¦π‘¦π‘¦(π‘₯π‘₯, 𝑦𝑦) is true. Note that the statement βˆ€π‘¦π‘¦βˆ€π‘₯π‘₯π‘₯π‘₯(π‘₯π‘₯, 𝑦𝑦) says β€œFor all real
numbers y, for all real numbers x, π‘₯π‘₯ + 𝑦𝑦 = 𝑦𝑦 + π‘₯π‘₯.” This has the same meaning
as the statement β€œFor all real numbers x, for all real numbers y, π‘₯π‘₯ + 𝑦𝑦 = 𝑦𝑦 +
π‘₯π‘₯.” That is, βˆ€π‘₯π‘₯βˆ€π‘¦π‘¦π‘¦π‘¦(π‘₯π‘₯, 𝑦𝑦) and βˆ€π‘¦π‘¦βˆ€π‘₯π‘₯π‘₯π‘₯(π‘₯π‘₯, 𝑦𝑦) have the same meaning, and both
are true.
This illustrates the principle that the order of nested universal quantifiers in
a statement without other quantifiers can be changed without changing the
meaning of the quantified statement.
1
Discrete Structures
CMSC 2123
EXAMPLE 4
Lecture 5
1.5 Nested Quantifiers
Let 𝑄𝑄(π‘₯π‘₯, 𝑦𝑦) denote β€œπ‘₯π‘₯ + 𝑦𝑦 = 0.” What are the truth values of the
quantifications βˆƒπ‘¦π‘¦βˆ€π‘₯π‘₯π‘₯π‘₯(π‘₯π‘₯, 𝑦𝑦), where the domain for all variables consists of all
real numbers.
Solution: The quantification
βˆƒπ‘¦π‘¦βˆ€π‘₯π‘₯π‘₯π‘₯(π‘₯π‘₯, 𝑦𝑦)
denotes the proposition
β€œThere is a real number y such that for every real number x, 𝑄𝑄(π‘₯π‘₯, 𝑦𝑦).”
No matter what value of y is chosen, there is only one value of x for which π‘₯π‘₯ +
𝑦𝑦 = 0. Because there is no real number y such that π‘₯π‘₯ + 𝑦𝑦 = 0 for all real
numbers x, the statement βˆƒπ‘¦π‘¦βˆ€π‘₯π‘₯π‘₯π‘₯(π‘₯π‘₯, 𝑦𝑦) is false.
The quantification
βˆ€π‘₯π‘₯βˆƒπ‘¦π‘¦π‘¦π‘¦(π‘₯π‘₯, 𝑦𝑦)
denotes the proposition
β€œFor every real number x there is a real number y such that 𝑄𝑄(π‘₯π‘₯, 𝑦𝑦).”
Given a real number x, there is a real number y such that π‘₯π‘₯ + 𝑦𝑦 = 0; namely,
𝑦𝑦 = βˆ’π‘₯π‘₯. Hence, the statement βˆ€π‘₯π‘₯βˆƒπ‘¦π‘¦π‘¦π‘¦(π‘₯π‘₯, 𝑦𝑦) is true.
Example 4 illustrates that the order in which quantifiers appear makes a difference. The
statements βˆƒπ‘¦π‘¦βˆ€π‘₯π‘₯π‘₯π‘₯(π‘₯π‘₯, 𝑦𝑦) and βˆ€π‘₯π‘₯βˆƒπ‘¦π‘¦π‘¦π‘¦(π‘₯π‘₯, 𝑦𝑦) are not logically equivalent. The statement
βˆƒπ‘¦π‘¦βˆ€π‘₯π‘₯π‘₯π‘₯(π‘₯π‘₯, 𝑦𝑦) is true if and only if there is a y that makes 𝑃𝑃(π‘₯π‘₯, 𝑦𝑦) true for every x. So, for this
statement to be true, there must be a particular value of y for which 𝑃𝑃(π‘₯π‘₯, 𝑦𝑦) is true regardless of
the choice of x. On the other hand, βˆ€π‘₯π‘₯βˆƒπ‘¦π‘¦π‘¦π‘¦(π‘₯π‘₯, 𝑦𝑦) is true if and only if for every value of x there is
a value of y for which 𝑃𝑃(π‘₯π‘₯, 𝑦𝑦) is true. So, for this statement to be true, no matter which x you
choose, there must be a value of y (possibly depending of the x you choose) for which 𝑃𝑃(π‘₯π‘₯, 𝑦𝑦) is
true. In other words, in the second case, y can depend on x, whereas in the first case y is a
constant independent of x.
From these observations it follows that if βˆƒπ‘¦π‘¦βˆ€π‘₯π‘₯π‘₯π‘₯(π‘₯π‘₯, 𝑦𝑦) is true, then βˆ€π‘₯π‘₯βˆƒπ‘¦π‘¦π‘¦π‘¦(π‘₯π‘₯, 𝑦𝑦) must also be
true. However, if βˆ€π‘₯π‘₯βˆƒπ‘¦π‘¦π‘¦π‘¦(π‘₯π‘₯, 𝑦𝑦) is true, it is not necessary for βˆƒπ‘¦π‘¦βˆ€π‘₯π‘₯π‘₯π‘₯(π‘₯π‘₯, 𝑦𝑦) to be true.
2
Discrete Structures
CMSC 2123
Lecture 5
1.5 Nested Quantifiers
TABLE 1 Quantifications of Two Variables.
Statement
When True?
βˆ€π‘₯π‘₯βˆ€π‘¦π‘¦π‘¦π‘¦(π‘₯π‘₯, 𝑦𝑦)
𝑃𝑃(π‘₯π‘₯, 𝑦𝑦) is true for every pair x, y.
βˆ€π‘¦π‘¦βˆ€π‘₯π‘₯π‘₯π‘₯(π‘₯π‘₯, 𝑦𝑦)
βˆ€π‘₯π‘₯βˆƒπ‘¦π‘¦π‘¦π‘¦(π‘₯π‘₯, 𝑦𝑦)
For every π‘₯π‘₯ there is a 𝑦𝑦 for which
𝑃𝑃(π‘₯π‘₯, 𝑦𝑦) is true.
βˆƒπ‘₯π‘₯βˆ€π‘¦π‘¦π‘¦π‘¦(π‘₯π‘₯, 𝑦𝑦)
There is an x for which 𝑃𝑃(π‘₯π‘₯, 𝑦𝑦) is
true for every y.
βˆƒπ‘₯π‘₯βˆƒπ‘¦π‘¦π‘¦π‘¦(π‘₯π‘₯, 𝑦𝑦)
There is a pair π‘₯π‘₯, 𝑦𝑦 for which
βˆƒπ‘¦π‘¦βˆƒπ‘₯π‘₯π‘₯π‘₯(π‘₯π‘₯, 𝑦𝑦)
𝑃𝑃(π‘₯π‘₯, 𝑦𝑦) is true.
EXAMPLE 5
When False?
There is a pair x, y for which 𝑃𝑃(π‘₯π‘₯, 𝑦𝑦) is
false.
There is an x such that 𝑃𝑃(π‘₯π‘₯, 𝑦𝑦) is false
for every y.
For every x there is a y for which 𝑃𝑃(π‘₯π‘₯, 𝑦𝑦)
is false.
𝑃𝑃(π‘₯π‘₯, 𝑦𝑦) is false for every pair π‘₯π‘₯, 𝑦𝑦.
Let 𝑄𝑄(π‘₯π‘₯, 𝑦𝑦, 𝑧𝑧) be the statement β€œπ‘₯π‘₯ + 𝑦𝑦 = 𝑧𝑧.” What are the truth values of the
statements βˆ€π‘₯π‘₯βˆ€π‘¦π‘¦βˆƒπ‘§π‘§π‘§π‘§(π‘₯π‘₯, 𝑦𝑦, 𝑧𝑧) and βˆƒπ‘§π‘§βˆ€π‘₯π‘₯βˆ€π‘¦π‘¦π‘¦π‘¦(π‘₯π‘₯, 𝑦𝑦, 𝑧𝑧), where the domain of all
variables consists of all real numbers?
Solution: Suppose that π‘₯π‘₯ and 𝑦𝑦 are assigned values. Then, there exists a real
number 𝑧𝑧 such that π‘₯π‘₯ + 𝑦𝑦 = 𝑧𝑧. Consequently, the quantification
βˆ€π‘₯π‘₯βˆ€π‘¦π‘¦βˆƒπ‘§π‘§π‘§π‘§(π‘₯π‘₯, 𝑦𝑦, 𝑧𝑧)
which is the statement
β€œFor all real numbers x and for all real numbers y there is a real
number z such that π‘₯π‘₯ + 𝑦𝑦 = 𝑧𝑧. "
is true. The order of the quantification is important, because the
quantification
βˆƒπ‘§π‘§βˆ€π‘₯π‘₯βˆ€π‘¦π‘¦π‘¦π‘¦(π‘₯π‘₯, 𝑦𝑦, 𝑧𝑧)
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 π‘₯π‘₯ + 𝑦𝑦 = 𝑧𝑧.”
is false, because there is no value of z that satisfies the equation π‘₯π‘₯ + 𝑦𝑦 = 𝑧𝑧 for
all values of x and y.
3
Discrete Structures
CMSC 2123
Lecture 5
1.5 Nested Quantifiers
Translating Mathematical Statements into Statements Involving Nested Quantifiers
EXAMPLE 6
Translate the statement β€œThe sum of two positive integers is always positive”
into a logical expression.
Solution:
1. To translate this statement into a logical expression, we 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.”
2. Next, we introduce the variables x and y to obtain
β€œFor all positive integers x and y, π‘₯π‘₯ + 𝑦𝑦 is positive.”
3. We can express the foregoing as
βˆ€π‘₯π‘₯βˆ€π‘¦π‘¦((π‘₯π‘₯ > 0) ∧ (𝑦𝑦 > 0) β†’ (π‘₯π‘₯ + 𝑦𝑦 > 0))
where the domain for both variables consists of all integers.
4. Note that we could also translate this using the positive integers as
the domain. Then the statement β€œThe sum of two positive integers is
always positive” becomes β€œFor every two positive integers, the sum
of these integers is positive. We can express this as
βˆ€π‘₯π‘₯βˆ€π‘¦π‘¦(π‘₯π‘₯ + 𝑦𝑦 > 0).
4
Discrete Structures
CMSC 2123
Lecture 5
1.5 Nested Quantifiers
Translating from Nested Quantifiers into English
EXAMPLE 9
Translate the statement
βˆ€π‘₯π‘₯(𝐢𝐢(π‘₯π‘₯) ∨ βˆƒπ‘¦π‘¦π‘¦π‘¦(𝑦𝑦) ∧ 𝐹𝐹(π‘₯π‘₯, 𝑦𝑦)))
into English, where 𝐢𝐢(π‘₯π‘₯) is the β€œx has a computer,” 𝐹𝐹(π‘₯π‘₯, 𝑦𝑦) 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 English Sentences into Logical Expressions
EXAMPLE 11
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:
1. 𝐹𝐹(π‘₯π‘₯) β€œx is female.”
2. 𝑃𝑃(π‘₯π‘₯) β€œx is a parent.”
3. 𝑀𝑀(π‘₯π‘₯, 𝑦𝑦) β€œx is the mother of y.”
βˆ€π‘₯π‘₯(�𝐹𝐹(π‘₯π‘₯) ∧ 𝑃𝑃(π‘₯π‘₯)οΏ½ β†’ βˆƒπ‘¦π‘¦π‘¦π‘¦(π‘₯π‘₯, 𝑦𝑦))
or
βˆ€π‘₯π‘₯βˆƒπ‘¦π‘¦(�𝐹𝐹(π‘₯π‘₯) ∧ 𝑃𝑃(π‘₯π‘₯)οΏ½ β†’ 𝑀𝑀(π‘₯π‘₯, 𝑦𝑦))
EXAMPLE 13
Use quantifiers to express the statement β€œThere is a woman who has taken a
flight on every airline in the world.
Solution: Let 𝑃𝑃(𝑀𝑀, 𝑓𝑓) be β€œw has taken f” and 𝑄𝑄(𝑓𝑓, π‘Žπ‘Ž) be β€œf is a flight on a.”
We can express the statement as
βˆƒπ‘€π‘€βˆ€π‘Žπ‘Žβˆƒπ‘“π‘“(𝑃𝑃(𝑀𝑀, 𝑓𝑓) ∧ 𝑄𝑄(𝑓𝑓, π‘Žπ‘Ž)),
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.
5
Discrete Structures
CMSC 2123
Lecture 5
1.5 Nested Quantifiers
Negating Nested Quantifiers
TABLE 2 De Morgan’s Laws for Quantifiers (from section 1.3)
Negation Equivalent Statement When Is Negation True?
¬βˆƒπ‘₯π‘₯π‘₯π‘₯(π‘₯π‘₯)
βˆ€π‘₯π‘₯¬π‘ƒπ‘ƒ(π‘₯π‘₯)
For every x, 𝑃𝑃(π‘₯π‘₯) is false
¬βˆ€π‘₯π‘₯π‘₯π‘₯(π‘₯π‘₯)
EXAMPLE 14
EXAMPLE 15
βˆƒπ‘₯π‘₯¬π‘ƒπ‘ƒ(π‘₯π‘₯)
There is an π‘₯π‘₯, for which 𝑃𝑃(π‘₯π‘₯) is
false.
When False?
There is an π‘₯π‘₯, for
which 𝑃𝑃(π‘₯π‘₯) is true.
𝑃𝑃(π‘₯π‘₯) is true for every
x.
Express the negation of the statement βˆ€π‘₯π‘₯βˆƒπ‘¦π‘¦(π‘₯π‘₯π‘₯π‘₯ = 1) so that no negation
precedes a quantifier.
Solution: By successively applying De Morgan’s laws for quantifiers in Table 2
of Section 1.3, we can move the negation in ¬βˆ€π‘₯π‘₯βˆƒπ‘₯π‘₯(π‘₯π‘₯π‘₯π‘₯ = 1) inside all the
quantifiers. We find that ¬βˆ€π‘₯π‘₯βˆƒπ‘¦π‘¦(π‘₯π‘₯π‘₯π‘₯ = 1) is equivalent to βˆƒπ‘₯π‘₯¬βˆƒπ‘¦π‘¦(π‘₯π‘₯π‘₯π‘₯ = 1),
which is equivalent to βˆƒπ‘₯π‘₯βˆ€π‘¦π‘¦¬(π‘₯π‘₯π‘₯π‘₯ = 1). Because ¬(π‘₯π‘₯π‘₯π‘₯ = 1) can be
expressed more simply as π‘₯π‘₯π‘₯π‘₯ β‰  1, we conclude that our negated statement
can be expressed as βˆƒπ‘₯π‘₯βˆ€π‘¦π‘¦(π‘₯π‘₯π‘₯π‘₯ β‰  1)
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: This statement is the negation of the statement β€œThere is a woman
who has taken a flight on every airline in the world.” from Example 13. By
Example 13, our statement can be expressed as ¬βˆƒπ‘€π‘€βˆ€π‘Žπ‘Žβˆƒπ‘“𝑓�𝑃𝑃(𝑀𝑀, 𝑓𝑓) ∧
𝑄𝑄(𝑓𝑓, π‘Žπ‘Ž)οΏ½, where 𝑃𝑃(𝑀𝑀, 𝑓𝑓) be β€œw has taken f” and 𝑄𝑄(𝑓𝑓, π‘Žπ‘Ž) be β€œf is a flight on a.”
By successively applying De Morgan’s laws for quantifiers in Table 2 of Section
1.3 to move the negation inside successive quantifiers and by applying De
Morgan’s low for negating a conjunction in the last step, we find that our
statement is equivalent to each of the sequence of statements:
Statement
Justification
Original statement
¬βˆƒπ‘€π‘€βˆ€π‘Žπ‘Žβˆƒπ‘“𝑓�𝑃𝑃(𝑀𝑀, 𝑓𝑓) ∧ 𝑄𝑄(𝑓𝑓, π‘Žπ‘Ž)οΏ½
Table 2 Section 1.3 ¬βˆƒπ‘₯π‘₯π‘₯π‘₯(π‘₯π‘₯) ≑ βˆ€π‘₯π‘₯¬π‘ƒπ‘ƒ(π‘₯π‘₯)
βˆ€π‘€π‘€¬βˆ€π‘Žπ‘Žβˆƒπ‘“𝑓�𝑃𝑃(𝑀𝑀, 𝑓𝑓) ∧ 𝑄𝑄(𝑓𝑓, π‘Žπ‘Ž)οΏ½
Table 2 Section 1.3 ¬βˆ€π‘₯π‘₯π‘₯π‘₯(π‘₯π‘₯) ≑ βˆƒπ‘₯π‘₯¬π‘ƒπ‘ƒ(π‘₯π‘₯)
βˆ€π‘€π‘€βˆƒπ‘Žπ‘Ž¬βˆƒπ‘“𝑓�𝑃𝑃(𝑀𝑀, 𝑓𝑓) ∧ 𝑄𝑄(𝑓𝑓, π‘Žπ‘Ž)οΏ½
Table 2 Section 1.3 ¬βˆƒπ‘₯π‘₯π‘₯π‘₯(π‘₯π‘₯) ≑ βˆ€π‘₯π‘₯¬π‘ƒπ‘ƒ(π‘₯π‘₯)
βˆ€π‘€π‘€βˆƒπ‘Žπ‘Žβˆ€π‘“π‘“¬οΏ½π‘ƒπ‘ƒ(𝑀𝑀, 𝑓𝑓) ∧ 𝑄𝑄(𝑓𝑓, π‘Žπ‘Ž)οΏ½
Table 2 Section 1.2 ¬(𝒑𝒑 ∧ 𝒒𝒒) ≑ ¬π’‘𝒑 ∨ ¬π’’𝒒
βˆ€π‘€π‘€βˆƒπ‘Žπ‘Žβˆ€π‘“π‘“οΏ½¬π‘ƒπ‘ƒ(𝑀𝑀, 𝑓𝑓) ∨ ¬π‘„𝑄(𝑓𝑓, π‘Žπ‘Ž)οΏ½
This last statement states β€œFor every woman there is an airline such that for
all flights, this woman has not taken that flight or that flight is not on this
airline.”
6