CHAPTER 1 - LOGIC OF COMPOUND STATEMENTS 1.1 - Logical Form and Logical Equivalence Definition. A statement or proposition is a sentence that is either true or false, but not both. ex. 1 + 2 = 3 IS a statement 1 + 4 = 7 IS a statement x + 4 > 9 IS NOT a statement Let p and q be statements. Definition. The negation of p, denoted p is the statement It is not the case that p. ex. Let p = today is Saturday p = it is not Saturday ex. Let p = At least 10 inches of rain fell today p = less than 10 inches of rain fell today Definition. The conjunction of p and q, denoted p q is the statement p and q. [it is true when both p and q are true and false otherwise.] Definition. The disjunction of p and q, denoted p q is the statement p or q. [it is true when at least one of p, q is true and false otherwise.] ex. Let p = today is Friday, q = it is raining today, r = it is January ; p q = p q = p r = Definition. A statement form is an expression made up of statement variables (such as p, q) and logical connectives (such as,, ) that becomes a statement when actual statements are substituted for the compound statement. 1
2 CHAPTER 1 - LOGIC OF COMPOUND STATEMENTS ex. p q is a statement form. The order of operations is that is performed first: So p q is equivalent to ( p) q Let p = Jim is tall and q = Jim is heavy Translate: Jim is tall, but he is not heavy into logic: Translate: Jim is neither tall, nor is he heavy into logic: Note: p but q means p q and neither p nor q means ( p) ( q) Statements are always either true or false, so let s consider a truth table for an arbitrary p and q. p q p q p q p q p ( p) q Definition. The exclusive or of p and q, denoted p q is the statement that is true when exactly one of p, q is true and is false otherwise. ex. Let p = Jim is tall and q = Jim is heavy p q =
CHAPTER 1 - LOGIC OF COMPOUND STATEMENTS 3 p q p q p q (p q) (p q) (p q) p q Two statement forms are logically equivalent if and only if they have identical truth tables. If P and Q are logically equivalent, we write P Q. So p q (p q) (p q). p q p ( p) p q (p q) q p q Let p = it is January and q = the bus is late (p q) is It is January and the bus is late but what is (p q)? p q p q (p q) p q p q So (p q) p q and the above can be written as it is not January or the bus is not late. DeMorgan s Laws: (1) (p q) p q (2) (p q) p q ex. Use DeMorgan s Laws to write the negation of 1 < x 4
4 CHAPTER 1 - LOGIC OF COMPOUND STATEMENTS Let p = 1 < x and q = x 4 Then p q = 1 < x 4 And (p q) p q is 1 x or x 4 or simply 1 x or x > 4 Definition. A tautology is a statement that is always true and a contradiction is a statement that is always false. p p p p p p Let t be a tautology and c be a contradiction. p t p t c p c ex. (1.1, 25) Are (p q) r and p (q r) logically equivalent? To show two statements are not logically equivalent, we simply need to find one instance where the truth values differ: p q r p q (p q) r q r p (q r)
CHAPTER 1 - LOGIC OF COMPOUND STATEMENTS 5 1.2 - Conditional Statements Definition. If p, q are statements, then p q is a conditional statement that means if p then q. ex. If it is raining, then I will stay home. ex. Let p = I will win the lottery tomorrow and q = I will buy you all cars So p q means If I win the lottery tomorrow, then I will buy you all cars.. When is p q true? p q p q With p q, we typically call p the hypothesis or antecedent and q the conclusion or consequence. If the hypothesis is false, then the conditional statement is vacuously true. In terms of order of operations, is always performed first and is always performed last. ex. Is p q p true or false? p q q p q p p q p ex. Show p q p q. p q p q p p q Let p = You do not get to work on time and q = you are fired Then p q is If you do not get to work on time, then you are fired.
6 CHAPTER 1 - LOGIC OF COMPOUND STATEMENTS And p q is You get to work on time or you are fired. And (p q) is... (p q) ( p q) from above ( p) q DeMorgan p q simplified This is an alternate way to show a logical equivalence (but we could have used a truth table). Consider q p: p q p q q p So p q q p. Definition. The contrapositive of a conditional statement p q is the statement q p. The converse of p q is q p [note p q q p]. The inverse of p q is p q [note p q p q]. ex. If x is even, then x 2 is even. Contrapositive: If x 2 is not even, then x is not even. Converse: If x 2 is even, then x is even. Inverse: If x is not even, then x 2 is not even. Note: If p then q is equivalent to both p only if q and if not q then not p. ex. If it is raining then I will stay home is equivalent to it is raining only if I stay home. This is NOT the same as It is raining if I stay home. p only if q means p can take place only if q takes place also. If q does not take place, then p cannot take place. Definition. The biconditional statement p if and only if q, denoted p q, is true if both p, q have the same truth value and false otherwise. In other words: p q (p q) (q p).
CHAPTER 1 - LOGIC OF COMPOUND STATEMENTS 7 p q p q q p (p q) (q p) p q Sometimes we abbreviate if and only if with iff. p q means if p then q and also means p is a sufficient condition for q. p q means if not p then not q and also means p is a necessary condition for q. So p if and only if q means p is a necessary and sufficient condition for q. ex. (1.2, 40) Rewrite (p r) (q r) without using or. (p r) (q r) ( p r) ( q r) [ ] ( p r) ( q r) [( q r) ( p r) ] [ ] [ ] ( p r) ( q r) ( q r) ( p r) (p r) ( q r) (q r) ( p r) Definition. 1.3 - Valid and Invalid Arguments An argument is a sequence of statements, and an argument form is a sequence of statement forms. All statements in an argument and all statement forms in an argument for, except for the final one, are called premises or assumptions or hypotheses. The final statement or statement form is called the conclusion. An argument form is valid if no matter what statements are substituted for the statement variables in the premises, if the resulting premises are true, then the conclusion is also true. Note: In an argument, the word therefore is often abbreviated as ex. Here is an invalid argument: If it is raining, then I will stay home. I own a car. I will stay home. ex. Here is an example of a valid argument: p (q r) r p q.
8 CHAPTER 1 - LOGIC OF COMPOUND STATEMENTS p q r q r p (q r) r p r T T T T T F T F T T F F F T T F T F F F T F F F The rows are the critical rows - where the premises are both true and the conclusion must then be true to have the argument valid. Definition. An argument form consisting of two premises and a conclusion is called a syllogism. A syllogism of the form below is called modus ponens (method of affirming): If p then q If sin(2π) = 0 then sin(4π) = 0 p sin(2π) = 0 q. sin(4π) = 0. p q p q p q T T T F F T F F The row is the critical row. It is the row in which both premises are true and the conclusion in that row is also true. Hence the argument is valid. Definition. The modus tollens (method of denying) argument form is as follows: If p then q If sin(2π) = 0 then sin(4π) = 0 q sin(4π) 0 p. sin(2π) 0. It uses the logical equivalence: p q q p.
CHAPTER 1 - LOGIC OF COMPOUND STATEMENTS 9 A rule of inference is a form of argument that is valid (such as modus ponens and modus tollens). Here are some examples of rules of inference: generalization: p q p q p q specialization: p q p q p q elimination: p q p q q p p q transitivity: division into cases: p q q r p r p q p r q r r Contradiction Rule: If you can show that the supposition that statement p is false leads logically to a contradiction, then you can conclude that p is true. What does this means? Suppose p is some statement and we wish to determine whether p is true or false. We begin by assuming that p is false. If that leads to a contradiction, then the assumption was incorrect. Let c be a contradiction. p p c p c p T F F F So we have another rule of inference: contradiction rule: p c p
10 CHAPTER 1 - LOGIC OF COMPOUND STATEMENTS Ex. Suppose there is an island containing two types of people: knights who always tell the truth and knaves who always lie. You visit the island and are approached by two natives who speak to you as follows: A says B is a knight B says A and I are of opposite type. (1) Suppose A is a knight. (2) what A says is true. (3) B is also a knight. (4) what B says is true. (5) A and B are of opposite types. (6) We have a contradiction as A and B are both knights. (7) our original assumption was false. (8) A is not a knight. (9) A is a knave. (10) what A says is false. (11) B is not a knight. (12) B is a knave. Ex. (1.3, 6) Use a truth table to determine whether the argument form is valid: p q q p p q p q p q q p p q The argument is invalid.
Ex. (1.3, 38) You are now approached by two new natives: A says Both of us are knights B says A is a knave CHAPTER 1 - LOGIC OF COMPOUND STATEMENTS 11 (1) Suppose A is a knight. (2) what A says is true. (3) B is a knight. (4) what B says is true. (5) A is a knave. (6) we have a contradiction. (7) our original assumption, that A is a knight, was false. (8) A is a knave. (9) what A says is false. (10) both A and B are not knights. (11) what B said was true. (12) B is a knight.