Announcements. CS311H: Discrete Mathematics. Propositional Logic II. Inverse of an Implication. Converse of a Implication

Similar documents
Announcements. CS243: Discrete Structures. Propositional Logic II. Review. Operator Precedence. Operator Precedence, cont. Operator Precedence Example

Math.3336: Discrete Mathematics. Propositional Equivalences

CSC Discrete Math I, Spring Propositional Logic

Course Staff. Textbook

Compound Propositions

Lecture 2. Logic Compound Statements Conditional Statements Valid & Invalid Arguments Digital Logic Circuits. Reading (Epp s textbook)

2.2: Logical Equivalence: The Laws of Logic

Math.3336: Discrete Mathematics. Applications of Propositional Logic

Announcements. CS311H: Discrete Mathematics. Introduction to First-Order Logic. A Motivating Example. Why First-Order Logic?

2. The Logic of Compound Statements Summary. Aaron Tan August 2017

Truth-Functional Logic

Propositional Equivalence

2/13/2012. Logic: Truth Tables. CS160 Rosen Chapter 1. Logic?

Propositional Logic. Spring Propositional Logic Spring / 32

The Logic of Compound Statements cont.

Propositional logic ( ): Review from Mat 1348

CSC165 Mathematical Expression and Reasoning for Computer Science

Introduction to Decision Sciences Lecture 2

10/5/2012. Logic? What is logic? Propositional Logic. Propositional Logic (Rosen, Chapter ) Logic is a truth-preserving system of inference

Section 1.2 Propositional Equivalences. A tautology is a proposition which is always true. A contradiction is a proposition which is always false.

Language of Propositional Logic

Logic: Propositional Logic (Part I)

What is Logic? Introduction to Logic. Simple Statements. Which one is statement?

Propositional Logic and Semantics

Tautologies, Contradictions, and Contingencies

Propositional Logic Basics Propositional Equivalences Normal forms Boolean functions and digital circuits. Propositional Logic.

Learning Goals of CS245 Logic and Computation

UNIT-I: Propositional Logic

Proposition/Statement. Boolean Logic. Boolean variables. Logical operators: And. Logical operators: Not 9/3/13. Introduction to Logical Operators

ANALYSIS EXERCISE 1 SOLUTIONS

Propositional logic (revision) & semantic entailment. p. 1/34

CISC-102 Winter 2016 Lecture 17

Overview, cont. Overview, cont. Logistics. Optional Reference #1. Optional Reference #2. Workload and Grading

Chapter 1: Formal Logic

We last time we began introducing equivalency laws.

Chapter 1, Section 1.1 Propositional Logic

Description Logics. Foundations of Propositional Logic. franconi. Enrico Franconi

Example ( x.(p(x) Q(x))) ( x.p(x) x.q(x)) premise. 2. ( x.(p(x) Q(x))) -elim, 1 3. ( x.p(x) x.q(x)) -elim, x. P(x) x.

Example. Logic. Logical Statements. Outline of logic topics. Logical Connectives. Logical Connectives

An Introduction to Logic 1.1 ~ 1.4 6/21/04 ~ 6/23/04

Boolean Logic. CS 231 Dianna Xu

Discrete Mathematics and Its Applications

CSE 20: Discrete Mathematics

Chapter 1, Part I: Propositional Logic. With Question/Answer Animations

Why Learning Logic? Logic. Propositional Logic. Compound Propositions

