The Logic of Compound Statements cont.

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

CHAPTER 1 - LOGIC OF COMPOUND STATEMENTS

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

Proposition logic and argument. CISC2100, Spring 2017 X.Zhang

Where are my glasses?

CSC Discrete Math I, Spring Propositional Logic

THE LOGIC OF COMPOUND STATEMENTS

MACM 101 Discrete Mathematics I. Exercises on Propositional Logic. Due: Tuesday, September 29th (at the beginning of the class)

PROPOSITIONAL CALCULUS

Chapter 1: The Logic of Compound Statements. January 7, 2008

Propositional Logic. Spring Propositional Logic Spring / 32

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

Propositional Logic. Argument Forms. Ioan Despi. University of New England. July 19, 2013

Logic and Proofs. Jan COT3100: Applications of Discrete Structures Jan 2007

2.2: Logical Equivalence: The Laws of Logic

Sample Problems for all sections of CMSC250, Midterm 1 Fall 2014

Packet #1: Logic & Proofs. Applied Discrete Mathematics

Artificial Intelligence: Knowledge Representation and Reasoning Week 2 Assessment 1 - Answers

Introduction Logic Inference. Discrete Mathematics Andrei Bulatov

Math.3336: Discrete Mathematics. Propositional Equivalences

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

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

A. Propositional Logic

Discrete Structures of Computer Science Propositional Logic III Rules of Inference

Today s Lecture 2/25/10. Truth Tables Continued Introduction to Proofs (the implicational rules of inference)

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

Review. Propositional Logic. Propositions atomic and compound. Operators: negation, and, or, xor, implies, biconditional.

Section 1.2: Propositional Logic

PHI Propositional Logic Lecture 2. Truth Tables

What is the decimal (base 10) representation of the binary number ? Show your work and place your final answer in the box.

Chapter 4, Logic using Propositional Calculus Handout

COMP 182 Algorithmic Thinking. Proofs. Luay Nakhleh Computer Science Rice University

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

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

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

Compound Propositions

Definition 2. Conjunction of p and q

Logic and Proofs. (A brief summary)

Propositional Logic. Fall () Propositional Logic Fall / 30

A Quick Lesson on Negation

Logic Overview, I. and T T T T F F F T F F F F

CS250: Discrete Math for Computer Science. L6: CNF and Natural Deduction for PropCalc

Propositional Equivalence

Logic. Definition [1] A logic is a formal language that comes with rules for deducing the truth of one proposition from the truth of another.

Natural Deduction is a method for deriving the conclusion of valid arguments expressed in the symbolism of propositional logic.

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

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

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

We last time we began introducing equivalency laws.

5. Use a truth table to determine whether the two statements are equivalent. Let t be a tautology and c be a contradiction.

CSE 20: Discrete Mathematics

Chapter 1 Elementary Logic

Test 1 Solutions(COT3100) (1) Prove that the following Absorption Law is correct. I.e, prove this is a tautology:

Propositional Calculus

03 Propositional Logic II

3/29/2017. Logic. Propositions and logical operations. Main concepts: propositions truth values propositional variables logical operations

Math.3336: Discrete Mathematics. Nested Quantifiers/Rules of Inference

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

DISCRETE MATH: LECTURE 3

HANDOUT AND SET THEORY. Ariyadi Wijaya

1.1 Statements and Compound Statements

Boolean Algebra and Proof. Notes. Proving Propositions. Propositional Equivalences. Notes. Notes. Notes. Notes. March 5, 2012

Logic, Sets, and Proofs

Section 1.1: Logical Form and Logical Equivalence

DISCRETE MATH: FINAL REVIEW

The Logic of Compound Statements. CSE 2353 Discrete Computational Structures Spring 2018

COM S 330 Homework 02 Solutions. Type your answers to the following questions and submit a PDF file to Blackboard. One page per problem.

Chapter 2: The Logic of Compound Statements

Undergraduate Notes in Mathematics. Arkansas Tech University Department of Mathematics. Introductory Notes in Discrete Mathematics Solution Guide

Announcements CompSci 102 Discrete Math for Computer Science

Logic and Proofs. (A brief summary)

Math.3336: Discrete Mathematics. Applications of Propositional Logic

software design & management Gachon University Chulyun Kim

Proving Things. Why prove things? Proof by Substitution, within Logic. Rules of Inference: applying Logic. Using Assumptions.

Language of Propositional Logic

The Importance of Being Formal. Martin Henz. February 5, Propositional Logic

Chapter 1, Logic and Proofs (3) 1.6. Rules of Inference

Methods of Proof. 1.6 Rules of Inference. Argument and inference 12/8/2015. CSE2023 Discrete Computational Structures

Logic and Proof. Aiichiro Nakano

Symbolic Logic 3. For an inference to be deductively valid it is impossible for the conclusion to be false if the premises are true.

Logic and Inferences

Advanced Topics in LP and FP

1 The Foundation: Logic and Proofs

15414/614 Optional Lecture 1: Propositional Logic

