Docsity

Discrete Mathematics Exercises: Propositional Logic & Quantifiers, Summaries of Logic

Partial preview of the text

Download Discrete Mathematics Exercises: Propositional Logic & Quantifiers and more Summaries Logic in PDF only on Docsity!

Discrete Maths: Exercises & Solutions

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.

We begin our discussion with a classification of compound propositions according to their possible truth values.

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.

Tautologies and contradictions are often important in mathematical reasoning. Example 1 illustrates these types of compound propositions.

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.

DEFINITION 2 The compound propositions p and q are called logically equivalent if p ↔ q is a

tautology. The notation p ≡ q denotes that p and q are logically equivalent.

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

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.

Exercise

  1. Show that ¬ ( ¬ p) and p are logically equivalent. 2. Use truth tables to verify the commutative laws a) p ∨ q ≡ q ∨ p. b) p ∧ q ≡ q ∧ p. 3. Use truth tables to verify the associative laws a) (p ∨ q) ∨ r ≡ p ∨ (q ∨ r).

b) (p ∧ q) ∧ r ≡ p ∧ (q ∧ r).

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

“Every computer connected to the university network is functioning properly.”

No rules of propositional logic allow us to conclude the truth of the statement

“MATH3 is functioning properly,”

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

“CS2 is under attack by an intruder,”

where CS2 is a computer on the university network, to conclude the truth of

“There is a computer on the university network that is under attack by an intruder.”

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

“ x > 3 , ” “ x = y + 3,” “ x + y = z ,” and “computer x is under attack by an intruder,” and “computer x is functioning properly,”

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.

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.

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.

EXAMPLE 8 Suppose that P(x) is “ x^2 > 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 x^2 = 0 when x = 0, so that x^2 is not greater than 0 when x = 0.

Looking for counterexamples to universally quantified statements is an important activity in the study of mathematics, as we will see in subsequent sections of this book.

When all the elements in the domain can be listed—say, x 1, x 2 ,... , xn —it follows that the

universal quantification ∀ xP(x) is the same as the conjunction

P(x 1 ) ∧ P(x 2 ) ∧ · · · ∧ P(xn),

because this conjunction is true if and only if P(x 1 ), P(x 2 ),... , P (xn) are all true.

EXAMPLE 9 What is the truth value of ∀ xP(x) , where P(x) is the statement “ x^2 < 10” and the domain consists of the positive integers not exceeding 4?

Solution: The statement ∀ xP(x) is the same as the conjunction

P( 1 ) ∧ P( 2 ) ∧ P( 3 ) ∧ P( 4 ),

because the domain consists of the integers 1, 2, 3, and 4. Because P( 4 ) , which is the statement

“4^2 < 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.

DEFINITION 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 ∃ xP(x) for the existential quantification of P(x). Here ∃ is called the existential quantifier.

EXAMPLE 13 What is the truth value of ∃ xP(x) , where P(x) is the statement “ x^2 > 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

P( 1 ) ∨ P( 2 ) ∨ P( 3 ) ∨ P( 4 ).

Because P( 4 ) , which is the statement “4^2 > 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)).

Exercise 1.

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. Let N(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 = x^2 .” If the domain consists of the integers, what are these truth values? a) P( 0 ) b) P( 1 ) c) P( 2 )

d) P( − 1 ) e) ∃ xP(x) f ) ∀ xP(x)

8. Let Q(x) be the statement “ x + 1 > 2 x .” 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 function P(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 )