Chapter Summary. Propositional Logic. Predicate Logic. Proofs. The Language of Propositions (1.1) Applications (1.2) Logical Equivalences (1.

CS100: DISCRETE STRUCTURES. Lecture 5: Logic (Ch1)

CSCE 222 Discrete Structures for Computing. Propositional Logic. Dr. Hyunyoung Lee. !!!!!! Based on slides by Andreas Klappenecker

It is not the case that ϕ. p = It is not the case that it is snowing = It is not. r = It is not the case that Mary will go to the party =

1.3 Propositional Equivalences

Discrete Mathematical Structures. Chapter 1 The Foundation: Logic

HW1 graded review form? HW2 released CSE 20 DISCRETE MATH. Fall

Propositional Calculus: Formula Simplification, Essential Laws, Normal Forms

A statement is a sentence that is definitely either true or false but not both.

Introduction to Sets and Logic (MATH 1190)

15414/614 Optional Lecture 1: Propositional Logic

CSE507. Course Introduction. Computer-Aided Reasoning for Software. Emina Torlak

CS 2740 Knowledge Representation. Lecture 4. Propositional logic. CS 2740 Knowledge Representation. Administration

2/2/2018. CS 103 Discrete Structures. Chapter 1. Propositional Logic. Chapter 1.1. Propositional Logic

1 Propositional Logic

CS 4700: Artificial Intelligence

Math.3336: Discrete Mathematics. Nested Quantifiers

n logical not (negation) n logical or (disjunction) n logical and (conjunction) n logical exclusive or n logical implication (conditional)

Equivalence and Implication

Introduction Logic Inference. Discrete Mathematics Andrei Bulatov

Recitation Week 3. Taylor Spangler. January 23, 2012

Solutions to Homework I (1.1)

CHAPTER 1 - LOGIC OF COMPOUND STATEMENTS

Knowledge base (KB) = set of sentences in a formal language Declarative approach to building an agent (or other system):

PROPOSITIONAL CALCULUS

CSE507. Introduction. Computer-Aided Reasoning for Software. Emina Torlak courses.cs.washington.edu/courses/cse507/17wi/

Propositional Logic. Fall () Propositional Logic Fall / 30

CS206 Lecture 03. Propositional Logic Proofs. Plan for Lecture 03. Axioms. Normal Forms

ICS141: Discrete Mathematics for Computer Science I

Propositional Languages

Mat 243 Exam 1 Review

Natural Deduction. Formal Methods in Verification of Computer Systems Jeremy Johnson

Department of Computer Science & Software Engineering Comp232 Mathematics for Computer Science

Tecniche di Verifica. Introduction to Propositional Logic

Proof Methods for Propositional Logic

Lecture 7. Logic. Section1: Statement Logic.

Title: Logical Agents AIMA: Chapter 7 (Sections 7.4 and 7.5)

Propositional Logic. Jason Filippou UMCP. ason Filippou UMCP) Propositional Logic / 38

CISC-102 Fall 2018 Week 11

Sec$on Summary. Tautologies, Contradictions, and Contingencies. Logical Equivalence. Normal Forms (optional, covered in exercises in text)

Inference in Propositional Logic

