0% found this document useful (0 votes)
2 views16 pages

Lec 10

The document discusses nested quantifiers in logic, explaining their definitions, combinations, and the significance of their order. It provides examples of truth values for various statements involving quantifiers and illustrates how to translate English statements into logical expressions. Additionally, it includes exercises to reinforce understanding of the concepts presented.

Uploaded by

pochinkisu075
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)
2 views16 pages

Lec 10

The document discusses nested quantifiers in logic, explaining their definitions, combinations, and the significance of their order. It provides examples of truth values for various statements involving quantifiers and illustrates how to translate English statements into logical expressions. Additionally, it includes exercises to reinforce understanding of the concepts presented.

Uploaded by

pochinkisu075
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/ 16

DISCRETE STRUCTURES AND THEORY OF LOGIC (BCS 303)

Lecture – 10

Introduction to Nested Quantifiers


Definition: Two quantifiers are said to be nested if one is within the scope of the other.
For example: ∀x ∃y Q(x, y)

Here, ∃ is within the scope of ∀

Note: Anything within a scope of the quantifier can be thought of as a propositional function.
∀x ∃y Q(x, y) ⇒ ∀x P(x)

P(x)
Different combinations of Nested Quantifiers
∀x ∀y Q(x, y) ∀x ∃y Q(x, y)
∃x ∃y Q(x, y) ∃y ∀x Q(x, y)
Order of quantifiers doesn't matter Order of quantifiers does matter

i.e. ∀x ∀y Q(x, y) ≡ ∀y ∀x Q(x, y)


and ∃x ∃y Q(x, y) ≡ ∃y ∃x Q(x, y)
Also, ∀x ∃y Q(x, y) ≠ ∃y ∀x Q(x, y)

Example 1: Let x and y be the real numbers and P(x, y) denotes "x + y = 0."
Find the truth values of
a. ∀x ∀y P(x, y)
b. ∀x ∃y P(x, y)
c. ∃y ∀x P(x, y)
d. ∃x ∃y P(x, y)
Solution:
Domain: All real numbers.
a) ∀x ∀y P(x,y)
This statement reads:
"For all real numbers x and y, x + y = 0."
Is it true?
No, this statement is false.
Example: If x = 1 and y = 2, then x + y = 1 + 2 = 3, which is not equal to 0.
Thus, ∀x ∀y P(x,y) is false.
b) ∀x ∃y P(x,y)
This statement reads:
"For every real number x, there exists a real number y such that x + y = 0."
Is it true?
Yes, this statement is true.
For every real number x, we can find a corresponding y = −x, such that x + (−x) = 0.
For example:
• If x = 1, y = −1.
• If x = −3, y = 3.
Thus, ∀x ∃y P(x,y) is true.

c) ∃y ∀x P(x,y)
This statement reads:
"There exists a real number y such that for every real number x, x + y = 0."
Is it true?
No, this statement is false.
It is asking whether there is some fixed real number y that, when added to every real number
x, will result in x + y = 0.
For example, if we take y = 1, then P(x,1) means x + 1= 0. But this is false for most values of
x, like x = 2, since 2 + 1 ≠ 0.
Therefore, ∃y ∀x P(x,y) is false.

d) ∃x ∃y P(x,y)
This statement reads:
"There exist some real numbers x and y such that x + y = 0."
Is it true?
Yes, this statement is true.
For example, take x = 1 and y = −1. Then x + y = 1 + (−1) = 0.
There are many such combinations of x and y that satisfy the condition.
Thus, ∃x ∃y P(x,y) is true.

Example 2: Let x and y be the real numbers and Q(x, y) denotes "x.y = 0." Find the
truth values of the following:
a) ∀x ∀y Q(x, y)
b) ∀x ∃y Q(x, y)
c) ∃y ∀x Q(x, y)
d) ∃x ∃y Q(x, y)
Solution: Domain: All real numbers.
a) ∀x ∀y Q(x,y)
This statement reads:
"For all real numbers x and y, x ⋅ y = 0."
Is it true?
No, this statement is false.
Example: Take x = 1 and y = 2. Then x ⋅ y = 1 ⋅ 2 = 2, which is not equal to 0.
Thus, ∀x ∀y Q(x,y) is false because not all combinations of x and y satisfy the condition.

