Spring 2018
Summary Last time: Today: Logical connectives: not, and, or, implies Using Turth Tables to define logical connectives Logical equivalences, tautologies Some applications Proofs in propositional logic Reading: Chap. 1.1, 1.2, 1.3, 1.6
... unless I will get an A in CSE20, unless I get sick A = I will get an A in CSE20 ; B = I get sick A B A unless B F F??? F T??? T F??? T T??? A unless B has the same meaning as (A) A B; (B) A B; (C) ( A B); (D) A B; (E) None of the above
... unless I will get an A in CSE20, unless I get sick A = I will get an A in CSE20 ; B = I get sick A B A unless B F F??? F T??? T F??? T T??? A unless B has the same meaning as (A) A B; (B) A B; (C) ( A B); (D) A B; (E) None of the above ( A B): false if don t get sick, and still don t get an A A B: either I get an A or I get sick (or both)
Conditional statements in English Many equivalent ways to express the implication p q in English: If I become Chancellor, I will lower tuition and fees. if p then q q if p q when p p is a sufficient condition for q q is a necessary condition for p q unless p p implies q p only if q q follows from p
Conditional statements in English Many equivalent ways to express the implication p q in English: If I become Chancellor, I will lower tuition and fees. if p then q q if p q when p p is a sufficient condition for q q is a necessary condition for p q unless p p implies q p only if q q follows from p Double implication (p q) (p q) (q p) p if and only if q p is necessary and sufficient for q
Proving logical equivalence using Truth Tables Claim: A B (A B) Proof: We evaluate A B and (A B) by computing the truth value of each subexpession.
Proving logical equivalence using Truth Tables Claim: A B (A B) Proof: We evaluate A B and (A B) by computing the truth value of each subexpession. A B A B A B A B (A B) F F T T T F T F T T F F T F T F F T F T F T T F F F T F The columns for A B and (A B) are identical. (A B) and A B are logically equivalent. The negation of a disjunction is the conjunction of the negations
Logical identities De Morgan (and): (A B) A B De Morgan (or): (A B) A B Double negation: ( A) A Commutativity (and): A B B A Commutativity (or): A B B A Associativity (and): A (B C) (A B) C Associativity (or): A (B C) (A B) C Distributivity... All very useful to simplify logical expressions: ( A B) A B A B
Precedence and Associativity What does p q mean? (A) ( p) q (B) (p q) (C) Both, they are logically equivalent (D) It depends on the choice of p and q.
Precedence and Associativity What does p q mean? (A) ( p) q (B) (p q) (C) Both, they are logically equivalent (D) It depends on the choice of p and q. The standard answer is (A), but the choice is purely conventional. Similarly, you may ask if p q r means p (q r) or (p q) r. ( right or left associativity.)
Standard precedence rules From highest to loswer precedence: So, p q p q p means So, (p q) (p (( q) p)). Similar to usual arithmetic precedence rules: 5 6 2 + 4 means (5 (6 2 )) + 4. p q and x y are usually considered right associative: p q r p (q r), 3 45 = 3 (45).
Branching Conditional if X then Y else Z X Y Z if X then Y else Z.........???.........??? Question: How many rows in the truth table? (A) 4 (B) 6 (C) 8 (D) 9 (E) None of the above
Branching Truth table for if X then Y else Z X Y Z (A) (B) (C) (D) F F F F F F F F F T F T T F F T F T F F F F T T T T T F T F F F F F T T F T F T F T T T F T F T T T T T T T T T
Branching Truth table for if X then Y else Z X Y Z (A) (B) (C) (D) F F F F F F F F F T F T T F F T F T F F F F T T T T T F T F F F F F T T F T F T F T T T F T F T T T T T T T T T Answer: (C)
Branching Can you express if X then Y else Z in terms of the other connectives? (A) (X Y ) ( X Z) (B) (X Y ) ( X Z) (C) These are both valid answers (D) None of the above
Branching Can you express if X then Y else Z in terms of the other connectives? (A) (X Y ) ( X Z) (B) (X Y ) ( X Z) (C) These are both valid answers (D) None of the above I think the correct answer is (B). How can we check?
Branching Can you express if X then Y else Z in terms of the other connectives? (A) (X Y ) ( X Z) (B) (X Y ) ( X Z) (C) These are both valid answers (D) None of the above I think the correct answer is (B). How can we check? Let s draw a truth table
Tautologies A logical statement is a tautology if it is always true Example: Law of excluded middle ( tertium non datur, there is no third possibility) A A Prove using the truth table method: A A A A F T T T F T Last column is always true.
Another tautology Modus ponens ((A B) A) B If A implies B and A is true then B is also necessarily true Let s check it by drawing a truth table.
One more tautology Transitivity of implication. ((A B) (B C)) (A C) If A implies B and B implies C, then A implies C. Question: How many rows in the truth table? (A) 6; (B) 4; (C) 8; (D) 16
One more tautology Transitivity of implication. ((A B) (B C)) (A C) If A implies B and B implies C, then A implies C. Question: How many rows in the truth table? (A) 6; (B) 4; (C) 8; (D) 16 Answer: (C) 2 3 = 8. There are 3 propositional variables (A, B, C), and each can take two possible values.
One more tautology Transitivity of implication. ((A B) (B C)) (A C) If A implies B and B implies C, then A implies C. Question: How many rows in the truth table? (A) 6; (B) 4; (C) 8; (D) 16 Answer: (C) 2 3 = 8. There are 3 propositional variables (A, B, C), and each can take two possible values. Question: How many columns? (A) 4; (B) 7; (C) 8; (D) 11
One more tautology Transitivity of implication. ((A B) (B C)) (A C) If A implies B and B implies C, then A implies C. Question: How many rows in the truth table? (A) 6; (B) 4; (C) 8; (D) 16 Answer: (C) 2 3 = 8. There are 3 propositional variables (A, B, C), and each can take two possible values. Question: How many columns? (A) 4; (B) 7; (C) 8; (D) 11 Answer: A, B, C, A B, B C, A C, (A B) (B C), ((A B) (B C)) (A C).
Tautologies and equivalences Double implication: (A B) ((A B) (B A)) Two (compound) propositional formulas P, Q are equivalent (P Q) if and only if (P Q) is a tautology. Terminology: P is a tautology if it is always true P is a contradiction if it is always false P is a contingency if can be both true or false