Chapter 1: The Foundations: Logic and Proofs: Discrete Mathematics and Its Applications
Chapter 1: The Foundations: Logic and Proofs: Discrete Mathematics and Its Applications
Chapter 1: The Foundations: Logic and Proofs: Discrete Mathematics and Its Applications
3
1.3 Predicates and Quantifiers
Example: 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)?
Solution: A(MATH1, CAMPUS1) – “MATH1 is connect to CAMPUS1”, false
A(MATH1, CAMPUS2) – “MATH1 is connect to CAMPUS2”, true
4
1.3 Predicates and Quantifiers
5
1.3 Predicates and Quantifiers
Example:
“ if x > 0 then x:= x + 1”
When the statement is encountered, the
value if x is inserted into P(x).
If P(x) is true, x is increased by 1.
If P(x) is false, x is not changed.
6
1.3 Predicates and Quantifiers
Quantifiers
Quantification: express the extent to which
a predicate is true over a range of
elements.
Universal quantification: a predicate is
true for every element under consideration
Existential quantification: a predicate is
true for one or more element under
consideration
A domain must be specified. 7
1.3 Predicates and Quantifiers
DEFINITION 1
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. We read xP(x) as “for all xP(x)” or “for
every xP(x).” An element for which P(x) is false is called a counterexample
of xP(x).
10
1.3 Predicates and Quantifiers
DEFINITION 2
The existential quantification of P(x) is the statement
“There exists an element x in the domain such that P(x).”
We use the notation xP(x) for the existential quantification of P(x). Here
is called the Existential Quantifier.
• The existential quantification xP(x) is read as
“There is an x such that P(x),” or
“There is at least one x such that P(x),” or
“For some x, P(x).”
11
1.3 Predicates and Quantifiers
Example: Let P(x) denote the statement “x > 3”. What is
the truth value of the quantification xP(x), where the
domain consists of all real numbers?
Solution: “x > 3” is sometimes true – for instance when
x = 4. The existential quantification is true.
xP(x) is false if and only if P(x) is false for every element
of the domain.
Example: Let Q(x) denote the statement “x = x + 1”. What
is the true value of the quantification xQ(x), where the
domain consists for all real numbers?
Solution: Q(x) is false for every real number. The existential
12
1.3 Predicates and Quantifiers
If the domain is empty, xQ(x) is false because there can
be no element in the domain for which Q(x) is true.
The existential quantification xP(x) is the same as the
disjunction P(x1) V P(x2) V … VP(xn)
Quantifiers
Statement When True? When False?
13
1.3 Predicates and Quantifiers
Uniqueness quantifier ! or 1
!xP(x) or 1P(x) states “There exists a unique x such that P(x) is
true.”
Quantifiers with restricted domains
Example: What do the following statements mean? The domain in
each case consists of real numbers.
x
< 0 (x2 > 0): For every real number x with x < 0, x 2 > 0. “The square of a
negative real number is positive.” It’s the same as x(x < 0 → x 2 > 0)
y ≠ 0 (y3 ≠ 0 ): For every real number y with y ≠ 0, y 3 ≠ 0. “The cube of every non-
zero real number is non-zero.” It’s the same as y(y ≠ 0 → y 3 ≠ 0 ).
z > 0 (z2 = 2): There exists a real number z with z > 0, such that z 2 = 2. “There is a
positive square root of 2.” It’s the same as z(z > 0 Λ z2 = 2):
14
1.3 Predicates and Quantifiers
Precedence of Quantifiers
and have higher precedence than all logical operators.
E.g. xP(x) V Q(x) is the same as ( xP(x)) V Q(x)
15
1.3 Predicates and Quantifiers
Translating from English into Logical Expressions
Example: Express the statement “Every student in this
class has studied calculus” using predicates and
quantifiers.
Solution:
If the domain consists of students in the class –
xC(x)
where C(x) is the statement “x has studied calculus.
If the domain consists of all people –
x(S(x) → C(x)
where S(x) represents that person x is in this class.
If we are interested in the backgrounds of people in subjects
besides calculus, we can use the two-variable quantifier Q(x,y) for
the statement “student x has studies subject y.” Then we would
replace C(x) by Q(x, calculus) to obtain xQ(x, calculus) or 16
17