cpsc 121 mode els of computation
play

CPSC 121: Mode els of Computation Un nit 4 Propositiona l Logic - PDF document

CPSC 121: Mode els of Computation Un nit 4 Propositiona l Logic Proofs Based on slides by Patrice Be Based on slides by Patrice Be lleville and Steve Wolfman lleville and Steve Wolfman Pre-Class Learning Pre-Class Learning Goals Goals


  1. CPSC 121: Mode els of Computation Un nit 4 Propositiona l Logic Proofs Based on slides by Patrice Be Based on slides by Patrice Be lleville and Steve Wolfman lleville and Steve Wolfman Pre-Class Learning Pre-Class Learning Goals Goals � By the start of this class yo � By the start of this class yo ou should be able to ou should be able to � Use truth tables to establish h or refute the validity of a rule of inference. � Given a rule of inference an nd propositional logic statements that correspond to the rule's s premises, apply the rule to infer a new statement implied by t t t i li d b th the original statements. i i l t t t Unit 4 - Propositional Proofs 2

  2. Quiz 4 Feedback: Quiz 4 Feedback: � Overall: � Overall: � Issues: � We will discuss the open-e p ended question soon. q Unit 4 - Propositional Proofs 3 In-Class Learning G In-Class Learning G oals oals � By the end of this unit you � By the end of this unit, you u should be able to u should be able to � Determine whether or not a propositional logic proof is valid, and explain why it is valid o p y r invalid. � Explore the consequences o of a set of propositional logic statements by application of f equivalence and inference rules, especially in order to l i ll i d t massage statements into a t t t i t desired form. � Devise and attempt multiple � Devise and attempt multiple e different appropriate strategies e different, appropriate strategies for proving a propositional lo ogic statement follows from a list or premises. Unit 4 - Propositional Proofs 4

  3. Where We Are in Th Where We Are in Th he Big Stories he Big Stories � Theory: � Theory: � How can we convince ourse elves that an algorithm does what it's supposed to do? pp � In general � We need to prove that it wo p rks. � We have done a few proof p fs last week. � Now we will learn � Now we will learn � How to decide if a proof is v valid in a formal setting. � How to write proofs in Engli o o e p oo s g s sh. Unit 4 - Propositional Proofs 5 What is Proof? What is Proof? � A rigorous formal argumen � A rigorous formal argumen nt that demonstrates the nt that demonstrates the truth of a proposition, given n the truth of the proof’s premises. premises. � In other words: � A proof is used to convince � A proof is used to convince other people (or yourself) of the other people (or yourself) of the truth of a conditional propos sition. � Every step must be well just tified. � Writing a proof is a bit like writing a function: � you do it step by step, and � make sure that you underst and how each step relates to the previous steps. Unit 4 - Propositional Proofs 6

  4. Things we'd like to p Things we d like to p prove prove � We can build a combinatio � We can build a combinatio onal circuit matching any onal circuit matching any truth table. � We can build any digital lo � We can build any digital lo gic circuit using only 2-input gic circuit using only 2-input NOR gates. � The maximum number of s � The maximum number of s swaps we need to order n swaps we need to order n students is n(n-1)/2. � No general algorithm exist � No general algorithm exist s to sort n values using s to sort n values using fewer than n log 2 n compar risons. � There are problems that no � There are problems that no o algorithm can solve o algorithm can solve. Unit 4 - Propositional Proofs 7 What is a Propositio What is a Propositio onal Logic Proof onal Logic Proof � A propositional logic proof � A propositional logic proof consists of a sequence of consists of a sequence of propositions, where each p proposition is one of � a premise � a premise � the result of applying a logic cal equivalence or a rule of inference to one or more ea arlier propositions. and whose last proposition n is the conclusion. � These are good starting po oint, because they are simpler than the more free p e-form proofs we will discuss p later � Only a limited number of ch oices at each step. Unit 4 - Propositional Proofs 8

  5. Meaning of Proof Meaning of Proof � Suppose you � Suppose you � W � W What does it mean? What does it mean? proved this: A. A Premises 1 to n can be Premise-1 Premise 1 true Premise-2 B B B. Premises 1 to n are true B Premises 1 to n are true ... Premise-n C. Conclusion can be true C ------------------ D D. Conclusion is true ∴ Conclusion E. None of the above. E Unit 4 - Propositional Proofs 9 Meaning of Proof Meaning of Proof A. Premise-1 ˄ … ˄ Premise-n ˄ � What does this � What does this Conclusion argument mean? B B. P Premise-1 ˅ … ˅ Premise-n ˅ i 1 ˅ ˅ P i ˅ Premise-1 Conclusion P Premise-2 i 2 C. Premise-1 ˄ … ˄ Premise-n → ... Conclusion Conclusion Premise-n D. Premise-1 ˄ … ˄ Premise-n ↔ ------------------ Conclusion ∴ Conclusion E. None of the above. Unit 4 - Propositional Proofs 10

  6. Why do we want val Why do we want val id rules? id rules? ~p ~p______ ∴ ~(p v q) ation (p ⇒ p v q). This is valid by generaliza a. This is valid because any ytime ~p is true, ~(p v q) is b. also true. This is valid by some othe Thi i lid b h er rule. l c. This is invalid because w hen p = F and q = T, ~p is d. t true but ~(p v q) is false. b t ( ) i f l None of these. e. 13 Basic Rules of Infere Basic Rules of Infere ence ence Modus Ponens: p p → q q Modus Tollens: p p → q q p ~q q ~p Generalization: Generalization: Specialization: Specialization: p p p p p ˄ q p ˄ q p ˄ q p ˄ q p ˅ q q → p p q Conjunction: p Elimination: p ˅ q p ˅ q q ~p ~q p ˄ q q p Transitivity: p → q Proof by cases: p ˅ q q → r p → r p → r p q → r q r Contradiction: p → F ~p Unit 4 - Propositional Proofs 14

  7. Onnagata Problem fr Onnagata Problem fr rom Online Quiz #4 rom Online Quiz #4 � Critique the following argu � Critique the following argu ment, drawn from an article ment drawn from an article by Julian Baggini on logica al fallacies. � Premise 1 : If women are to � Premise 1 : If women are to o close to femininity to portray o close to femininity to portray women then men must be to oo close to masculinity to play men, and vice versa. � Premise 2 : And yet, if the o onnagata are correct, women are too close to femininity to po rtray women and yet men are not too close to masculinity to p too close to masculinity to p play men. play men � Conclusion : Therefore, the e onnagata are incorrect, and women are not too close to femininity to portray women. � Note: onnagata are male a actors portraying female characters in kabuki theatr re. Unit 4 - Propositional Proofs 15 Onnagata Problem Onnagata Problem Which definitions should we Which definitions should we e use? e use? a) w = women, m = men, f = femininity, m = masculinity, o = onnagata, c = correct onnagata, c correct b) w = women are too close to femininity, m = men are too close to masculinity, pw = women portray women, pm = men portray men, o = onna agata are correct c) w = women are too close to femininity to portray women, m = men are too close to m m = men are too close to m masculinity to portray men, o = masculinity to portray men o = onnagata are correct d) None of these, but anothe ) , er set of definitions works well. e) None of these, and this pr roblem cannot be modeled well with propositional logic. Unit 4 - Propositional Proofs 16

  8. Onnagata Problem Onnagata Problem � Which of these is not an ac ccurate translation of one of the statements? A. w ↔ m B. (w → m) ∧ (m → w) C. o → (w ∧ ~m) D. ~o ∧ ~w E. All of these are accurate tr anslations. � So, the argument is: S th t i Unit 4 - Propositional Proofs 17 Onnagata Problem Onnagata Problem � Do the two premises con � Do the two premises con tradict each other (that is is tradict each other (that is, is p1 ˄ p2 ≡ F)? A A. Yes Yes B. No C. Not enough information g to tell � Is the argument valid? A: Yes B: No C:? � What can we prove? � What can we prove? � We can prove that the On nagata are wrong. � We can not prove that wo p men are not too close to femininity to portray wome en. o What other scenario is consistent with the premises? Unit 4 - Propositional Proofs 18

  9. Onnagata Problem Onnagata Problem � Do the two premises con � Do the two premises con tradict each other (that is is tradict each other (that is, is p1 ˄ p2 ≡ F)? A A. Yes Yes B. No C. Not enough information g to tell � Is the argument valid? g � A: Yes � B: No � C: ? Unit 4 - Propositional Proofs 19 Onnagata Problem Onnagata Problem � What can we prove? � What can we prove? � Can we prove that the On nnagata are wrong. A A. Yes Yes B. No C. Not enough information C. Not enough information � Can we prove that wome en are not too close to femininity to portray wom y p y men? A. Yes B. No C. Not enough information � What other scenario is co onsistent with the premises? Unit 4 - Propositional Proofs 20

Recommend


More recommend