b) ∀x ∃y Q(x,y)
This statement reads:
"For every real number x, there exists a real number y such that x ⋅ y = 0."
Is it true?
Yes, this statement is true.
For any real number x, we can always take y = 0, which makes x ⋅ y = 0 true.
For example:
• If x = 1, y = 0, then 1 ⋅ 0 = 0.
• If x = −2, y = 0, then −2 ⋅ 0 = 0.
Thus, ∀x ∃y Q(x,y) is true.

c) ∃y ∀x Q(x,y)
This statement reads:
"There exists a real number y such that for every real number x, x ⋅ y = 0."
Is it true?
Yes, this statement is true.
We need to find a real number y such that x ⋅ y = 0 for all real numbers x.
Take y = 0. Then for any x, x ⋅ 0 = 0, which makes the statement true.
Thus, ∃y ∀x Q(x,y) is true.

d) ∃x ∃y Q(x,y)
This statement reads:
"There exist some real numbers x and y such that x ⋅ y = 0."
Is it true?
Yes, this statement is true.
For example, take x =1 and y = 0. Then x ⋅ y = 1 ⋅ 0 = 0.
There are many such combinations of x and y that satisfy the condition.
Thus, ∃x ∃y Q(x,y) is true.
Example 3: Let Q(x, y, z) be the statement "x + y = z." What are the truth values of the
statements ∀x ∀y ∃z Q(x, y, z) and ∃z ∀x ∀y Q(x, y, z), where the domain of all variables
consists of all real numbers?
Solution:
(i) ∀x ∀y ∃z Q(x, y, z) ≡ ∀x ∀y ∃z (x + y = z)
This statement reads:
"For all real numbers x and for all real numbers y, there exists a real number z such that
x + y = z."
Is it true?
Yes, this statement is true.
For any real numbers x and y, we can always find a real number z such that z = x + y.
For example:
• If x =1 and y = −1, then z = 0 because 1 + (−1)= 0.
• If x = 2 and y = 3, then z = 5 because 2 + 3 = 5.
It is clear that for every combination of real numbers x and y, there is always a real number
z such that x + y = z.
Thus, ∀x ∀y ∃z Q(x,y,z) is true.

(ii) ∃z ∀x ∀y Q(x,y,z) ≡ ∃z ∀x ∀y (x+y=z)


This statement reads:
"There exists some real number z such that for all real numbers x and y, x + y = z."
Is it true?
No, this statement is false.
It is asking if there is a single real number z such that x + y = z for all real numbers x and y.
For example:
• Let z = 2.
For x = 1 and y = 1, x + y = 1 + 1 = 2, so x + y = z holds true for this particular
combination.
However, for x = 3 and y = 1, x + y = 3 + 1 = 4, which is not equal to z = 2.
Thus, there is no single real number z such that x + y = z holds for all values of x and y.
Therefore, ∃z ∀x ∀y Q(x,y,z) is false.

Example 4: Let Q(x,y) be the statement “x + y = x − y.” If the domain for both variables
consists of all integers, what are the truth values?
a) Q(1,1)
b) Q(2,0)
c) ∀y Q(1,y)
d) ∃x Q(x,2)
e) ∃x ∃y Q(x,y)
f) ∀x ∃y Q(x,y)
g) ∃y ∀x Q(x,y)
h) ∀y ∃x Q(x,y)
i) ∀x ∀y Q(x,y)
Solution:
Statement:
Q(x, y): x + y = x − y
Simplifying the equation:
x+y=x–y ⇒ y = −y
This is only true when y = 0. Thus, for Q(x,y) to be true, y must equal 0.

a) Q(1,1)
We evaluate Q(1,1):
1+1=1–1 ⇒ 2=0 (False)
Truth value: False

b) Q(2,0)
We evaluate Q(2,0)
2+0=2–0 ⇒ 2 = 2 (True)
Truth value: True