Logical Structures in Natural Language: Propositional Logic II (Truth Tables and Reasoning

Logical Operators. Conjunction Disjunction Negation Exclusive Or Implication Biconditional

Discrete Mathematics and Applications COT3100

EECS 1028 M: Discrete Mathematics for Engineers

Logic for Computer Science - Week 4 Natural Deduction

Chapter 4: Classical Propositional Semantics

Discrete Structures & Algorithms. Propositional Logic EECE 320 // UBC

AMTH140 Lecture 8. Symbolic Logic

1.1 Statements and Compound Statements

MAT2345 Discrete Math

CS Module 1. Ben Harsha Apr 12, 2017

CITS2211 Discrete Structures. Propositional Logic

Logic of Sentences (Propositional Logic) is interested only in true or false statements; does not go inside.

Math 3336: Discrete Mathematics Practice Problems for Exam I

Transcription:

Announcements CS311H: Discrete Mathematics Propositional Logic II Instructor: Işıl Dillig First homework assignment out today! Due in one week, i.e., before lecture next Wed 09/13 Remember: Due before lecture starts! Instructor: Işıl Dillig, CS311H: Discrete Mathematics Propositional Logic II 1/36 Instructor: Işıl Dillig, CS311H: Discrete Mathematics Propositional Logic II 2/36 Converse of a Implication Inverse of an Implication Recall implication p q when does it evaluate to false? The converse of an implication p q is q p. What is the converse of If I am a CS major, then I can program? What is the converse of If I get an A in CS311, then I am smart? Note: It is possible for a implication to be true, but its converse to be false, e.g., F T is true, but converse false The inverse of an implication p q is p q. What is the inverse of If I am a CS major, then I can program? What is the inverse of If I get an A in CS311, then I am smart? Note: It is possible for a implication to be true, but its inverse to be false. F T is true, but inverse is false Instructor: Işıl Dillig, CS311H: Discrete Mathematics Propositional Logic II 3/36 Instructor: Işıl Dillig, CS311H: Discrete Mathematics Propositional Logic II 4/36 Contrapositive of Implication Conditional and its Contrapositive The contrapositive of an implication p q is q p. What is the contrapositive of If I am a CS major, then I can program? What is the contrapositive of If I get an A in CS311, then I am smart? Question: Is it possible for an implication to be true, but its contrapositive to be false? A conditional p q and its contrapositive q p always have the same truth value. Proof: We consider all four possible cases: p = T, q = T : Both T T and F F are true p = T, q = F : Both T F and T F are false p = F, q = T : Both F T and F T are true p = F, q = F : Both F F and T T are true Instructor: Işıl Dillig, CS311H: Discrete Mathematics Propositional Logic II 5/36 Instructor: Işıl Dillig, CS311H: Discrete Mathematics Propositional Logic II 6/36 1

Question Summary Conditional is of the form p q Consider a conditional p q Is it possible that its converse is true, but inverse is false? Converse: q p Inverse: p q Contrapositive: q p Conditional and contrapositive have same truth value Inverse and converse always have same truth value Instructor: Işıl Dillig, CS311H: Discrete Mathematics Propositional Logic II 7/36 Instructor: Işıl Dillig, CS311H: Discrete Mathematics Propositional Logic II 8/36 Biconditionals Operator Precedence A biconditional p q is the proposition p if and only if q. The biconditional p q is true if p and q have same truth value, and false otherwise. Exercise: Construct a truth table for p q Question: How can we express p q using the other boolean connectives? Given a formula p q r, do we parse this as (p q) r or p (q r)? Without settling on a convention, formulas without explicit paranthesization are ambiguous. To avoid ambiguity, we will specify precedence for logical connectives. Instructor: Işıl Dillig, CS311H: Discrete Mathematics Propositional Logic II 9/36 Instructor: Işıl Dillig, CS311H: Discrete Mathematics Propositional Logic II 10/36 Operator Precedence, cont. Operator Precedence Example Negation ( ) has higher precedence than all other connectives. Question: Does p q mean (i) (p q) or (ii) ( p) q? Conjunction ( ) has next highest predence. Question: Does p q q mean (i) (p q) r or (ii) p (q r)? Disjunction ( ) has third highest precedence. Next highest is precedence is, and lowest precedence is Which is the correct interpretation of the formula p q r q r (A) ((p (q r)) q) ( r) (B) ((p q) r) q) ( r) (C) (p (q r)) (q ( r)) (D) (p ((q r) q)) ( r) Instructor: Işıl Dillig, CS311H: Discrete Mathematics Propositional Logic II 11/36 Instructor: Işıl Dillig, CS311H: Discrete Mathematics Propositional Logic II 12/36 2

