Professional Documents
Culture Documents
Predicate Logic and Quantifiers: Instructor: Engr. Iqra Saleem
Predicate Logic and Quantifiers: Instructor: Engr. Iqra Saleem
Lecture 04
Instructor: Engr. Iqra Saleem
Predicates
• P(x) : x>3.
• What are the truth value of P(4) and P(2)?
Solution
• Set variable x=4 P(4): 4>3 True
• x=2 P(2): 2>3 False
Example 2
• Q(x,y) : x = y+3.
• What are the truth value of Q(1,2) and Q(3,0)?
Solution:
• Set variables x and y
• x=1, y=2 Q(1,2): 1=2+3 False
• x=3, y=0 Q(3,0): 3=0+3 True
What are quantifiers?
• Quantifiers are words that refer to quantities such as “all” or “some” and they tell
for how many elements a given predicate is true
• Two types of quantifiers:
• 1. Universal quantifier (∀)
• 2. Existential quantifier (∃)
Universal quantifier
• The universal quantification of a predicate P(x) is the proposition “P(x) is true for
all values of x in the universe of discourse”
• We use the notation
∀xP(x)
• which can be read “for all x “
Universal quantifier (∀)
• Let p(x) be a predicate and D be the domain of x
• A universal statement is a statement of the form
∀x ∈ D, p(x)
• Forms:
• “p(x) is true for all values of x”
• “For all x, p(x)”
• “For each x, p(x)”
• “For every x, p(x)”
• “Given any x, p(x)”
• It is true if p(x) is true for each x in D;
• It is false if p(x) is false for at least one x in D
Existential quantifier (∃)
• Let Q(x, y, z) denote the statement “x 2 + y 2 = z 2”. What is the truth value of
Q(3, 4, 5)? What is the truth value of Q(2, 2, 3)? How many values of (x, y, z) make
the predicate true?
Solution
• Two quantifiers are nested if one is within the scope of the other.
• Example-1:
• ∀x ∃y (x+y=5)
• Here ‘∃’ (read as-there exists) and ‘∀’ (read as-for all) are quantifiers for variables
x and y.
Example 2
Express the statement “for every x and for every y, x + y > 10”
• Let P(x, y) be the statement x + y > 10 where the universe of discourse for x, y is
the set of integers.
• Answer: ∀x∀yP(x, y)
• we can also use the shorthand ∀x, yP(x, y)
Example 4
• Express the statement “there is a number x such that when it is added to any
number, the result is that number, and if it is multiplied by any number, the result
is x” as a logical expression.
Solution:
• Let P(x, y) be the expression “x + y = y”.
• Let Q(x, y) be the expression “xy = x”.
• Then the expression is ∃x∀y (P(x, y) ∧ Q(x, y))