First Order Logic (1A) Young W. Lim 11/5/13

Supplementary Logic Notes CSE 321 Winter 2009

Part I: Propositional Calculus

1.3 Propositional Equivalences

Analyzing Arguments with Truth Tables

Announcements. Exam 1 Review

Propositional Language - Semantics

1) Let h = John is healthy, w = John is wealthy and s = John is wise Write the following statement is symbolic form

Tautologies, Contradictions, and Contingencies

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

n Empty Set:, or { }, subset of all sets n Cardinality: V = {a, e, i, o, u}, so V = 5 n Subset: A B, all elements in A are in B

CSE 311: Foundations of Computing. Lecture 3: Digital Circuits & Equivalence

1 The Foundation: Logic and Proofs

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

Math 3336: Discrete Mathematics Practice Problems for Exam I

CSCI-2200 FOUNDATIONS OF COMPUTER SCIENCE

Transcription:

The Logic of Compound Statements cont. CSE 215, Computer Science 1, Fall 2011 Stony Brook University http://www.cs.stonybrook.edu/~cse215

Refresh from last time: Logical Equivalences Commutativity of : p q q p Commutativity of : p q q p Associativity of : p (q r) (p q) r Associativity of : p (q r) (p q) r Idempotence: p p p p p Absorption: p p (p q) p (p q) De Morgan's Laws: ~(p q) ~p ~q ~(p q) ~p p ~qq 2

Refresh from last time: Logical Equivalences Distributivity of : p (q r) (p q) (p r) Distributivity of : p (q r) (p q) (p r) Contradictions: p F F p ~p Identities: p T p p F Tautologies: p T T p ~p 3

Refresh from last time: Symbolic proofs p q (p ~q) q Proof: which laws are used at each step? (p ~q) q q (p ~q) (1) Commutativity of (q p) (q ~q) (2) Associativity of (q p) F (3) Contradiction (q p) (4) Identity p q (5) Commutativity it of 4

Today: Logical Arguments 5

But first, please submit Homework 1 The task was to provide the truth tables for the following expressions: 1. p q 2. (p q) (p q) 3. p (q r ) 4. p ( q r ) 5. (p ( p q)) ~(q ~r) Any problems? 6

Homework 2 Due on Wednesday 9/21 at the beginning of the class 1. (4 points) Express natural language sentences into symbolic notation. 2. (5 points) and 3. (5 points) use De Morgan s laws to write negations for numerical statements. 4. (5 points) use truth tables to establish if statement forms are tautologies or contradictions. 5. (6 points) and 6. (5 points) write symbolic proofs (and specify which laws are used at each step). 7. (10 points) rewrite statement forms with implication and biconditional using: 7.1, and ~ 7.2 only and ~. 7 The total is 40 points.

Quiz 2 8 Symbolic proof: Prove that ~(~r ~q) p is logically equivalent with p q r using symbolic proofs with the standard logical equivalences. Write which laws are used at each step. The standard logical equivalence laws are: Commutativity of : p q q p Commutativity of : p q q p Associativity of : p (q r) (p q) r Associativity of : p (q r) (p q) r Idempotence: p p p p p Absorption: p p (p q) p (p q) De Morgan's Laws: ~(p q) ~p ~q ~(p q) ~p ~q Distributivity of : p (q r) (p q) (p r) Distributivity of : p (q r) (p q) (p r) Contradictions: p F F p ~p Identities: :p T p p F Tautologies: p T T p ~p

Quiz 2 ~(~r ~q) p = p ~(~r ~q) commutativity ttiit of = p (~~r ~~q) demorgan = p ~~r ~~q associativity i i of = p r ~~q double negation = p r q double negation 9

Logical Arguments An argument (form) is a (finite) sequence of statements (forms), usually written as follows: p 1... p n q 10 We call p 1,..., p n the premises (or assumptions or hypotheses) and q the conclusion, of the argument. We read: p 1, p 2,..., p n, therefore q OR From premises p 1, p 2,..., p n infer conclusion q

Logical Arguments Argument forms are also called inference rules An inference rule is said to be valid, or (logically) sound, if it is the case that, for each truth valuation, if all the premises true, then the conclusion is also true Theorem: An inference rule is valid if, and only if, the conditional p 1 p 2... p n q is a tautology. An argument form consisting of two premises and a conclusion is called a syllogism 11

Determining Validity or Invalidity Testing an Argument Form for Validity 1. Identify the premises and conclusion of the argument form. 2. Construct a truth table showing the truth values of all the premises and the conclusion. 3. A row of the truth table in which all the premises are true is called a critical row. If there is a critical row in which the conclusion is false, then the argument form is invalid. If the conclusion in every critical row is true, then the argument form is valid 12

Determining Validity or Invalidity p q r q p r p r 13

Modus Ponens Modus Ponens: method of affirming Latin p q p q 14

Modus Ponens The following argument is valid: If Socrates is a man, then Socrates is mortal. Socrates is a man. Socrates is mortal. 15