Validity, Unsatisfiability Interpretations The truth value of a propositional formula depends on truth assignments to variables Example: p evaluates to true under under the assignment p = F and to false under p = T Some formulas evaluate to true for every assignment, e.g., p p Such formulas are called tautologies or valid formulas Some formulas evaluate to false for every assignment, e.g., p p To make satisfability/validity precise, we ll define interpretation of formula An interpretation I for a formula F is a mapping from each propositional variables in F to exactly one truth value I : {p true, q false, } Each interpretation corresponds to one row in the truth table, so 2 n possible interpretations Such formulas are called unsatisfiable formulas or contradictions Instructor: Işıl Dillig, CS311H: Discrete Mathematics Propositional Logic II 13/36 Instructor: Işıl Dillig, CS311H: Discrete Mathematics Propositional Logic II 14/36 Entailment Examples Consider the formula F : p q p q Under an interpretation, every propositional formula evaluates to T or F Formula F + Interpretation I = Truth value We write I = F if F evaluates to true under I Similarly, I = F if F evaluates to false under I. Theorem: I = F if and only if I = F Let I 1 be the interpretation such that [p true, q false] What does F evaluate to under I 1? Thus, I 1 = F Let I 2 be the interpretation such that [p true, q true] What does F evaluate to under I 2? Thus, I 2 = F Instructor: Işıl Dillig, CS311H: Discrete Mathematics Propositional Logic II 15/36 Instructor: Işıl Dillig, CS311H: Discrete Mathematics Propositional Logic II 16/36 Another Example Satisfiability, Validity Let F 1 and F 2 be two propositional formulas Suppose F 1 evaluates to true under interpretation I What does F 2 F 1 evaluate to under I? F is satisfiable iff there exists interpretation I s.t. I = F F is valid iff for all interpretations I, I = F F is unsatisfiable iff for all interpretations I, I = F F is contingent if it is satisfiable, but not valid. Instructor: Işıl Dillig, CS311H: Discrete Mathematics Propositional Logic II 17/36 Instructor: Işıl Dillig, CS311H: Discrete Mathematics Propositional Logic II 18/36 3

True/False Questions Duality Between Validity and Unsatisfiability Are the following statements true or false? If a formula is valid, then it is also satisfiable. F is valid if and only if F is unsatisfiable If a formula is satisfiable, then its negation is unsatisfiable. If F 1 and F 2 are satisfiable, then F 1 F 2 is also satisfiable. Proof: If F 1 and F 2 are satisfiable, then F 1 F 2 is also satisfiable. Instructor: Işıl Dillig, CS311H: Discrete Mathematics Propositional Logic II 19/36 Instructor: Işıl Dillig, CS311H: Discrete Mathematics Propositional Logic II 20/36 Proving Validity Proving Satisfiability, Unsatisfiability, Contingency Question: How can we prove that a propositional formula is a tautology? Similarly, can prove satisfiability, unsatisfiability, contingency using truth tables: Exercise: Which formulas are tautologies? Prove your answer. 1. (p q) ( q p) Satisfiable: There exists a row where formula evaluates to true Unsatisfiable: In all rows, formula evaluates to false 2. (p q) p Contingent: Exists a row where formula evaluates to true, and another row where it evaluates to false Instructor: Işıl Dillig, CS311H: Discrete Mathematics Propositional Logic II 21/36 Instructor: Işıl Dillig, CS311H: Discrete Mathematics Propositional Logic II 22/36 Exercise Implication Is (p q) (q p) valid, unsatisfiable, or contingent? Prove your answer. Formula F 1 implies F 2 (written F 1 F 2 ) iff for all interpretations I, I = F 1 F 2 F 1 F 2 iff F 1 F 2 is valid Caveat: F 1 F 2 is not a propositional logic formula; is not part of PL syntax! Instead, F 1 F 2 is a semantic judgment, like satisfiability! Instructor: Işıl Dillig, CS311H: Discrete Mathematics Propositional Logic II 23/36 Instructor: Işıl Dillig, CS311H: Discrete Mathematics Propositional Logic II 24/36 4

