CSE 20: Discrete Mathematics

Similar documents
CSC Discrete Math I, Spring Propositional Logic

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

PROPOSITIONAL CALCULUS

2.2: Logical Equivalence: The Laws of Logic

1.3 Propositional Equivalences

Tautologies, Contradictions, and Contingencies

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

CSE 311: Foundations of Computing. Lecture 2: More Logic, Equivalence & Digital Circuits

CSE 20: Discrete Mathematics

Compound Propositions

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

15414/614 Optional Lecture 1: Propositional Logic

Introduction to Sets and Logic (MATH 1190)

Section 1.1: Logical Form and Logical Equivalence

Chapter 4: Classical Propositional Semantics

The Logic of Compound Statements cont.

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

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

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

Unit 1. Propositional Logic Reading do all quick-checks Propositional Logic: Ch. 2.intro, 2.2, 2.3, 2.4. Review 2.9

Conjunction: p q is true if both p, q are true, and false if at least one of p, q is false. The truth table for conjunction is as follows.

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

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

Supplementary exercises in propositional logic

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

Section 1.2: Propositional Logic

CSE 20 DISCRETE MATH. Fall

Logic, Sets, and Proofs

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

Discrete Structures of Computer Science Propositional Logic III Rules of Inference

Logic as a Tool Chapter 1: Understanding Propositional Logic 1.1 Propositions and logical connectives. Truth tables and tautologies

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

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

PHI Propositional Logic Lecture 2. Truth Tables

Propositional Language - Semantics

Chapter 4, Logic using Propositional Calculus Handout

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

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

Propositional Logic: Equivalence

Part Two: The Basic Components of the SOFL Specification Language

Propositional Equivalence

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

Propositional natural deduction

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

KP/Worksheets: Propositional Logic, Boolean Algebra and Computer Hardware Page 1 of 8

Chapter 1, Section 1.1 Propositional Logic

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

Announcements CompSci 102 Discrete Math for Computer Science

PHIL12A Section answers, 16 February 2011

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

Propositional Logic: Semantics

cse 311: foundations of computing Fall 2015 Lecture 6: Predicate Logic, Logical Inference

Topic 1: Propositional logic

We last time we began introducing equivalency laws.

8. Reductio ad absurdum

Chapter 1: Formal Logic

Propositional Logic. Spring Propositional Logic Spring / 32

1.1 Statements and Compound Statements

Logic. Def. A Proposition is a statement that is either true or false.

Packet #1: Logic & Proofs. Applied Discrete Mathematics

1.1 Language and Logic

Natural Deduction for Propositional Logic

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

Discrete Mathematical Structures. Chapter 1 The Foundation: Logic

THE LOGIC OF COMPOUND STATEMENTS

Logic and Proof. Aiichiro Nakano

CSC165 Mathematical Expression and Reasoning for Computer Science

Supplementary Logic Notes CSE 321 Winter 2009

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

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

1.1 Language and Logic

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

Introduction to Decision Sciences Lecture 2

Propositional logic ( ): Review from Mat 1348

COMP219: Artificial Intelligence. Lecture 19: Logic for KR

COMP219: Artificial Intelligence. Lecture 19: Logic for KR

Examples. Example (1) Example (2) Let x, y be two variables, and denote statements p : x = 0 and q : y = 1. Solve. x 2 + (y 1) 2 = 0.

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

Artificial Intelligence. Propositional logic

COMP 2600: Formal Methods for Software Engineeing

Numbers that are divisible by 2 are even. The above statement could also be written in other logically equivalent ways, such as:

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

A. Propositional Logic

CSE 311: Foundations of Computing. Lecture 2: More Logic, Equivalence & Digital Circuits

Functions. Lecture 4: Truth functions, evaluating compound statements. Arithmetic Functions. x y x+y

Why Learning Logic? Logic. Propositional Logic. Compound Propositions

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

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

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

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.

Inference in Propositional Logic

Definition 2. Conjunction of p and q

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

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

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

THE LOGIC OF COMPOUND STATEMENTS

Intermediate Logic. Natural Deduction for TFL

Overview. I Review of natural deduction. I Soundness and completeness. I Semantics of propositional formulas. I Soundness proof. I Completeness proof.

Mathematical Reasoning (Part I) 1

Solutions to Homework I (1.1)

Transcription:

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