Вы находитесь на странице: 1из 14

Discrete and Combinatorial Mathematics, 5th ed., Ralph P.

Grimaldi

Chapter 2 Fundamentals of Logic


z Logic: rules to validate an argument is correct or not correct. z The logic of mathematics is applied to decide whether one statement follows from, or is a logical consequence of, one or more other statements.

2.1

Basic Connectives and Truth Tables

z Terminology: a) Assertions: in a form of sentences; b) Statements (Propositions): verbal or written assertions are declarative sentences that are either true or false but not both. z Example: we use the lowercase letters of the alphabet (such as p, q, and r) to represent these statements. p: Combinatorics is a required course for sophomores. q: Margaret Mitchell wrote Gone with the Wind. r: 2 + 3 = 5. z Example: we do not regard sentences such as the What a beautiful evening! exclamation or the command as statements. z The preceding statements represented by p, q, and r are considered to be primitive statements, for there is really no way to break them down into anything simpler. Get up and do your exercises.

Written by WWF; revised in 2004/10

Discrete and Combinatorial Mathematics, 5th ed., Ralph P. Grimaldi

z New statements can be obtained from primitive statements in two ways. a) Transform a given statement p into the statement p, which denotes its negation and is read Not p. (Negation statements) b) Combine two or more statements into a compound statement, using logical connectives. (Compound statements) z 4 logical connectives: a) Conjunction: The conjunction of the statements p, q is denoted by p q, which is read p and q. b) Disjunction: The expression p q denotes the disjunction of the statements p, q and is read p or q. c) Implication: we say that p implies q (write p q) is equal to If p, then q, p is sufficient for q, p is a sufficient condition for q, p only if q, q is necessary for p, and q is a necessary condition for p. The statement p is called the hypothesis of the implication; q is called the conclusion. d) Biconditional: The biconditional of two statements p, q, is denoted by p q (read p if and only if q or p is necessary and sufficient for q). z Example: p, q, and r are defined as above. a) p q : read Combinatorics is a required course for sophomores, and Margaret Mitchell wrote Gone with the Wind..

Written by WWF; revised in 2004/10

Discrete and Combinatorial Mathematics, 5th ed., Ralph P. Grimaldi

b) p q : read Combinatorics is a required course for sophomores, or Margaret Mitchell wrote Gone with the Wind.. c) p q : read If combinatorics is a required course for sophomores, then Margaret Mitchell wrote Gone with the Wind.. d) p q (or p iff q): Combinatorics is a required course for sophomores, if and only if Margaret Mitchell wrote Gone with the Wind.. z Inclusive and exclusive or (denoted by and ): We use the word or in the inclusive sense. The exclusive or is denoted by p q. The compound statement p q is true if one or the other but not both of the statements p and q is true. z Example: p q Combinatorics is a required course for sophomores, or Margaret Mitchell wrote Gone with the Wind, but not both.. z The judgment of the true or falsity of a (compound or negation) statement is dependent only on the true values of its component statements and can be investigated by truth tables as below for the negation and the different kinds of compound statements: p 0 1 p 1 0 p 0 0 1 1 q 0 1 0 1 pq pq pq pq pq 0 0 0 1 1 0 1 1 1 0 0 1 1 0 0 1 1 0 1 1

Written by WWF; revised in 2004/10

Discrete and Combinatorial Mathematics, 5th ed., Ralph P. Grimaldi

z Example 2.1: pages 49~50. z Example 2.2: pages 50~51. z Example 2.3: pages 51~52. (Especially focus on the decision (or selection) structure in computer programming.) z Note: In our everyday language, we often find situations where an implication is used when the intention actually calls for a biconditional. In scientific writing one must make every effort to be unambiguous when an implication is given, it ordinarily cannot, and should not, be interpreted as a biconditional. z Example 2.4: page 52. z Example 2.5: pages 52~53. z Example 2.6: page 53. z Definition 2.1: A compound statement is called a tautology if it is true for all truth value assignments for its component statements. If a compound statement is false for all such assignments, then it is called a contradiction. (The symbol T0 to denote any tautology and the symbol F0 to denote any contradiction.)

Written by WWF; revised in 2004/10

Discrete and Combinatorial Mathematics, 5th ed., Ralph P. Grimaldi

2.2

Logical Equivalence: The Laws of Logic