c) ∀y Q(1,y)
This statement says, "For all integers y, 1 + y = 1 − y."
As we know from simplifying Q(x,y), Q(1,y) is only true when y = 0. For any other y, the
equation is false.
Truth value: False

d) ∃x Q(x,2)
This statement says, "There exists an integer x such that x + 2 = x − 2."
Let's simplify:
x+2=x–2 ⇒ 2 = −2 (False)
There is no integer x that satisfies this, so the statement is false.
Truth value: False

e) ∃x ∃y Q(x,y)
This statement says, "There exist integers x and y such that x + y = x − y."
From our earlier analysis, Q(x,y) is only true when y = 0, regardless of the value of x. So there
exist such x and y (for example, x = 1, y = 0).
Truth value: True

f) ∀x ∃y Q(x,y)
This statement says, "For all integers x, there exists an integer y such that x + y = x − y."
Since Q(x,y) is only true when y = 0, for any integer x, we can choose y = 0 to satisfy the
equation.
Truth value: True

g) ∃y ∀x Q(x,y)
This statement says, "There exists an integer y such that for all integers x, x + y = x − y."
We know that Q(x,y) is only true when y = 0. If y = 0, the equation x + 0 = x − 0 holds true
for all x.
Truth value: True

Translating English Statements to Statements Involving Nested Quantifiers


It is not difficult to translate an English statement to its equivalent logical expression if we
follow the following steps:
Step 1: Read and understand the English statement given in the question.
Step 2: Find the domain of discourse according to the statement.
Step 3: Find the associated quantifiers.
Step 4: Rewrite the statement so that the domain of discourse and quantifiers are properly
visible.
Step 5: Finally, introduce the variables in the statement.

Example 1: Translate the statement "The sum of two positive integers is always
positive" into an equivalent logical expression.
Solution:
English Statement
"The sum of two positive integers is always positive."
Step 1: Read and understand the statement.
Step 2: Find the domain of discourse.
Let us suppose that the domain consists of all integers.
Step 3: Find the associated quantifiers.
"The sum of two positive integers is always positive."
∀ (for all) quantifier will be used.
Step 4: Rewrite the statement
Original statement -
"The sum of two positive integers is always positive."
Rewritten statement -
"For every two integers, if the two integers are positive then their sum is also
positive."
Step 5: Introduce variables.
Two variables are required to represent two integers.
Let us suppose that integers are represented by the variables x and y.
"For every two integers x and y, if x and y are positive then x + y is also positive."

Equivalent logical expression: ∀x ∀y ((x > 0) ^ (y > 0) → (x + y > 0))

Example 2: Every student of XYZ University has a computer or has friend who has a
computer.
Solution: Steps involved:
1. Decide the domain first
Students of XYZ University.
2. Decide the predicates and quantifiers
Let C(x) denote "x has a computer."
and F(x, y) denotes " x is a friend of y."
3. Rewrite the statement
For all students x at XYZ University, x has a computer or there exist some y such that y
has a computer and x and y are friends.
OR
Every student at XYZ University has a computer or has a friend who has a computer.
4. Translate the rewritten statement into logical expression
∀x (C(x) v ∃y(C(y) ^ F(x, y)))

Example 3: Translate each of these nested quantifications into an English statement


that expresses a mathematical fact. The domain in each case consists of all real
numbers.
a) ∃x ∀y (x+y = y)
b) ∀x ∀y (((x ≥ 0) ∧ (y < 0)) → (x −y>0))
c) ∃x ∃y (((x ≤ 0) ∧ (y ≤ 0)) ∧ (x −y>0))
d) ∀x ∀y((x= 0) ∧ (y= 0) ↔ (xy = 0))

(a) ∃x ∀y ( x + y = y )
"There exists a real number x such that for all real numbers y, x + y = y."

(b) ∀x ∀y ( ( ( x ≥ 0 ) ∧ ( y < 0 ) ) → ( x – y > 0 ) )


"For all real numbers x and y, if x is non-negative and y is negative, then x – y > 0."