Example Equivalence Does p q imply p? Prove your answer. Two formulas F 1 and F 2 are equivalent if they have same truth value for every interpretation, e.g., p p and p More precisely, formulas F 1 and F 2 are equivalent, written F 1 F 2 or F 1 F 2, iff: F 1 F 2 iff F 1 F 2 is valid, not part of PL syntax; they are semantic judgments! Instructor: Işıl Dillig, CS311H: Discrete Mathematics Propositional Logic II 25/36 Instructor: Işıl Dillig, CS311H: Discrete Mathematics Propositional Logic II 26/36 Example Important Equivalences Some important equivalences are useful to know! Prove that p q and p q are equivalent Law of double negation: p p Identity Laws: p T p p F p Domination Laws: p T T p F F Idempotent Laws: p p p p p p Negation Laws: p p F p p T Instructor: Işıl Dillig, CS311H: Discrete Mathematics Propositional Logic II 27/36 Instructor: Işıl Dillig, CS311H: Discrete Mathematics Propositional Logic II 28/36 Commutativity and Distributivity Laws De Morgan s Laws Commutative Laws: p q q p p q q p Distributivity Law #1: (p (q r)) (p q) (p r) Distributivity Law #2: (p (q r)) (p q) (p r) Associativity Laws: p (q r) (p q) r p (q r) (p q) r Let cs311 be the proposition John took CS311 and cs312 be the proposition John took CS312 In simple English what does (cs311 cs312) mean? DeMorgan s law expresses exactly this equivalence! De Morgan s Law #1: (p q) ( p q) De Morgan s Law #2: (p q) ( p q) When you push negations in, becomes and vice versa Instructor: Işıl Dillig, CS311H: Discrete Mathematics Propositional Logic II 29/36 Instructor: Işıl Dillig, CS311H: Discrete Mathematics Propositional Logic II 30/36 5

Why are These Equivalences Useful? Formalizing English Arguments in Logic We can use logic to prove correctness of English arguments. Use known equivalences to prove that two formulas are equivalent i.e., rewrite one formula into another using known equivalences Examples: Prove following formulas are equivalent: 1. (p ( p q)) and p q 2. (p q) and p q For example, consider the argument: If Joe drives fast, he gets a speeding ticket. Joe did not get a ticket. Therefore, Joe did not drive fast. Let f be the proposition Joe drives fast, and t be the proposition Joe gets a ticket How do we encode this argument as a logical formula? Instructor: Işıl Dillig, CS311H: Discrete Mathematics Propositional Logic II 31/36 Instructor: Işıl Dillig, CS311H: Discrete Mathematics Propositional Logic II 32/36 Example, cont Another Example Can also use to logic to prove an argument is not valid. If Joe drives fast, he gets a speeding ticket. Joe did not get a ticket. Therefore, he did not drive fast. : ((f t) t) f How can we prove this argument is valid? Can do this in two ways: 1. Use truth table to show formula is tautology 2. Use known equivalences to rewrite formula to true Suppose your friend George make the following argument: If Jill carries an umbrella, it is raining. Jill is not carrying an umbrella. Therefore it is not raining. Let s use logic to prove George s argument doesn t hold water. Let u = Jill is carrying an umbrella, and r = It is raining How do we encode this argument in logic? Instructor: Işıl Dillig, CS311H: Discrete Mathematics Propositional Logic II 33/36 Instructor: Işıl Dillig, CS311H: Discrete Mathematics Propositional Logic II 34/36 Example, cont. Summary A formula is valid if it is true for all interpretations. If Jill carries an umbrella, it is raining. Jill is not carrying an umbrella. Therefore it is not raining. : ((u r) u) r How can we prove George s argument is invalid? A formula is satisfiable if it is true for at least one interpretation. A formula is unsatisfiable if it is false for all interpretations. A formula is contingent if it is true in at least one interpretation, and false in at least one interpretation. Two formulas F 1 and F 2 are equivalent, written F 1 F 2, if F 1 F 2 is valid Instructor: Işıl Dillig, CS311H: Discrete Mathematics Propositional Logic II 35/36 Instructor: Işıl Dillig, CS311H: Discrete Mathematics Propositional Logic II 36/36 6