z In all areas of mathematics we need to know when the entities we are studying are equal or essentially the same. Our study of logic is often referred to as the algebra of propositions (as opposed to the algebra of real numbers). In this algebra we shall use the truth tables of the statements (propositions) to develop an idea of when two such entities are essentially the same. z Example 2.7: Evaluate the equivalence of the compound statements p q and p q. (Pages 55~56) z Definition 2.2: Two statements s1, s2 are said to be logically equivalent, and we write s1 s2, when the statements s1 is true (respectively, false) if and only if the statement s2 is true (respectively, false). (Note that when s1 s2 the statements s1 and s2 provide the same truth tables because s1, s2 have the same truth values for all choices of truth values for their primitive components.) z Example 2.8: page 57. (Note: the results are known as DeMorgans Laws) z Example 2.9: page 57. (Note: the Distributive Laws of over and over ) z The Laws of Logic: page 58. z Definition 2.3: Let s be a statement. If s contains no logical connectives other than and , then the dual of s, denoted sd, is the statement obtained from s by replacing each occurrence of and by and , respectively, and each occurrence of T0 and F0 by F0 and T0, respectively.

Written by WWF; revised in 2004/10

Discrete and Combinatorial Mathematics, 5th ed., Ralph P. Grimaldi

z Example: 1) If p is any primitive statement, then pd is the same as p that is, the dual of a primitive statement is simply the same primitive statement. And (p)d is the same as p. 2) The statements p p and p p are duals of each other whenever p is primitive and so are the statements p T0 and p F0. 3) Given the primitive statements p, q, r and the compound statement s: (p q) (r T0), we find that the dual of s is sd: (p q) (r F0).

z Theorem 2.1: (The Principle of Duality) Let s and t be statements that contain no logical connectives other than and . If s t, then sd td. z Note: Alternative way to derive a logical equivalence is to use a tautology of the form p q, in addition to using the truth table for proving p q. For example, page 60 Table 2.11 shows the logical equivalence of (rs) q (rs)q. Proving (rs)q (rs)q a tautology can also indicate the logical equivalence of (rs) q and (rs)q. z Two substitution rules: a) Suppose that the compound statement P is a tautology. If p is a primitive statement that appears in P and we replace each occurrence of p by the same statement q, then the resulting compound statement P1 is also a tautology.
Written by WWF; revised in 2004/10

Discrete and Combinatorial Mathematics, 5th ed., Ralph P. Grimaldi

b) Let P be a compound statement where p is an arbitrary statement that appears in P, and let q be a statement such that q p. Suppose that in P we replace one or more occurrences of p by q. Then this replacement yields the compound statement P1. Under these circumstances P1 P. z Example 2.10: page 60. z Example 2.11: page 61. z Example 2.13: pages 61~62. z Example 2.15: (pages 62~63.) Suppose p, q represent the statements. p: Today is Thanksgiving. q: Tomorrow is Friday. Then we obtain: a) (The implication: pq) If today is Thanksgiving, then tomorrow is Friday. (TRUE) b) (The contrapositive: qp) if tomorrow is not Friday, then today is not Thanksgiving. (Likewise TRUE) c) (The converse: qp) if tomorrow is Friday, then today is Thanksgiving. d) (The inverse: pq) if today is not Thanksgiving, then tomorrow is not Friday. Note: (pq) (qp), (qp) (pq). z Example 2.16: page 63. (Logic simplification) z Example 2.17: page 64. z Example 2.18: pages 64~65.

Written by WWF; revised in 2004/10

Discrete and Combinatorial Mathematics, 5th ed., Ralph P. Grimaldi

2.3

Logical Implication: Rules of Inference

z From the notion of a valid argument, we begin a formal study of what we shall mean by an argument and when such an argument is valid. z Consider the implication (p1p2p3pn) q. The statements p1, p2, p3, , pn are called the premises of the argument, and the statement q is the conclusion for the argument. z Example 2.19: pages 67~68. z Example 2.20: page 68. (we know that (p1p2)q is a valid argument, and we may say that the truth of the conclusion q is deduced or inferred from the truth of the premises p1, p2.) z Definition 2.4: If p, q are arbitrary statements such that pq is a tautology, then we say that p logically implies q and we write pq to denote this situation. z Note: 1) if p q, we have p q and q p. 2) if p q and q p, then we have p q. 3) p > q is used to indicate that pq is not a tautology so the given implication (namely, p q) is not a logical implication. (See the paragraphs in the middle of page 69.) z Example 2.21: page 69. z To prove the correctness of a statement, a great deal of the effort must put into constructing the truth tables. And since we want to avoid even larger tables, we are persuaded to develop a list of techniques called rules of inference that help us. (Please read the middle paragraphs of page 70.)
Written by WWF; revised in 2004/10

Discrete and Combinatorial Mathematics, 5th ed., Ralph P. Grimaldi

z Example 2.22: page 71. (the Rule of Detachment) z Example 2.23: page 72. (the Law of the Syllogism) z Example 2.24: pages 72~73. z Example 2.25: pages 73~74. (Modus Tollens: method of denying) z Example 2.26: page 75. (the Rule of Conjunction) z Example 2.28: pages 76~77. (the Rule of Contradiction) z Table 2.19: page 78. (Rules of Inference) z Example 2.31: page 79. z Note: [(p1p2p3 pn)(qr)] [(p1p2p3 pnq)r]. (pages 80~81) z Example 2.33: pages 81~82.