(c) ∃x ∃y ( ( ( x ≤0 ) ∧ ( y ≤ 0 ) ) ∧ ( x – y > 0 ) )
"There exist real numbers x and y such that both x ≤ 0 and y ≤ 0 y, and x – y > 0."

(d) ∀x ∀y ( ( x = 0 ) ∧ ( y = 0 ) ↔ ( x.y = 0 ) )
"For all real numbers x and y, x = 0 and y = 0 if and only if x.y = 0."

Example 4: Translate each of these nested quantifications into an English statement


that expresses a mathematical fact. The domain in each case consists of all real
numbers.
a) ∃x ∀y (x.y = y)
b) ∀x ∀y (((x < 0) ∧ (y < 0)) → (x.y > 0))
c) ∃x ∃y ((x2 > y) ∧ (x < y))
d) ∀x ∀y ∃z (x + y = z)

(a) ∃x ∀y (x.y = y)
"There exists a real number x such that for all real numbers y, x.y = y."

(b) ∀x ∀y (((x<0) ∧ (y<0)) → (x.y > 0))


"For all real numbers x and y, if x is negative and y is negative, then x.y > 0."

(c) ∃x ∃y ((x2 > y) ∧ ( x < y ))


"There exist real numbers x and y such that x2 > y and x < y."

(d) ∀x ∀y ∃z (x + y = z)
"For all real numbers x and y, there exists a real number z such that x + y = z."
Rules of Inference for Quantified Statements

1. Universal Instantiation:
This rule is used to conclude that P(c) is true when ∀x P(x) is true.
∀x P(x)
∴ P(c)

Problem 1: Determine whether the argument "All students in this class understand
logic. David is a student in this class. Therefore, David understands logic." is correct
or not.
Solution: Let us assume that
P(x) denotes "x is a student in this class"
Q(x) denotes "x understands logic"
1. ∀x (P(x) → Q(x)) Premise
2. P(David) Premise
3. P (David) → Q(David) By Universal Instantiation from (1)
4. Q(David) By Modus Ponens from (2) and (3)

2. Universal Generalization:
This rule states that ∀x P(x) is true, given the premise, P(c) is true for an arbitrary c.
P(c) for an arbitrary c
∴ ∀x P(x)
In other words, if P(c) holds for any arbitrary element c, then we can conclude ∀x P(x).

Problem 2: Justify that if ∀x (P(x) → Q(x)) and ∀x (Q(x) → R(x)) are true, then ∀x (P(x) →
R(x)) is true, where the domain of all quantifiers are same.
Solution:
Let c be some arbitrary element.
1. ∀x (P(x) → Q(x)) Premise
2. ∀x(Q(x) → R(x)) Premise
3. P(c) → Q(c) By Universal Instantiation from (1)
4. Q(c) → R(c) By Universal Instantiation from (2)
5. P(c)→ R(c) Hypothetical Syllogism from (3) and (4)
6. ∀x(P(x) → R(x)) Universal Generalization from (5)
3. Existential Instantiation
This rule allows us to conclude that there is some element c for which P(c) is true when
∃xP(x) is true.
∃x P(x)
∴ P(c) for some c
In other words, if P holds for some element of the universe, then we can give that element a
name such as c. We have to select a c for which P(c) is true. c cannot be arbitrary.

4. Existential Generalization
This rule states that ∃x P(x) is true when for a particular element c, P(c) is true.
If we know for some element c in the domain, P(c) is true; we also know that ∃x P(x) is true.
P(c) for some element c
∴ ∃x P(x)

Problem 3: Show that if ∃x(P(x) ^ Q(x)) is true then ∃x P(x) ^ ∃x Q(x) is also true.
Solution:
1. ∃x (P(x) ^ Q(x)) Premise
2. P(c) ^ Q(c) Existential Instantiation from (1)
3. P(c) Simplification from (2)
4. ∃x P(x) Existential Generalization from (3)
5. Q(c) Simplification from (2)
6. ∃x Q(x) Existential Generalization from (5)
7. ∃x P(x) ^ Q(x) Conjunction from (4) and (6)

5. Universal Modus Ponens Rule