Modus Ponens Example: If the sum of the digits of 371,487 is divisible by 3, then 371,487 is divisible by 3. The sum of the digits of 371,487 is divisible by 3. 371,487 is divisible by 3. 16

Modus Tollens Modus Tonens: p q method of denying ~q Latin ~p Modus Tollens is valid because modus ponens is valid and the fact that a conditional statement is logically equivalent to its contrapositive, OR it can be established formally by using a truth table. 17

Modus Tollens Example: (1) If Zeus is human, then Zeus is mortal. (2) Zeus is not mortal. Zeus is not human. An intuitive proof is proof by contradiction if Zeus were human, then by (1) he would be mortal. But by (2) he is not mortal. Hence, Zeus cannot be human. 18

Recognizing Modus Ponens and Modus Tollens If there are more pigeons than there are pigeonholes, then at least two pigeons roost in the same hole. There are more pigeons than there are pigeonholes.? 19

Recognizing Modus Ponens and Modus Tollens If there are more pigeons than there are pigeonholes, then at least two pigeons roost in the same hole. There are more pigeons than there are pigeonholes. At least two pigeons pg roost in the same hole. by modus ponens 20

Recognizing Modus Ponens and Modus Tollens If 870,232 is divisible by 6, then it is divisible by 3. 870,232 is not divisible by 3.? 21

Recognizing Modus Ponens and Modus Tollens If 870,232 is divisible by 6, then it is divisible by 3. 870,232 is not divisible by 3. 870,232 is not divisible by 6. by modus tollens 22

Other Rules of Inference Generalization: p and q p q p q Example: Anton is a junior. (more generally) e Anton is a junior or Anton is a senior. 23

Other Rules of Inference Specialization: p q and p q p q Example: Ana knows numerical analysis and Ana knows graph algorithms. (in particular) Ana knows graph algorithms. 24

Other Rules of Inference Elimination : p q and p q ~q ~p p q If we have only two possibilities and we can rule one out, the other one must be the case Example: x 3 =0 or x + 2 = 0 x + 2 0. x 3 =0. 25

Other Rules of Inference Transitivity : Example: p q q r p r If 18,486 is divisible by 18, then 18,486 is divisible by 9. If 18,486 is divisible by 9, then the sum of the digits of 18,486 is divisible by 9. If 18,486 is divisible by 18, then the sum of the digits of 18,486 is divisible by 9. 26

Proof Techniques Proof by Contradiction: ~p c, where c is a contradiction p The usual way to derive a conditional ~p c is to assume ~p and then derive c (i.e., a contradiction). Thus, if one can derive a contradiction from ~p, then one may conclude that p is true. 27

Knights and Knaves: knights always tell the truth and knaves always lie A says: B is a knight. B says: A and I are of opposite type. Suppose A is a knight. What A says is true. by definition of knight B is also a knight. That s what A said. What B says is true. by definition of knight A and B are of opposite types. That s what B said. We have arrived at the following contradiction: A and B are both knights and A and B are of opposite type. The supposition is false. by the contradiction rule A is not a knight. negation of supposition A is a knave. since A is not a knight, A is a knave. What A says is false. by definition of knave B is not a knight. ~(what A said) by definition of knave B is also a knave. by elimination 28

Proof Techniques 29 Proof by Division into Cases: p q p r q r r If a disjunction p q has been derived and the goal is to prove r,, then according to this inference rule it would be sufficient to derive p r and q r. Example: x is positive or x is negative. If x is positive, then x 2 > 0. If x is negative, then x 2 > 0. x 2 > 0.

Quine s Method The following method can be used to determine whether a given propositional formula is a tautology, a contradiction, or a contingency. 30 Let p be a propositional formula. If p contains no variables, it can be simplified to T or F, and hence is either a tautology or a contradiction. If p contains a variable, then 1. select a variable, say q, 2. simplify both p[q := T] and p[q := F], denoting the simplified formulas by p 1 and p 2, respectively, and 3. apply the method recursively to p 1 and p 2. If p 1 and p 2 are both tautologies, so is p. If p 1 and p 2 are both contradictions, so is p. In all other cases, p is a contingency.

Quine s Method Example (p ~q r) (r p q) (p ~r) (p q r) q We first select a variable, say q, and then consider the two cases, q := T and q := F. 1. For q := T, the formula... T can be simplified to T. 2. For q := F, (p ~F r) ) (r p F) (p ~r) ) (p F r) ) F (p T r) (r p) (p ~r) (p r) F (p p r) (r p) (p p ~r) (p p r) F ~[(p r) (r p) (p ~r) (p r)] 31

Quine s Method Example cont. ~[(p r) (r p) (p ~r) (p r)] We select the variable p 1. For p := T ~[(T r) (r T) (T ~r) (T r)] ~[r T ~r T] ~[r ~r] ~F T 2. For p := F ~[(F r) (r F) (F ~r) (F r)] ~[T [ ~r T r] ] ~[~r[ r] ] ~F T This completes the process. All formulas considered, including the original formula, are tautologies. 32