Written by WWF; revised in 2004/10

Discrete and Combinatorial Mathematics, 5th ed., Ralph P. Grimaldi

2.4

The Use of Quantifiers

z Definition 2.5: A declarative sentence is an open statement if 1) it contains one or more variables, and 2) it is not a statement, but 3) it becomes a statement when the variables in it are replaced by certain allowable choices. z Example: The number x + 2 is an even integer is an open statement and is denoted by p(x). The allowable choices for x is called the universe (set) for p(x). If x = 3, p(3) is a false statement. z Example: q(x,y): The numbers y + 2, x y, and x + 2y are even integers., then q(4,2) is true. z From the above examples, we can say for some x, p(x) (TRUE), or for all x, p(x) (FALSE). z Two types of quantifiers, which are called the existential and the universal quantifiers, can quantify the open statements p(x) and q(x,y). a) the existential quantifier (means for some x, for at least one x, or there exists an x such that): for some x, p(x) is denoted as x, p(x). b) the universal quantifier (means for all x, for any x, for each x, or for every x): for all x, all y is denoted by x y. z Example 2.36: pages 88~89. for some x, y, q(x,y) (TRUE),

Written by WWF; revised in 2004/10

Discrete and Combinatorial Mathematics, 5th ed., Ralph P. Grimaldi

z Note: x p(x) x p(x), but x p(x) does not logically imply x p(x). z Example 2.38: page 91 (the truth value of a quantified statement may depend on the universe prescribed). z Example 2.39: page 91. z Table 2.21 summarize and extend some results for quantifiers. z Definition 2.6: Let p(x), q(x) be open statements defined for a given universe. The open statements p(x) and q(x) are called (logically) equivalent, and we write x [p(x) q(x)] when the biconditional p(a) q(a) is true for each replacement a from the universe (that is, p(a) q(a) for each a in the universe). If the implication p(a) q(a) is true for each a in the universe (that is, p(a) q(a) for each a in the universe), then we write x [p(x) q(x)] and say that p(x) logically implies q(x). z Definition 2.7: For open statements p(x), q(x) defined for a prescribed universe and the universally quantified statement x [p(x) q(x)] we define: a) The contrapositive of x [p(x) q(x)] to be x [q(x) p(x)]. b) The converse of x [p(x) q(x)] to be x [q(x) p(x)]. c) The inverse of x [p(x) q(x)] to be x [p(x) q(x)]. z Example 2.40: page 93.

Written by WWF; revised in 2004/10

Discrete and Combinatorial Mathematics, 5th ed., Ralph P. Grimaldi

z Example 2.41: pages 93~94. z Example 2.42: page 94 (the existential quantifier x does not distribute over the logical connective ). z Table 2.22: Logical equivalences and logical implications for quantified statements in one variable. z Example 2.43: page 95. z Table 2.23: Rules for negating statements with one quantifier. z Example 2.45: page 97. z Example 2.46: page 97. z Example 2.48: page 98.

Written by WWF; revised in 2004/10

Discrete and Combinatorial Mathematics, 5th ed., Ralph P. Grimaldi

2.5 Quantifiers, Definitions, and the Proofs of Theorems


z In this section we shall combine some of the ideas we have already studied in the prior two sections. z The Rule of Universal Specification: If an open statement becomes true for all replacements by the members in a given universe, then that open statement is true for each specific individual member in that universe. (A bit more symbolically if p(x) is an open statement for a given universe, and if x p(x) is true, then p(a) is true for each a in the universe.) z Example 2.53(a): pages 106~107. z The Rule of Universal Generalization: If an open statement p(x) is proved to be true when x is replaced by any arbitrarily chosen element c from our universe, then the universally quantified statement x p(x) is true. Furthermore, the rule extends beyond a single variable. So if, for example, we have an open statement q(x,y) that is proved to be true when x and y are replaced by arbitrarily chosen elements from the same universe, or their own respective universes, then the universally quantified statement x y q(x,y) [or, x, y q(x, y)] is true. Similar results hold for the cases of three or more variables. z Example 2.54: page 111. z Example 2.55: page 111. z Example 2.56: page 112.

Written by WWF; revised in 2004/10

Discrete and Combinatorial Mathematics, 5th ed., Ralph P. Grimaldi

z The results of Example 2.54 and especially Example 2.56 lead us to believe that we can use universally quantified statements and the rules of inference including the Rules of Universally Specification and Universal Generalization to formalize and prove a variety of arguments and, hopefully, theorems. z Example: Definition 2.8, Theorem 2.2, etc.

Written by WWF; revised in 2004/10