Universal modus ponens is the combination of two rules:
1. Universal Instantiation
2. Modus Ponens
According to the rule,
If ∀x(P(x) → Q(x)) is true and P(c) is true for some element c in the domain of universal
quantifier then Q(c) must also be true.
By Universal Instantiation
∀x(P(x) → Q(x)) P(c) → Q(c)
P(c) P(c)
∴ Q(c) ∴ Q(c)
Example:
All men are mortal
Socrates is a man
∴ Socrates is mortal

Let
P(x) denotes "x is a man"
Q(x) denotes "x is mortal"
1. ∀x(P(x) → Q(x)) Premise
2. P(Socrates) Premise
3. P(Socrates) → Q(Socrates) By Universal Instantiation from (1)
4. Q(Socrates) By Modus Ponens from (2) and (3)

6. Universal Modus Tollens


This rule combines universal instantiation and modus tollens.
∀x(P(x) → Q(x))
~ Q(c), c is the particular element in the domain
∴ ~P(c)

Example:
All parrots like fruit
Charlie does not like fruit
∴ Charlie is not a parrot.
Let
P(x) denotes "x is a parrot"
Q(x) denotes "x likes fruit"

1. ∀x(P(x) → Q(x)) Premise


2. ~Q(Charlie) Premise
3. P(Charlie) → Q(Charlie) By Universal Instantiation from (1)
4. ~P(Charlie) By Modus Tollens from (2) and (3)
Practice Problem:
For each of the following arguments, determine whether the argument is correct or
not.
1. Every computer science major takes discrete mathematics course. Ria is taking
discrete mathematics. Therefore, Ria is a computer science major.
2. Everyone who eats granola everyday is healthy. Linda is not healthy. Therefore,
Linda does not eat granola every day.
Solution 1:
C(x): "x is a computer science major"
D(x): "x takes a discrete mathematics course."
D(Ria): Ria is taking discrete mathematics.
C(Ria): Ria is a computer science major. (Conclusion)

1. ∀x(C(x)→D(x)) Premise
2. D(Ria) Premise
3. C(Ria) → D(Ria) By Universal Instantiation from (1)
4. C(Ria) Invalid Conclusion

Analysis:
This argument commits the fallacy of affirming the consequent. Just because Ria is taking
discrete mathematics doesn't necessarily mean she is a computer science major. There could
be students from other majors who also take discrete mathematics.
Conclusion: The argument is not correct.

Solution 2:
G(x): "x eats granola every day"
H(x): "x is healthy."
~H(Linda): Linda is not healthy.
~G(Linda): Linda does not eat granola every day. (Conclusion)
1. ∀x(G(x) → H(x)) Premise
2. ~H(Linda) Premise
3. G(Linda) → H(Linda) By Universal Instantiation from (1)
4. ~G(Linda) By Modus Tollens from (2) and (3)

Conclusion: The argument is correct.


Express each of these statements using predicates and quantifiers.
a. A passenger on an airline qualifies as an elite flyer if the passenger flies more than
25,000 miles in a year or takes more than 25 flights during that year.
Solution:
Predicates:
P(x): "x is a passenger."
M(x): "x flies more than 25,000 miles in a year."
F(x): "x takes more than 25 flights in a year."
E(x): "x qualifies as an elite flyer."
Logical Expression:
∀x ( P(x) → ( M(x) ∨ F(x) ) → E(x) )

b. A man qualifies for the marathon if his best previous time is less than 3 hours and
a woman qualifies for the marathon if her best previous time is less than 3.5 hours.
Solution:
Predicates:
M(x): "x is a man."
W(x): "x is a woman."
T(x,t): "The best previous time of person x is t."
Q(x): "x qualifies for the marathon."

