Discrete Maths: Exercises & Solutions: Propositional Equivalences, Predicates and Quantifiers
Discrete Maths: Exercises & Solutions: Propositional Equivalences, Predicates and Quantifiers
Propositional Equivalences,
Predicates and Quantifiers
Propositional Equivalences
Introduction
An important type of step used in a mathematical argument is the replacement of a statement
with another statement with the same truth value. Because of this, methods that produce
propositions with the same truth value as a given compound proposition are used extensively in
the construction of mathematical arguments. Note that we will use the term “compound
proposition” to refer to an expression formed from propositional variables using logical
operators, such as p ∧ q.
DEFINITION 8 : A compound proposition that is always true, no matter what the truth values of
the propositional variables that occur in it, is called a tautology. A compound proposition that is
always false is called a contradiction.
EXAMPLE 1 : We can construct examples of tautologies and contradictions using just one
propositional variable. Consider the truth tables of p ∨¬p and p ∧¬p, shown in Table 1.
Because p ∨¬p is always true, it is a tautology. Because p ∧¬p is always false, it is a
contradiction.
Logical Equivalences
Compound propositions that have the same truth values in all possible cases are called logically
equivalent. We can also define this notion as follows.
Remark: The symbol ≡ is not a logical connective, and p ≡ q is not a compound proposition
but rather is the statement that p ↔ q is a tautology. The symbol⇔is sometimes used instead
of ≡ to denote logical equivalence.
One way to determine whether two compound propositions are equivalent is to use a truth
table. In particular, the compound propositions p and q are equivalent if and only if the columns
Page 2 of 14
EXAMPLE 2 : Show that ¬(p ∨ q) and ¬p ∧¬q are logically equivalent.
Solution: The truth tables for these compound propositions are displayed in Table 3. Because
the truth values of the compound propositions ¬(p ∨ q) and ¬p ∧¬q agree for all possible
combinations of the truth values of p and q, it follows that¬(p ∨ q) ↔ (¬p ∧¬q) is a
tautology and that these compound propositions are logically equivalent.
Solution: We construct the truth table for these compound propositions in Table 4. Because the
truth values of ¬p ∨ q and p → q agree, they are logically equivalent.
Page 3 of 14
Table 6 contains some important equivalences. In these equivalences, T denotes the compound
proposition that is always true and F denotes the compound proposition that is always false. We
can verify each of these using truth tables.
Page 4 of 14
Exercise
1. Show that ¬(¬p) and p are logically equivalent.
b) (p ∧ q) ∧ r ≡ p ∧ (q ∧ r).
Page 5 of 14
4. Show that each of these conditional statements is a tautology by using truth tables.
a) (p ∧ q) → p
b) p → (p ∨ q)
c) ¬p → (p → q)
Page 6 of 14
Predicates and Quantifiers
Introduction
Propositional logic, studied in Sections 1.1–1.3, cannot adequately express the meaning of all
statements in mathematics and in natural language. For example, suppose that we know that
Where MATH3 is one of the computers connected to the university network. Likewise, we
cannot use the rules of propositional logic to conclude from the statement
In this section we will introduce a more powerful type of logic called predicate logic. We will
see how predicate logic can be used to express the meaning of a wide range of statements in
mathematics and computer science in ways that permit us to reason and explore relationships
between objects. To understand predicate logic, we first need to introduce the concept of a
predicate. Afterward, we will introduce the notion of quantifiers, which enable us to reason
with statements that assert that a certain property holds for all objects of a certain type and with
statements that assert the existence of an object with a particular property.
Predicates
Statements involving variables, such as
are often found in mathematical assertions, in computer programs, and in system specifications.
These statements are neither true nor false when the values of the variables are not specified. In
this section, we will discuss the ways that propositions can be produced from such statements.
Page 7 of 14
The statement “x is greater than 3” has two parts. The first part, the variable x, is the subject of
the statement. The second part—the predicate, “is greater than 3”—refers to a property that the
subject of the statement can have. We can denote the statement “x is greater than 3” by P(x),
where P denotes the predicate “is greater than 3” and x is the variable. The statement P(x) is also
said to be the value of the propositional function P at x. Once a value has been assigned to the
variable x, the statement P(x) becomes a proposition and has a truth value. Consider Examples 1
and 2.
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.
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 MATH1 are currently under attack by intruders. What are
truth values of A(CS1), A(CS2), and A(MATH1)?
Solution: We obtain the statement A(CS1) by setting x = CS1 in the statement “Computer x is
under attack by an intruder.” Because CS1 is not on the list of computers currently under attack,
we conclude that A(CS1) is false. Similarly, because CS2 and MATH1 are on the list of
computers under attack, we know that A(CS2) and A(MATH1) are true.
We can also have statements that involve more than one variable. For instance, consider the
statement “x = y + 3.” We can denote this statement by Q(x, y), where x and y are variables and
Q is the predicate. When values are assigned to the variables x and y, the statement Q(x, y) has a
truth value.
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 in the statement Q(x, y). Hence, Q(1, 2) is the
statement “1 = 2 + 3,” which is false. The statement Q(3, 0) is the proposition “3 = 0 + 3,”
which is true.
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)?
Solution: Because MATH1 is not connected to the CAMPUS1 network, we see that A(MATH1,
CAMPUS1) is false. However, because MATH1 is connected to the CAMPUS2 network, we see
that A(MATH1, CAMPUS2) is true.
Page 8 of 14
In general, a statement involving the n variables x1, x2, . . . , xn can be denoted by
P(x1, x2, . . . , xn).
A statement of the form P(x1, x2, . . . , xn) is the value of the propositional function P at the n-
tuple (x1, x2, . . . , xn), and P is also called an n-place predicate or a n-ary predicate.
When this statement is encountered in a program, the value of the variable x at that point in the
execution of the program is inserted into P(x), which is “x > 0.” If P(x) is true for this value of x,
the assignment statement x := x + 1 is executed, so the value of x is increased by 1. If P(x) is
false for this value of x, the assignment statement is not executed, so the value of x is not
changed.
Quantifiers
When the variables in a propositional function are assigned values, the resulting statement
becomes a proposition with a certain truth value. However, there is another important way,
called quantification, to create a proposition from a propositional function. Quantification
expresses the extent to which a predicate is true over a range of elements. In English, the words
all, some, many, none, and few are used in quantifications. We will focus on two types of
quantification here: universal quantification, which tells us that a predicate is true for every
element under consideration, and existential quantification, which tells us that there is one or
more element under consideration for which the predicate is true. The area of logic that deals
with predicates and quantifiers is called the predicate calculus.
THE UNIVERSAL QUANTIFIER Many mathematical statements assert that a property is true for all
values of a variable in a particular domain, called the domain of discourse (or the universe of
discourse), often just referred to as the domain. Such a statement is expressed using universal
quantification. The universal quantification of P(x) for a particular domain is the proposition that
asserts that P(x) is true for all values of x in this domain. Note that the domain specifies the
possible values of the variable x. The meaning of the universal quantification of P(x) changes
when we change the domain. The domain must always be specified when a universal quantifier
is used; without it, the universal quantification of a statement is not defined.
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).
Page 9 of 14
The meaning of the universal quantifier is summarized in the first row of Table 1. We illustrate
the use of the universal quantifier in Examples.
EXAMPLE 6 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.
Remark: 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.
Besides “for all” and “for every,” universal quantification can be expressed in many other ways,
including “all of,” “for each,” “given any,” “for arbitrary,” “for each,” and “for any.”
Remark: It is best to avoid using “for any x” because it is often ambiguous as to whether “any”
means “every” or “some.” In some cases, “any” is unambiguous, such as when it is used in
negatives, for example, “there is not any reason to avoid studying.”
A statement ∀xP(x) is false, where P(x) is a propositional function, if and only if P(x) is not
always true when x is in the domain. One way to show that P(x) is not always true when x is in
the domain is to find a counterexample to the statement ∀xP(x). Note that a single
counterexample is all we need to establish that ∀xP(x) is false. Example 7 illustrates how
counter examples are used.
EXAMPLE 7 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.
Page 10 of 14
EXAMPLE 8 Suppose that P(x) is “x2 > 0.” To show that the statement ∀xP(x) is false where
the universe of discourse consists of all integers, we give a counterexample. We see that x = 0 is
a counterexample because x2 = 0 when x = 0, so that x2 is not greater than 0 when x = 0.
When all the elements in the domain can be listed—say, x1, x2, . . ., xn—it follows that the
universal quantification ∀xP(x) is the same as the conjunction
because this conjunction is true if and only if P(x1), P(x2), . . . , P (xn) are all true.
EXAMPLE 9 What is the truth value of ∀xP(x), where P(x) is the statement “x2 < 10” and the
domain consists of the positive integers not exceeding 4?
because the domain consists of the integers 1, 2, 3, and 4. Because P(4), which is the statement
“42 < 10,” is false, it follows that ∀xP(x) is false.
EXAMPLE 10 What does the statement ∀xN(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 ∀xN(x) means that for every computer x on campus, that computer x is
connected to the network. This statement can be expressed in English as “Every computer on
campus is connected to the network.”
THE EXISTENTIAL QUANTIFIER Many mathematical statements assert that there is an element
with a certain property. Such statements are expressed using existential quantification. With
existential quantification, we form a proposition that is true if and only if P(x) is true for at least
one value of x in the domain.
We use the notation ∃xP(x) for the existential quantification of P(x). Here ∃ is called the
existential quantifier.
Page 11 of 14
A domain must always be specified when a statement ∃xP(x) is used. Furthermore, the meaning
of ∃xP(x) changes when the domain changes. Without specifying the domain, the statement ∃
xP(x) has no meaning.
Besides the phrase “there exists,” we can also express existential quantification in many other
ways, such as by using the words “for some,” “for at least one,” or “there is.” The existential
quantification ∃xP(x) is read as
The meaning of the existential quantifier is summarized in the second row of Table 1. We
illustrate the use of the existential quantifier in Examples.
EXAMPLE 11 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?
Observe that the statement ∃xP(x) is false if and only if there is no element x in the domain for
which P(x) is true. That is, ∃xP(x) is false if and only if P(x) is false for every element of the
domain. We illustrate this observation in Example 12.
EXAMPLE 12 Let Q(x) denote the statement “x = x + 1.”What is the truth value of the
quantification ∃xQ(x), where the domain consists of all real numbers?
Solution: Because Q(x) is false for every real number x, the existential quantification of Q(x),
which is ∃xQ(x), is false.
Remark: Generally, an implicit assumption is made that all domains of discourse for quantifiers
are nonempty. 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.
When all elements in the domain can be listed—say, x1, x2, . . . , xn—the existential
quantification ∃xP(x) is the same as the disjunction
Page 12 of 14
EXAMPLE 13 What is 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?
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.
It is sometimes helpful to think in terms of looping and searching when determining the truth
value of a quantification. Suppose that there are n objects in the domain for the variable x. To
determine whether ∀xP(x) is true, we can loop through all n values of x to see whether P(x) is
always true. If we encounter a value x for which P(x) is false, then we have shown that ∀xP(x)
is false. Otherwise, ∀xP(x) is true. To see whether ∃xP(x) is true, we loop through the n values
of x searching for a value for which P(x) is true. If we find one, then ∃xP(x) is true. If we never
find such an x, then we have determined that ∃xP(x) is false. (Note that this searching procedure
does not apply if there are infinitely many values in the domain. However, it is still a useful way
of thinking about the truth values of quantifications.)
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)).
Page 13 of 14
Exercise 1.4
1. Let P(x) denote the statement “x ≤ 4.” What are these truth values?
a) P(0) b) P(4) c) P(6)
2. Let P(x) be the statement “the word x contains the letter a.” What are these truth values?
a) P(orange) b) P(lemon) c) P(true) d) P(false)
3. Let Q(x, y) denote the statement “x is the capital of y.” What are these truth values?
a) Q(Denver, Colorado)
b) Q(Detroit, Michigan)
c) Q(Massachusetts, Boston)
d) Q(NewYork, NewYork)
4. Let
P(x) be the statement “x spends more than five hours every weekday in class,” where the
domain for x consists of all students. Express each of these quantifications in English.
a) ∃xP(x) b) ∀xP(x)
5. LetN(x) be the statement “x has visited North Dakota,” where the domain consists of the
students in your school.
Express each of these quantifications in English.
a) ∃xN(x) b) ∀xN(x)
6. Translate
these statements into English, where C(x) is “x is a comedian” and F(x) is “x is
funny” and the domain consists of all people.
a) ∀x(C(x) → F(x)) b) ∀x(C(x) ∧ F(x))
c) ∃x(C(x) → F(x)) d) ∃x(C(x) ∧ F(x))
7.Let P(x) be the statement “x = x2.” If the domain consists of the integers, what are these truth
values?
a) P(0) b) P(1) c) P(2)
8. LetQ(x) be the statement “x + 1 > 2x.” If the domain consists of all integers, what are these
truth values?
a) Q(0) b) Q(−1) c) Q(1)
d) ∃xQ(x) e) ∀xQ(x)
8. Suppose the domain of the propositional functionP(x, y) consists of pairs x and y, where x is 1,
2, or 3 and y is 1, 2, or 3. Write out these propositions using disjunctions and conjunctions.
a) ∃x P(x, 3) b) ∀y P(1, y)
c) ∃y¬P(2, y) d) ∀x ¬P(x, 2)
Page 14 of 14