Chapter+1b+Nested Quantifiers 2
Chapter+1b+Nested Quantifiers 2
Discrete Structures
ITCP 213
Chapter 1
Nested Quantifiers
Nested quantifiers
Two quantifiers are nested if one is within the
scope of the other.
P(x,y)
Example:
x y (x + y = 0)
Q(x)
x Q(x)
Q(x) is y P(x,y)
P(x,y) is (x + y = 0)
1
Nested quantifiers (example)
Translate the following statement into English.
x y (x + y = y + x)
Domain: real numbers
Solution:
For all real numbers x and y, x + y = y + x.
2
Nested quantifiers (example)
Translate the following statement into English.
x y (x = - y)
Domain: real numbers
Solution:
For every real number x, there is a real
number y such that x = - y.
3
Nested quantifiers (example)
Translate the following statement into English.
x y ((x > 0) (y < 0) (xy < 0))
Solution:
For every real numbers x and y, if x is positive and y
is negative then xy is negative.
The product of a positive real number and a negative
real number is always a negative real number.
4
The order of quantifiers (example)
Assume P(x,y) is (xy = yx).
Translate the following statement into English.
x y P(x,y) domain: real numbers
Solution:
For all real numbers x, for all real numbers y,
xy = yx.
6
The order of quantifiers (example)
Assume P(x,y) is (xy = 6).
Translate the following statement into English.
x y P(x,y) domain: integers
Solution:
There is an integer x for which there is an integer
y that xy = 6.
11
Nested quantifiers (example)
Translate the following statement into a logical expression.
“The sum of two positive integers is always positive.”
Solution:
Translate it to a logical expression
“For all integers x, y, if x and y are positive, then x+y is
positive.”
16
Nested quantifiers (example)
Translate the following statement into a logical expression.
“Every real number except zero has a multiplicative inverse.”
A multiplicative inverse of a real number x is a real number y such that
xy = 1.
Solution:
Translate it to a logical expression
“For every real number x, if x != 0, then there is a real number
y such that xy = 1.”
19
Nested quantifiers (example)
Translate the following statement into English.
x (C(x) ∨ y (C(y) F(x,y)))
C(x): x has a computer.
F(x,y): x and y are friends.
Domain of x and y: all students
Solution:
“For every student x, x has a computer or there is a student y
such that y has a computer and x and y are friends.”
20
Nested quantifiers (example)
Translate the following statement into English.
x y z ((F(x,y) F(x,z) (y != z)) F(y,z))
F(x,y): x and y are friends.
Domain of x, y and z: all students
Solution:
“There is a student x such that for all students y and all
students z, if x and y are friends, x and z are friend and z
and y are not the same student, then y and z are not
friend.”
Solution:
Determine individual propositional functions
S(x): x is a student.
C(x): x is a computer science major.
T(x,y): x takes a course y.
Translate the sentence into logical expression
x ((S(x) C(x)) y T(x,y))
Domain of x: all people
Domain of y: all courses in mathematics
22
Nested quantifiers (example)
Translate the following statement into logical expression.
“Everyone has exactly one best friend. ”
Solution:
Determine individual propositional function
B(x,y): y is the best friend of x.
Express the English statement using variable and individual
propositional function
For all x, there is y who is the best friend of x and for every
person z, if person z is not person y, then z is not the best
friend of x.
Translate the sentence into logical expression
x y (B(x,y) z ((z != y) B(x,z))
Domain of x, y and z: all people
23
Nested quantifiers (example)
Translate the following statement into logical expression.
“There is a person who has taken a flight on every airline in the
world. ”
Solution:
Determine individual propositional function
F(x,f): x has taken flight f.
A(f,a): flight f is on airline a.
Translate the sentence into logical expression
x a f (F(x,f) A(f,a))
Domain of x: all people
Domain of f: all flights
Domain of a: all airlines
25
Nested quantifiers (example)
Translate the following statement into logical expression.
“There is a person who has taken a flight on every airline in the
world. ”
Solution:
Determine individual propositional function
R(x,f,a): x has taken flight f on airline a.
Translate the sentence into logical expression
x a f R(x,f,a)
Domain of x: all people
Domain of f: all flights
Domain of a: all airlines
26
Negating nested quantifiers
(example)
(∀xP(x)) ∃xP(x)
(∃xP(x)) ∀x(P(x))
What is the negation of the following statement?
∀x ∃ y (x = -y)
Solution:
∀x P(x) P(x) = ∃y (x = -y)
∃x P(x)
∃x (∃y (x = -y))
∃x (∀y (x = -y))
∃x ∀y (x != -y)
29
Negating nested quantifiers
(example)
Translate the following statement in logical expression?
“There is not a person who has taken a flight on every airline.”
Solution:
Translate the positive sentence into logical expression
∃ x ∀ a ∃f (F(x,f) A(f,a)) by previous example
F(x,f): x has taken flight f. A(f,a): flight f is on airline a.
Find the negation of the logical expression
∃ x ∀ a ∃f (F(x,f) A(f,a))
∀ x ∀ a ∃f (F(x,f) A(f,a))
∀ x ∃a ∃f (F(x,f) A(f,a))
∀ x ∃a ∀ f (F(x,f) A(f,a))
∀ x ∃a ∀f ( F(x,f) ∨ A(f,a))
30