Logical Expression:
∀x ( ( M(x) ∧ T(x,t) ∧ t<3 ) ∨ ( W (x) ∧ T(x,t) ∧ t<3.5 ) → Q(x) )
OR
M(x): "x is a man."
W(y): "y is a woman."
Tm(x): "The best previous time of man x is less than 3 hours."
Tw(y): "The best previous time of woman y is less than 3.5 hours."
Q(x): "x qualifies for the marathon."
logical expression:
∀x ( ( M(x) ∧ Tm(x) ) → Q(x) ) ∧ ∀y ( ( W(y) ∧ Tw(y) ) → Q(y) )
OR
∀x: For every individual x,
M(x): x is a man,
T(x,3): x's best previous time is less than 3 hours (for men),
Q(x): x qualifies for the marathon.
W(y): y is a woman,
T(y,3.5): y's best previous time is less than 3.5 hours (for women),
Q(y): y qualifies for the marathon.
Logical expression:
∀x ( ( M(x) ∧ T(x,3) ) → Q(x) ) ∧ ∀y ( ( W(y) ∧ T(y,3.5) ) → Q(y) )

c. A student must take at least 60 course hours, or at least 45 course hours and write
a master’s thesis, and receive a grade no lower than a B in all required courses, to
receive a master’s degree.
Solution:
T(x,h): "Student x has taken at least h course hours."
W(x): "Student x has written a master’s thesis."
G(x): "Student x has received a grade no lower than a B in all required courses."
M(x): "Student x receives a master’s degree."
Logical Expression:
∀x ( ( ( T(x,60) ∨ ( T (x,45) ∧ W(x) ) ) ∧ G(x) ) → M(x) )

d. There is a student who has taken more than 21 credit hours in a semester and
received all A’s.
Solution:
S(x): "x is a student."
C(x): "x has taken more than 21 credit hours in a semester."
A(x): "x has received all A’s in that semester."
Logical expression:
∃x ( S(x) ∧ C(x) ∧ A(x) )
OR
T(x): "x has taken more than 21 credit hours."
G(x): "x received all A’s."
Logical expression:
∃x ( T(x) ∧ G(x) )
OR
P(x): "x is a student."
T(x,y): "x has taken more than y credit hours in a semester."
A(x): "x has received all A's."
∃x: There exists a student x,
∃y: There exists a number of credit hours y
Logical Expression:
∃x ∃y ( P(x) ∧ T(x,y) ∧ (y>21) ∧ A(x) )
Express each of these system specifications using predicates, quantifiers, and logical
connectives.
a. At least one mail message, among the nonempty set of messages, can be saved if
there is a disk with more than 10 kilobytes of free space.
b. Whenever there is an active alert, all queued messages are transmitted.
c. The diagnostic monitor tracks the status of all systems except the main console.
d. Each participant on the conference call whom the host of the call did not put on
a special list was billed.

a) At least one mail message, among the nonempty set of messages, can be saved if
there is a disk with more than 10 kilobytes of free space.
Predicates:
• M(x): x is a mail message.
• S(x): x can be saved.
• D(y): y is a disk.
• F(y): Disk y has more than 10 kilobytes of free space.
Expression:
∃y ( D(y) ∧ F(y) ) → ∃x ( M(x) ∧ S(x) )
This means: If there exists a disk y with more than 10 KB of free space, then there exists at
least one mail message x that can be saved.

b) Whenever there is an active alert, all queued messages are transmitted.


Predicates:
• A: There is an active alert.
• Q(x): x is a queued message.
• T(x): x is transmitted.
Expression:
A → ∀x ( Q(x) → T(x) )
This means: If there is an active alert, then for all queued messages x, they are transmitted.

c) The diagnostic monitor tracks the status of all systems except the main console.
Predicates:
• T(x): The diagnostic monitor tracks system x.
• S(x): x is a system.
• C: The main console.
Expression:
∀x ( S(x) ∧ x ≠ C → T(x) )
This means: For all systems x, if x is a system and x is not the main console, then the
diagnostic monitor tracks x.

d) Each participant on the conference call whom the host of the call did not put on a
special list was billed.
Predicates:
• P(x): x is a participant on the conference call.
• H(x): The host put x on a special list.
• B(x): x was billed.
Expression:
∀x ( P(x) ∧ ¬H(x) → B(x) )
This means: For all participants x, if x is a participant and the host did not put x on the
special list, then x was billed.

You might also like