Professional Documents
Culture Documents
Department of Computer Science, CUI Lahore Campus: CSC102 - Discrete Structures by Mahwish Waqas
Department of Computer Science, CUI Lahore Campus: CSC102 - Discrete Structures by Mahwish Waqas
Lahore Campus
CSC102 - Discrete Structures
By
Mahwish Waqas
3/6/2021 CSC102 - Discrete Structures 2
Course Outline
• Nested Quantifiers
3/6/2021 CSC102 - Discrete Structures 3
Nested Quantifiers
• Two quantifiers are nested if one is within scope of other,
such as
∀x∃y(x + y = 0).
Nested Quantifiers
• ∀𝑥∃𝑦 𝑃(𝑥, 𝑦)
• “For all 𝑥, there exists a 𝑦 such that 𝑃(𝑥, 𝑦)”.
• Example:
• ∀𝑥∃𝑦 (𝑥 + 𝑦 = 0) where 𝑥 and 𝑦 are integers
• 𝑥𝑦 𝑃(𝑥, 𝑦)
• There exists an x such that for all 𝑦, 𝑃(𝑥, 𝑦) is true”
• Example: 𝑥𝑦 𝑥 × 𝑦 = 0
• ∀𝑥∀𝑦∀𝑧 𝑥 + 𝑦 + 𝑧 = 𝑥 + 𝑦 + 𝑧
• ∀𝑥∀𝑦𝑄 𝑥, 𝑦
• ∃𝑥∃𝑦𝑄(𝑥, 𝑦)
• ∀𝑥∃𝑦𝑄 𝑥, 𝑦
• ∃𝑥∀𝑦𝑄(𝑥, 𝑦)
3/6/2021 CSC102 - Discrete Structures 6
• 𝒙𝒚 𝑷(𝒙, 𝒚)
• 𝑃(𝑥, 𝑦) true for all x, y pairs.
• 𝒙𝒚 𝑷(𝒙, 𝒚)
• 𝑃(𝑥, 𝑦) true for at least one x, y pair.
• 𝒙𝒚 𝑷(𝒙, 𝒚)
• For every value of x we can find a (possibly different) y so that P(x,y) is
true.
• 𝒙𝒚 𝑷(𝒙, 𝒚)
• There is at least one x for which P(x,y) is always true.
3/6/2021 CSC102 - Discrete Structures 7
Example
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.
3/6/2021 CSC102 - Discrete Structures 10
Example
• 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).”
Order of Quantifiers
• xy P(x,y)
• P(x,y) = (x+y == 0) is true
3/6/2021 CSC102 - Discrete Structures 12
Example
𝑄 (𝑥 , 𝑦, 𝑧): x + y = z
Domain: Real numbers
• Examples:
• ¬(xy P(x,y)) = x ¬y P(x,y) = xy ¬P(x,y)
• ¬(xyz P(x,y,z)) = x¬yz P(x,y,z)
= xy ¬ z P(x,y,z) = xyz ¬P(x,y,z)
3/6/2021 CSC102 - Discrete Structures 18
Chapter Reading
• Chapter 1, Kenneth H. Rosen, Discrete Mathematics and
Its Applications, Section 1.5
3/6/2021 CSC102 - Discrete Structures 20