Download Nested Quantifiers in Discrete Structures: Understanding Multiple Quantifiers and more Lecture notes Computer Science in PDF only on Docsity!
CSC102 - Discrete Structures By Mahwish Waqas
Department Of Computer Science, CUI
Lahore Campus
Course Outline
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
- ∀𝑥∀𝑦∀𝑧 𝑥 + 𝑦 + 𝑧 = 𝑥 + 𝑦 + 𝑧
- THINK QUANTIFICATION AS LOOPS
Nested Quantifiers Example
- Let Domain of 𝑥 is the students in this class Doamin of 𝑦 is the courses in software engineering 𝑄 𝑥, 𝑦 = “𝑥 takes course 𝑦”, true when 𝑥 takes course 𝑦, otherwise false. Translate the following logical expression:
- ∀𝑥∀𝑦𝑄 𝑥, 𝑦
- ∃𝑥∃𝑦𝑄(𝑥, 𝑦)
- ∀𝑥∃𝑦𝑄 𝑥, 𝑦
- ∃𝑥∀𝑦𝑄(𝑥, 𝑦)
Predicates - the meaning of multiple quantifiers
Statement When True? When False? ∀ x ∀ yP(x, y) ∀ y ∀ xP(x, y) P(x, y) is true for every pair x, y. There is a pair x, y for which P(x, y) is false. ∀ x ∃ yP(x, y) For every x there is a y for which P(x, y) is true. There is an x such that P(x, y) is false for every y. ∃ x ∀ yP(x, y) There is an x for which P(x, y) is true for every y. For every x there is a y for which P(x, y) is false. ∃ x ∃ yP(x, y) ∃ y ∃ xP(x, y) There is a pair x, y for which P(x, y) is true. P(x, y) is false for every pair x, y.
Example
- Let Q(x, y): “ 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?
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) .”
- 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.
Order of Quantifiers
- xy and xy are not equivalent!
- xy P(x,y)
- P(x,y) = (x+y == 0) is false
- xy P(x,y)
- P(x,y) = (x+y == 0) is true
Translating between English and Quantifiers
- Translate the statement “The sum of two positive integers is always positive” into a logical expression.
Translating between English and Quantifiers
- Translate the statement “The sum of two positive integers is always positive” into a logical expression.
- Solution:
- 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.”
- Next, introduce the variables x and y to obtain “For all positive integers x and y , x + y is positive.”
- Statement is ∀ x ∀ y((x > 0 ) ∧ (y > 0 ) → (x + y > 0 )),
- where the domain for both variables consists positive integers.
Translating between English and Quantifiers
- Translate the following statement into English ∀ x(C(x) ∨ ∃ y(C(y) ∧ F(x, y))) where C(x): “ x has a computer,” F(x, y): “ x and y are friends,” 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.
Negating Multiple Quantifiers
- Recall negation rules for single quantifiers:
- ¬x P(x) = x ¬P(x)
- ¬x P(x) = x ¬P(x)
- Essentially, you change the quantifier(s), and negate what it’s quantifying
- 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)
Chapter Reading
- Chapter 1 , Kenneth H. Rosen, Discrete Mathematics and Its Applications, Section 1.
Chapter Exercise (For Practice)
- Question # 1, 2, 3, 4, 8, 23, 24, 25, 26, 27, 30, 31, 39, 41