DISCRETE
STRUCTURE
PREDICATES AND QUANTIFIER
Part 1
OVERVIEW
Predicate logic
Quantifiers
•Universal
•Existential
•Uniqueness
Domain / Universe of Discourse
Scope (bound and free)
Nested Quantifiers
PREDICATE LOGIC
x >3
x =y+3
x +y=3
PREDICATE LOGIC EXAMPLE #1
Let p(x) denote the statement “x > 3.”
What are the truth values of p(4) and p(2)?
PREDICATE LOGIC EXAMPLE #2
Let A(x) demote the statement “Computer x is
under attack by an intruder.”
Suppose that of the computers on campus
only CS2 and MATH1 are currently under
attack by intruders
What are truth values of A(CS1),A(CS2), and
A(MATH1)?
PREDICATE LOGIC EXAMPLE #3
Let Q(x,y) denote the statement “x = y + 3.”
What are the truth values of the proposition
Q(1,2) and Q(3,0)?
PREDICATE LOGIC EXAMPLE #4
Let A(c, n) denote the statement “Computer c
is connected to network n.” Where c is a
variable representing a computer and n is a
variable representing a network.
Suppose that the computer MATH1 is
connected to network CAMPUS2, but not to
network CAMPUS1
What are the values of A(MATH1, CAMPUS1)
and A(MATH1, CAMPUS2)?
PREDICATE LOGIC EXAMPLE #5
Let R(x, y, z) denote the statement “x + y =
z.”
When values are assigned to the variables x,
y, and z, this statement has a truth value.
What are the truth values of the propositions
R(1, 2, 3) and R(0, 0, 1)?
PREDICATE LOGIC EXAMPLE #6
We’ve seen this before:
if (x > 0) { x = x + 1; }
QUANTIFIERS
When considering P(x) what are all of the possible values of x?
We call that domain.
We use quantifiers to refer to a quantity of values in the domain
•Universal (∀) - P(x) is true for all values in the domain of discourse
•Existential (Ǝ) – P(x) is true for at least one value in the domain of
discourse
•Existential (Ǝ!) - P(x) is true for exactly one value in the domain of
discourse
UNIVERSAL QUANTIFIER
EXAMPLE
#1
Let P(x) be the statement "x + 1 > x.“
What is the truth value of the quantification
∀xP(x), where the domain consists of all real
numbers?
UNIVERSAL QUANTIFIER
EXAMPLE
#2statement "x < 2.“
Let Q(x) be the
What is the truth value of the quantification
xQ(x) where the domain consists of all real
numbers?
UNIVERSAL QUANTIFIER
EXAMPLE #3
Let P(x) is "x² > 0.“
What is the truth value of ∀xP(x) where the universe
of discourse consists of all integers?
∀xP(x) is the same as the conjunction P(x₁) ^ P(x₂)
^...^ P(xₙ)
Look at the case where x= 0
•x²=0 when x = 0
•x² is not greater than O when x = 0
We Just did a proof…
•A proof by counterexample.
UNIVERSAL QUANTIFIER
EXAMPLE
#4 value of ∀xP(x), where P(x)
What is the truth
is the statement "x² < 10" and the domain
consists of the positive integers not
exceeding 4?
• The statement ∀xP(x) is the same as the
conjunction P(1) ^ P(2) ^ P(3) ^ P(4)
UNIVERSAL QUANTIFIER
EXAMPLE
#5
What does the statement VxN(x) mean if N(x)
is "Computer x is connected to the network"
and the domain consists of all computers on
campus?
For every computer x on campus, computer x
is connected to the network.
Every computer on campus is connected to
the network.
EXISTENTIAL QUANTIFIER
Stated:
ƎxP(x): There exist an x such that P(x) is true
EXISTENTIAL QUANTIFIER
EXAMPLE
#1the statement "x > 3.“
Let P(x) denote
What is the truth value of the quantification
ƎxP(x), where the domain consists of all real
numbers?
EXISTENTIAL QUANTIFIER
EXAMPLE
#2the statement "x =x+ 1.“
Let Q(x) denote
What is the truth value of the quantification
ƎxQ(x), where the domain consists of all real
numbers? FALSE
EXISTENTIAL QUANTIFIER
EXAMPLE
• What is the#3
truth value of ƎxP(x), where P(x)
is the statement "x²> 10" and the universe of
discourse consists of the positive integers not
exceeding 4?
Domain? (1, 2, 3, 4)
The proposition ƎxP(x) is the same as the
disjunction P(1) V P(2) V P(3) V P(4).
TRUE
OTHER QUANTIFIER SYNTAK
Let P(x) be the statement that "x-1=0“
What's the truth value of ƎlxP(x) ?
Can be also be written as (Ǝ!xP(x-1=0))
QUANTIFIERS WITH RESTRICTED
DOMAINS EXAMPLE #1
∀<O (x² > 0)
What is the domain?
What is the predicate “function”
QUANTIFIERS WITH RESTRICTED
DOMAINS EXAMPLE #1
∀<O (x² > 0)
English: The square of a negative real number
is positive
QUANTIFIERS WITH RESTRICTED
DOMAINS EXAMPLE #2
∀y !=0 (y³ != 0)
English: The cube of every nonzero real number
is nonzero.
Math: ∀y(y != 0 → y³ ! = 0)
Note: The restriction of a universal
quantification is the same as the universal
quantification of a conditional statement.
QUANTIFIERS WITH RESTRICTED
DOMAINS EXAMPLE #3
Ǝz > 0 (z² = 4)
English: There is a positive square root of 4.
Math: Ǝz(z > O ^ z² = 4)
Note: The restriction of an existential
quantification is the same as the existential
quantification of a conjunction
ORDER OF PRECEDENCE
Quantifiers
Negation
Conjunction and Disjunction
Conditional and Biconditional
VARIABLE SCOPE
Ǝx(x + y = 1)
Which variables are free, and which are
bound?
VARIABLE SCOPE
Ǝx(P(x) ^ Q(x)) v ∀xR(x)
Which variables are free, and which are bound
VARIABLE SCOPE
public class Car
}
String color;
public static void setColor (String color)
{
this.color = color;
}
}
VARIABLE SCOPE
public class Car
}
String color;
public static void setColor (String c)
{
this.color = c;
}
}
NEGATING QUANTIFIERS
EXAMPLE
Let #1taken a course in calculus”
P(x) be “x has
The domain is “students in this class”
How do you pronounce this: ∀xP(x)
How do you negate it?
¬∀xP(x)
Ǝx ¬P(x)
NEGATING QUANTIFIERS
EXAMPLE
#2
Let Q(x) be "x has taken a course in calculus“
• The domain is "students in this class“
• How do you pronounce: Ǝx Q(x)
• How do you negate it?
¬Ǝx Q(x)
∀x ¬Q(x)
NEGATING QUANTIFIERS
EXAMPLE #2
NEGATING QUANTIFIERS
EXAMPLE
#2
What is the negation of each of the following
statements?
There is an honest politician
All Americans like cheeseburgers