Discrete_Structures_quantifiers (1)
Discrete_Structures_quantifiers (1)
(CUST) 1 / 26
Limitations of Propositional Logics
(CUST) 2 / 26
Predicates
Example 1: Let P(x) denote the statement x > 3. What are the truth
values of P(4) and P(2)?
Solution: We obtain the statement P(4) by setting x = 4 in the
statement x > 3. Hence, P(4), which is the statement 4 > 3, is true.
However, P(2), which is the statement 2 > 3, is false.
(CUST) 3 / 26
Examples of Propositional Truth Values
Example 2:
Let A(x) denote the statement ”Computer x is under attack by an intruder.”
Suppose that of the computers on campus, only CS2 and MATH are currently
under attack. What are the truth values of A(S1), A(CS2), and A(MATH)?
Solution: We obtain A(S1) by setting x = S1 in the statement ”Computer x is
under attack by an intruder.” Since S1 is not currently under attack, A(S1) is
false. As CS2 and MATH are under attack, A(CS2) and A(MATH) are true.
Example 3:
Let Q(x, y ) denote the statement ”x = y + 3.” What are the truth values of the
propositions Q(1, 2) and Q(3, 0)?
Solution: To obtain Q(1, 2), set x = 1 and y = 2. Thus, Q(1, 2) is the statement
1 = 2 + 3, which is false. For Q(3, 0), the statement is 3 = 0 + 3, which is true.
(CUST) 4 / 26
Example 4
(CUST) 5 / 26
Example 5
(CUST) 6 / 26
Example 6
if x > 0 then v := v + 1.
(CUST) 7 / 26
Quantifiers
(CUST) 8 / 26
Example 8
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?
Solution: Because P(x) is true for all real numbers x, the quantification
∀xP(x)
is true.
Note: The universal quantification of P(x) is the statement ”P(x) for all
values of x in the domain.” The notation ∀xP(x) denotes the universal
quantification of P(x). Here ∀ is called the universal quantifier. An
element for which P(x) is false is called a counterexample to ∀xP(x).
(CUST) 9 / 26
Examples of Universal Quantification
Example 9:
Let Q(x) be the statement ”x < 2.” What is the truth value of the quantification
∀xQ(x), where the domain consists of all real numbers?
Solution: Q(x) is not true for every real number x, because, for instance, Q(3) is
false. That is, x = 3 is a counterexample for the statement ∀xQ(x). Thus,
∀xQ(x)
is false.
Example 10:
Suppose that P(y ) is y > 0. To show that the statement ∀y P(y ) is false, where
the universe of discourse consists of all integers, we give a counterexample. We
see that y = 0 is a counterexample because 0 > 0 is false, so 0 is not greater
than 0.
(CUST) 10 / 26
Examples of Universal Quantification in Different Contexts
Example 11:
What does the statement ∀x(N(x)) mean if N(x) is ”Computer x is connected to
the network” and the domain consists of all computers on campus?
Solution: The statement ∀x(N(x)) means that for every computer x on campus,
that computer x is connected to the network. This can be expressed in English as
”Every computer on campus is connected to the network.”
Example 12:
What is the truth value of ∀x x 2 > x if the domain consists of all real numbers?
What is the truth value if the domain consists of all
integers?
Solution: The universal quantification ∀x x 2 > x , where the domain consists of
all real numbers, is false. For example, x = 0: 02 > 0 is false because 0 > 0 is
false. The inequality x 2 > x holds only for x > 1 or x < 0, so ∀x x 2 > x is false
in the real number domain.
However, if the domain consists of integers, ∀x x 2 > x is false.
(CUST) 11 / 26
Existential Quantification and Examples
Existential Quantification:
The existential quantification of P(x) is the proposition:
“There exists an element x in the domain such that P(x).”
We use the notation ∃x P(x) for the existential quantification of P(x). Here ∃ is
called the existential quantifier.
Example 13:
Let P(x) denote the statement “x > 3.” What is the truth value of the
quantification ∃x P(x), where the domain consists of all real numbers?
Solution: Because “x > 3” is sometimes true— for instance, when x = 4—the
existential quantification ∃x P(x) is true.
Example 14:
Let Q(x) denote the statement “x = x + 1.” What is the truth value of the
quantification ∃x Q(x), where the domain consists of all real numbers?
Solution: Because Q(x) is false for every real number x, the existential
quantification ∃x Q(x) is false.
(CUST) 12 / 26
Quantifiers Over Finite Domains
When the domain of a quantifier is finite, that is, when all its elements can
be listed, quantified statements can be expressed using propositional logic.
In particular, when the elements of the domain are x1 , x2 , . . . , xn , where n
is a positive integer, the universal quantification ∀x P(x) is the same as
the conjunction
What is the truth value of ∀x P(x), where P(x) is the statement x < 10
and the domain consists of the positive integers not exceeding 4?
(CUST) 14 / 26
Example 16
Solution: Because the domain is {1, 2, 3, 4}, the proposition ∃xP(x) is the
same as the disjunction
Because P(4), which is the statement ”42 > 10,” is true, it follows that
∃xP(x) is true.
(CUST) 15 / 26
Quantifiers with Restricted Domains
(CUST) 16 / 26
Example 17
What do the statements ∀x < 0(x 2 > 0), ∀y ̸= 0(y 3 ̸= 0), and
∃z > 0(z 2 = 2) mean, where the domain in each case consists of the real
numbers?
Solution: The statement ∀x < 0(x 2 > 0) states that for every real number
x with x < 0, x 2 > 0. That is, it states ”The square of a negative real
number is positive.” This statement is the same as ∀x(x < 0 → x 2 > 0).
The statement ∀y ̸= 0(y 3 ̸= 0) states that for every real number y with
y ̸= 0, we have y 3 ̸= 0. That is, it states ”The cube of every nonzero real
number is nonzero.” This statement is equivalent to ∀y (y ̸= 0 → y 3 ̸= 0).
Finally, the statement ∃z > 0(z 2 = 2) states that there exists a real
number z with z > 0 such that z 2 = 2. That is, it states ”There is a
positive square root of 2.” This statement is equivalent to
∃z(z > 0 ∧ z 2 = 2).
(CUST) 17 / 26
Precedence of Quantifiers
The quantifiers ∀ and ∃ have higher precedence than all logical operators
from propositional calculus. For example, ∀xP(x) ∨ Q(x) is the disjunction
of ∀xP(x) and Q(x). In other words, it means (∀xP(x)) ∨ Q(x) rather
than ∀x(P(x) ∨ Q(x)).
Binding Variables
When a quantifier is used on the variable x, we say that this occurrence of
the variable is bound. An occurrence of a variable that is not bound by a
quantifier or set equal to a particular value is said to be free. All the
variables that occur in a propositional function must be bound or set equal
to a particular value to turn it into a proposition. This can be done using
a combination of universal quantifiers, existential quantifiers, and value
assignments.
The part of a logical expression to which a quantifier is applied is called
the scope of this quantifier. Consequently, a variable is free if it is outside
the scope of all quantifiers in the formula that specify this variable.
(CUST) 18 / 26
Example 18
(CUST) 19 / 26
Definition
(CUST) 20 / 26
Negating Quantified Expressions
We will often want to consider the negation of a quantified expression. For
instance, consider the negation of the statement:
”Every student in your class has taken a course in calculus.”
This statement is a universal quantification, namely, ∀xP(x).
The negation of this statement is ¬∀xP(x), which is logically equivalent to
∃x¬P(x). That is, the negation of a universal quantification is an
existential quantification of the negation.
Where P(x) is the statement ”x has taken a course in calculus” and the
domain consists of the students in your class. The negation of this
statement is ”it is not the case that every student in your class has taken a
course in calculus.” This is equivalent to ”There is a student in your class
who has not taken a course in calculus.” And this is simply the existential
quantification of the negation of the original propositional function,
namely, ∃x¬P(x).
This example illustrates the following logical equivalence:
¬∀xP(x) ≡ ∃x¬P(x).
(CUST) 21 / 26
Negating Existential Quantification
¬∃xQ(x) ≡ ∀x¬Q(x).
(CUST) 22 / 26
De Morgan’s Laws for Quantifiers and Negating Quantified
Statements
Example 19:
1. ”There is an honest politician”
Let H(x) denote ”x is honest.” This statement is represented by ∃xH(x). Its
negation is ¬∃xH(x), which is equivalent to ∀x¬H(x). The negation can be
expressed as ”Every politician is dishonest.”
2. ”All Americans eat cheeseburgers”
Let C (x) denote ”x eats cheeseburgers.” This statement is represented by
∀xC (x). Its negation is ¬∀xC (x), which is equivalent to ∃x¬C (x). The negation
can be expressed as ”Some Americans do not eat cheeseburgers.”
(CUST) 23 / 26
Negating Quantified Statements (cont’d)
Example 20: What are the negations of the statements ∀x(x 2 > x) and
∃x(x 2 = 2)?
Solution: The negation of ∀x(x 2 > x) is the statement ∃x(x 2 ≤ x),
which is equivalent to ∃x(x ≥ 1). The negation of ∃x(x 2 = 2) is the
statement ∀x(x 2 ̸= 2). The specific values of these statements depend on
the domain.
Example 22: Show that ¬(∀xP(x) → Q(x)) and ∃x(P(x) ∧ ¬Q(x)) are
logically equivalent.
Solution: By De Morgan’s law for universal quantifiers, we know that
¬(∀xP(x) → Q(x)) and ∃x(¬(P(x) → Q(x))) are logically equivalent. By
the laws of logics, we know that ∃x(¬(P(x) → Q(x))) and
∃x(P(x) ∧ ¬Q(x)) are logically equivalent. Therefore, ¬(∀xP(x) → Q(x))
and ∃x(P(x) ∧ ¬Q(x)) are logically equivalent.
(CUST) 24 / 26
Expressing Universal Statements
Example 23: Express the statement ”Every student in this class has
studied calculus” using predicates and quantifiers.
Solution: First, we rewrite the statement so that we can clearly identify
the appropriate quantifiers to use. Doing so, we obtain: ”For every
student in this class, that student has studied calculus.”
Next, we introduce a variable x so that our statement becomes: ”For
every student x in this class, x has studied calculus.”
Continuing, we introduce C (x), which is the statement ”x has studied
calculus.” Consequently, if the domain for x consists of the students in the
class, we can translate our statement as: ∀xC (x).
(CUST) 25 / 26
Expressing Existential Statements
Example 24: Express the statements ”Some student in this class has
visited Mexico” and ”Every student in this class has visited either Canada
or Mexico” using predicates and quantifiers.
Solution: The statement ”Some student in this class has visited Mexico”
means that ”There is a student in this class with the property that the
student has visited Mexico.”
We can introduce a variable x, so that our statement becomes: ”There is
a student x in this class having the property that x has visited Mexico.”
This can be expressed using the existential quantifier as: ∃x(M(x)), where
M(x) is the predicate ”x has visited Mexico.”
The statement ”Every student in this class has visited either Canada or
Mexico” can be expressed as: ∀x(C (x) ∨ M(x)), where C (x) is the
predicate ”x has visited Canada” and M(x) is the predicate ”x has visited
Mexico.”
(CUST) 26 / 26