Predicates and Quantifiers
Predicates and Quantifiers
5
Section 1.4
Everystudent of this class is a
bright student
◦ Ahmad is a student of this class
◦ T/F ?
5>3
◦ T/F ?
x >3
◦ T/F ?
5>3
◦ T/F ?
x>3
◦ T/F ? Not a proposition
x>3
◦ Statement with variable
x>3
Statement with variable
Variable
◦x
Property
◦ “is greater than 3”
x>3
Statement with variable
Variable/Subject
◦x
Property/Predicate/Proposional
Function
◦ “is greater than 3”
x>3
◦ Statement with variable
Denoted by P(x)
◦ P denotes the predicate
“is greater than 3”
x>3 P(x)
◦ P denotes the
predicate “is greater
Variable
than 3”
◦x
P(4) T/F ?
Predicate
◦ “is greater than 3”
P(2) T/F ?
P(x):= x is a divisible by 5
◦ P(75) T/F ?
◦ P(73) T/F ?
P(x):= word x contains the letter n
◦ P(Naraan) T/F?
◦ P(Karachi) T/F?
Let A(x) denote 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.
◦ return false;
if (x%2 == 0) • IsEven (5)
◦ return true; T/F
else • IsEven (50)
◦ return false; T/F
Domain/Universe of Discourse
◦ Universal Quantifier
◦ Existential Quantifier
The universal quantification of
P(x) is the statement
◦ “P(x) for all values of x in the
domain.”
The universal quantification of
P(x) is the statement
◦ “P(x) for all values of x in the
domain.”
◦ “P(x) is TRUE for all values of x in
the domain.”
Thenotation ∀xP(x) denotes the
universal quantification of P(x).
◦ Here ∀ is called the universal
quantifier.
We read ∀xP(x) as “for all x P(x)”
or “for every x P(x).”
True
What does the statement ∀xN(x)
mean if N(x) is “Computer x is
connected to the network”?
◦ the domain consists of all computers
on campus
Whatdoes the statement ∀xN(x)
mean if N(x) is “Computer x is
connected to the network”?
◦ the domain consists of all computers
on campus
“Every
computer on campus is
connected to the network.”
What is the truth value of
◦ ∀x(x2 ≥ x)
if
the domain consists of all real
numbers?
What is the truth value of
◦ ∀x(x2 ≥ x)
if
the domain consists of all real
numbers?
False
What is the truth value of
◦ ∀x(x2 ≥ x)
if
the domain consists of all real
numbers?
0.5 is a
Counterexample
What is the truth value of
◦ ∀x(x2 ≥ x)
if the domain consists of all real
numbers?
What is the truth value of this
statement if the domain consists of
all integers?
What is the truth value of
◦ ∀x(x2 ≥ x)
if the domain consists of all real
numbers?
What is the truth value of this
statement if the domain consists of
all integers?
True
Let P(x) denote the statement
◦ “x > 3.”
Whatis the truth value of the
quantification ∃xP(x),
◦ where the domain consists of all real
numbers?
Let P(x) denote the statement
◦ “x > 3.”
Whatis the truth value of the
quantification ∃xP(x),
◦ where the domain consists of all real
numbers?
True
Let P(x) denote the statement
◦ “x > 3.”
Whatis the truth value of the
quantification ∃xP(x),
◦ where the domain consists of all real
numbers?
True
4 is a witness
Let Q(x) denote the statement
◦ “x = x + 1.”
Whatis the truth value of the
quantification ∃xQ(x),
◦ where the domain consists of all real
numbers?
Let Q(x) denote the statement
◦ “x = x + 1.”
Whatis the truth value of the
quantification ∃xQ(x),
◦ where the domain consists of all real
numbers?
False
Whatis the truth value of ∃xP(x),
where P(x) is the statement
◦ “x2 > 10”
◦ and the universe of discourse
consists of the positive integers not
exceeding 4?
Whatis the truth value of ∃xP(x),
where P(x) is the statement
◦ “x2 > 10”
◦ and the universe of discourse
consists of the positive integers not
exceeding 4?
True
Whatis the truth value of ∃xP(x),
where P(x) is the statement
◦ “x2 > 10”
◦ and the universe of discourse
consists of the positive integers not
exceeding 3?
False
Generally, an implicit assumption is
made that all domains of discourse for
quantifiers are nonempty. Note that if
the domain is empty, then ∀xP(x) is
true for any propositional function
P(x) because there are no elements x
in the domain for which P(x) is false.
Note that if the domain is empty,
then ∃xQ(x) is false whenever
Q(x) is a propositional function
because when the domain is
empty, there can be no element x
in the domain for which Q(x) is
true.
Rules of Inference for
Quantified Statements
Combining Rules of
Inference for Propositions
and Quantified Statements
Show that the premises “Everyone
in this discrete mathematics class
has taken a course in computer
science” and “Marla is a student in
this class” imply the conclusion
“Marla has taken a course in
computer science.”
Let D(x) denote
◦ “x is in this discrete mathematics
class,” and
Let C(x) denote
◦ “x has taken a course in computer
science.”
Show that the premises “A student
in this class has not read the
book,” and “Everyone in this class
passed the first exam” imply the
conclusion “Someone who passed
the first exam has not read the
book.”
Let C(x) be
◦ “x is in this class,”
B(x) be
◦ “x has read the book,” and
P (x) be
◦ “x passed the first exam.”
Universal Modus Ponens
...
Different Rules for Universal
& Existential Quantifiers
∀
• →
∃
• ∧
What do the statements
◦ ∀x < 0 (x2 > 0),
◦ ∀y = 0 (y3 = 0), and
◦ ∃z > 0 (z2 = 2)
mean, Where the domain in each
case consists of the real numbers?
∀x < 0 (x2 > 0) ∀x (x < 0 → x2 > 0)
∀y = 0 (y3 = 0) ∀y (y = 0 → y3 = 0)
“AllAmericans eat
cheeseburgers”?
◦ “Some American does not eat
cheeseburgers”
Whatare the negations of the
statements
◦ ∀x(x2 > x)
◦ ∃x(x2 = 2)
◦ ∀x(P(x)→Q(x))
¬∀x(x2 > x) ≡∃x(x2 ≤ x)
¬∃x(x2 = 2) ≡∀x(x2 ≠ 2)
¬∀x(P(x)→Q(x))≡∃x(P(x)∧¬Q(x))
Isn't it Fun !!!
Express the statement “Every
student in this class has studied
calculus ” using predicates and
quantifiers.
“Every student in this class has
studied calculus”.
◦ C(x):= “x has studied calculus.”
◦ Domain:= Students of this class
∀xC(x)
“Every student in this class has studied
calculus”.
◦ C(x):= “x has studied calculus”
◦ S(x):=“person x is in this class”
◦ Domain:= All human beings
∀x(S(x) → C(x))
“Some student in this class has
visited Mexico”
◦ M(x):= x has visited Mexico
◦ Domain:= Students of this class
∃xM(x)
“Some student in this class has visited
Mexico”
◦ M(x):= x has visited Mexico
◦ S(x):=“person x is in this class”
◦ Domain:= All human beings
∃x (S(x) ∧ M(x))
“Every student in this class has
visited either Canada or Mexico”
◦ ∀x (S(x) → (C(x) ∨ M(x)))
C(x)?
Usepredicates and quantifiers to
express the system specifications
◦ “Every mail message larger than one
megabyte will be compressed”
◦ “If a user is active, at least one
network link will be available”
“Every mail message larger than
one megabyte will be compressed”
◦ S(m, y):=“Mail message m is larger
than y megabytes,”
◦ C(m):=“Mail message m will be
compressed.”
“Every mail message larger than
one megabyte will be compressed”
S(m, y):=“Mail message m is larger than
y megabytes,”
C(m):=“Mail message m will be
compressed.”
◦ ∀m(S(m, 1) → C(m))
“If a user is active, at least one
network link will be available.”
A(u):=“User u is active,”
S(n, x):=“Network link n is in state
x,”
“If a user is active, at least one
network link will be available.”
A(u):=“User u is active,”
S(n, x):=“Network link n is in state
x,”
∃u A(u) → ∃n S(n, available)
“All lions are fierce.”
“Some lions do not drink coffee.”
∀x∃y(x + y = 0)
∀x∀y∀z(x+(y + z) = (x + y) + z)
P(x, y):= “x + y = y + x”
∀x∀yP(x, y) T/F?
∀y∀xP(x, y) T/F?
Critical when different Quantifiers
Q(x, y):=“x + y = 0”
∃y∀xQ(x, y) T/F?
∀x∃yQ(x, y) T/F?
Q(x, y, z):=“x + y = z”
∀x∀y∃zQ(x, y, z) T/F?
∃z∀x∀yQ(x, y, z) T/F?
Domain:=Real numbers
The sum of two positive integers
is always positive
The sum of two positive integers
is always positive
∀x∃y(B(x,y)∧∀z((z≠y)→¬B(x, z)))
“There is a woman who has taken a
flight on every airline in the world.”
P(w, f ):=“w has taken f ”
Q(f, a):=“f is a flight on a”
the domains of discourse for w, f , and
a consist of all the women in the
world, all airplane flights, and all
airlines, respectively
“There is a woman who has taken
a flight on every airline in the
world.”
P(w, f ):=“w has taken f ”
Q(f, a):=“f is a flight on a”
∃x¬∃y(xy = 1) ≡ ∃x∀y¬(xy = 1)
∃x∀y¬(xy = 1) ≡ ∃x∀y(xy ≠ 1)
“There does not exist a woman
who has taken a flight on every
airline in the world.”
RECALL
A[2]=52
A[9]=Inavlid
A[3]=26
A[0…9] such that
◦ ∃i A[i]=15
◦ Domain=???
A[0…9] such that
◦ ∃i A[i]=15
◦ Domain={0,1,2,3,…,9}
◦ Note that here we are quantifying the
position, not the value!
A[0…9] such that
◦ ∃i A[i]=15
◦ Domain={0,1,2,3,…,9}
A=〈0, 1, 2, 3, 4, 5, 6, 7, 8, 9〉
A[0…9] such that
◦ ∀i ∀ j ((i<j)A[i]<A[j])
◦ Domain={0,1,2,3,…,9}
A[0…9] such that
◦ ∀i ∀ j ((i<j)A[i]<A[j])
◦ Domain={0,1,2,3,…,9}
B=?
A=〈77, 63, 54, 51, 47, 43, 12, 9〉
B[1…8] such that
∀i ∃j (B[i]=A[j])
∀i (B[i]=A[j] →¬∃k (k≠i ∧ B[k]=A[j]))
◦ Domain for i, j, k={0,1,2,3,…,7}
B=Any permutation of A