Announcement. Homework 1

Similar documents
1.3 Predicates and Quantifiers

Introduction to Sets and Logic (MATH 1190)

Predicates and Quantifiers. CS 231 Dianna Xu

CS 220: Discrete Structures and their Applications. Predicate Logic Section in zybooks

CSC165 Mathematical Expression and Reasoning for Computer Science

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

Discrete Structures for Computer Science

Propositional Logic Not Enough

Logical Operators. Conjunction Disjunction Negation Exclusive Or Implication Biconditional

Predicate Logic. CSE 191, Class Note 02: Predicate Logic Computer Sci & Eng Dept SUNY Buffalo

MACM 101 Discrete Mathematics I. Exercises on Predicates and Quantifiers. Due: Tuesday, October 13th (at the beginning of the class)

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

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

! Predicates! Variables! Quantifiers. ! Universal Quantifier! Existential Quantifier. ! Negating Quantifiers. ! De Morgan s Laws for Quantifiers

4 Quantifiers and Quantified Arguments 4.1 Quantifiers

Propositional and Predicate Logic

Mat 243 Exam 1 Review

Propositional and Predicate Logic

Predicate Logic Thursday, January 17, 2013 Chittu Tripathy Lecture 04

Announcements CompSci 102 Discrete Math for Computer Science

Section Summary. Predicate logic Quantifiers. Negating Quantifiers. Translating English to Logic. Universal Quantifier Existential Quantifier

Section Summary. Section 1.5 9/9/2014

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

Lecture Predicates and Quantifiers 1.5 Nested Quantifiers

Discrete Mathematics and Its Applications

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

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

Formal Logic: Quantifiers, Predicates, and Validity. CS 130 Discrete Structures

CSC Discrete Math I, Spring Propositional Logic

First order Logic ( Predicate Logic) and Methods of Proof

Introduction to Decision Sciences Lecture 2

Math.3336: Discrete Mathematics. Nested Quantifiers

Today. Proof using contrapositive. Compound Propositions. Manipulating Propositions. Tautology

CSCI-2200 FOUNDATIONS OF COMPUTER SCIENCE

For all For every For each For any There exists at least one There exists There is Some

3. The Logic of Quantified Statements Summary. Aaron Tan August 2017

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

Predicate Logic & Quantification

ICS141: Discrete Mathematics for Computer Science I

Discrete Mathematical Structures. Chapter 1 The Foundation: Logic

Formal (Natural) Deduction for Predicate Calculus

PROBLEM SET 3: PROOF TECHNIQUES

Section Summary. Predicate logic Quantifiers. Negating Quantifiers. Translating English to Logic. Universal Quantifier Existential Quantifier

Math Fundamentals of Higher Math

Logic and Proof. Aiichiro Nakano

Propositional Functions. Quantifiers. Assignment of values. Existential Quantification of P(x) Universal Quantification of P(x)

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

Propositional and First-Order Logic

MAT2345 Discrete Math

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

1.1 Language and Logic

2.2: Logical Equivalence: The Laws of Logic

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

Proposi'onal Logic Not Enough

Announcements. Exam 1 Review

Solutions to Homework I (1.1)

Predicate Calculus lecture 1

Solutions to Exercises (Sections )

Predicate Calculus - Syntax

2/18/14. What is logic? Proposi0onal Logic. Logic? Propositional Logic, Truth Tables, and Predicate Logic (Rosen, Sections 1.1, 1.2, 1.

Packet #2: Set Theory & Predicate Calculus. Applied Discrete Mathematics

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

Proving Arguments Valid in Predicate Calculus

Section Summary. Predicates Variables Quantifiers. Negating Quantifiers. Translating English to Logic Logic Programming (optional)

Predicates and Quantifiers

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

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

1 Predicates and Quantifiers

Prof. Girardi Exam 1 Math 300 MARK BOX

Before you get started, make sure you ve read Chapter 1, which sets the tone for the work we will begin doing here.

software design & management Gachon University Chulyun Kim

Introduction to Predicate Logic Part 1. Professor Anita Wasilewska Lecture Notes (1)

COMP 2600: Formal Methods for Software Engineeing

Review: Potential stumbling blocks

Discrete Mathematics. Instructor: Sourav Chakraborty. Lecture 4: Propositional Logic and Predicate Lo

Discrete Mathematics Recitation Course 張玟翔

Introduction. Predicates and Quantifiers. Discrete Mathematics Andrei Bulatov

Discrete Mathematics and Applications COT3100

Negations of Quantifiers

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

PREDICATE LOGIC. Schaum's outline chapter 4 Rosen chapter 1. September 11, ioc.pdf

ECOM Discrete Mathematics

Chapter 2. Logical Notation. Bahar Aameri. Department of Computer Science University of Toronto. Jan 09, Mathematical Expression and Reasoning 1

Boolean Logic. CS 231 Dianna Xu

Recitation Week 3. Taylor Spangler. January 23, 2012

Chapter 2. Logical Notation. Bahar Aameri. Department of Computer Science University of Toronto. Jan 09, Mathematical Expression and Reasoning 1

Logic. Logic is a discipline that studies the principles and methods used in correct reasoning. It includes:

2. Use quantifiers to express the associative law for multiplication of real numbers.

Symbolising Quantified Arguments

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

CS 173: Discrete Mathematical Structures, Spring 2008 Homework 1 Solutions

Chapter 3. The Logic of Quantified Statements

Predicate Logic: Introduction and Translations

III. Elementary Logic

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

We last time we began introducing equivalency laws.

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

DISCRETE MATHEMATICS BA202

CSE 20: Discrete Mathematics

Logical Structures in Natural Language: First order Logic (FoL)

Transcription:

Announcement I made a few small changes to the course calendar No class on Wed eb 27 th, watch the video lecture Quiz 8 will take place on Monday April 15 th We will submit assignments using Gradescope Invite Code: 9DK28Y 1Extensible - CSE 240 Logic Networking and Discrete Platform Mathematics 1 Homework 1 Problems due next Monday Jan. 28 th Quiz 1 Wednesday Jan 30 th I will choose one problem from the set of six questions 2Extensible - CSE 240 Logic Networking and Discrete Platform Mathematics 2

Reading Read Sections 1.4(Predicates and Quantifiers) and 1.5 (Nested Quantifiers) 3Extensible - CSE 240 Logic Networking and Discrete Platform Mathematics 3 Precedence of Operators rom the table we can see that the negation operator has a higher precedence than the conjunction operator 4Extensible - CSE 240 Logic Networking and Discrete Platform Mathematics 4

Propositional Logic (Section 1) Proofs involve stepping through a mathematical argument Propositional Logic provides such steps oday we will discuss the process of moving from one proposition to the next to form a mathematical argument 5Extensible - CSE 240 Logic Networking and Discrete Platform Mathematics 5 Logical Equivalence Challenge: ry to find a proposition that is equivalent to p q, but that uses only the connectives, Ù, and Ú p q p q p q p p v q p q is logically equivalent to p Ú q or p q º p Ú q 6Extensible - CSE 240 Logic Networking and Discrete Platform Mathematics 6

Are these equivalent? Contrapositives: p q and q p Ex. If it is noon, then I am hungry. If I am not hungry, then it is not noon. Converses: p q and q p Ex. If it is noon, then I am hungry. If I am hungry, then it is noon. Inverses: p q and p q Ex. If it is noon, then I am hungry. If it is not noon, then I am not hungry. Let s take a vote 7Extensible - CSE 240 Logic Networking and Discrete Platform Mathematics 7 Are these equivalent? Contrapositives: p q º q p? Ex. If it is noon, then I am hungry. If I am not hungry, then it is not noon. Converses: p q º q p? Ex. If it is noon, then I am hungry. If I am hungry, then it is noon. Inverses: p q º p q? Ex. If it is noon, then I am hungry. If it is not noon, then I am not hungry. YES NO NO 8Extensible - CSE 240 Logic Networking and Discrete Platform Mathematics 8

Definitions A tautology is a proposition that s always RUE. A contradiction is a proposition that s always ALSE. p p p Ú p p Ù p 9Extensible - CSE 240 Logic Networking and Discrete Platform Mathematics 9 Logical Equivalences Identity Domination Idempotent p Ù º p p Ú º p p Ú º p Ù º p Ú p º p p Ù p º p p p Ù 10Extensible - CSE 240 Logic Networking and Discrete Platform Mathematics 10

Logical Equivalences Continued Excluded Middle p Ú p º Uniqueness p Ù p º Double negation ( p) º p 11Extensible - CSE 240 Logic Networking and Discrete Platform Mathematics 11 Logical Equivalences Continued Commutativity p Ú q º p Ù q º q Ú p q Ù p Associativity (p Ú q) Ú r º (p Ù q) Ù r º p Ú (q Ú r) p Ù (q Ù r) Distributivity p Ú (q Ù r) º p Ù (q Ú r) º (p Ú q) Ù (p Ú r) (p Ù q) Ú (p Ù r) 12Extensible - CSE 240 Logic Networking and Discrete Platform Mathematics 12

Proof of Distributivity p Ú (q Ù r) º (p Ú q) Ù (p Ú r) p q r q Ù r p Ú (q Ù r) p Ú q p Ú r (p Ú q) Ù (p Ú r) 13Extensible - CSE 240 Logic Networking and Discrete Platform Mathematics 13 DeMorgan s De Morgan s I (p Ú q) º p Ù q De Morgan s II (p Ù q) º p Ú q 14Extensible - CSE 240 Logic Networking and Discrete Platform Mathematics 14

Example of De Morgan s (p Ú q) º p Ù q (p Ù q) º p Ú q p q 15Extensible - CSE 240 Logic Networking and Discrete Platform Mathematics 15 De Morgan s Continued De Morgan s II (p Ù q) º p Ú q (p Ù q) º ( p Ù q) Double negation º ( p Ú q) DeMorgan s I º ( p Ú q) Double negation 16Extensible - CSE 240 Logic Networking and Discrete Platform Mathematics 16

Proof equivalence if NO (blue AND NO red) OR red then (p Ù q) Ú q º p Ú q (p Ù q) Ú q º ( p Ú q) Ú q De Morgan s II º ( p Ú q) Ú q Double negation º p Ú (q Ú q) Associativity º p Ú q Idempotent 17Extensible - CSE 240 Logic Networking and Discrete Platform Mathematics 17 Another Example Show that [p Ù (p q)] q is a tautology We use º to show that [p Ù (p q)] q º [p Ù (p q)] q º [p Ù ( p Ú q)] q º [(p Ù p) Ú (p Ù q)] q º [ Ú (p Ù q)] q º (p Ù q) q º (p Ù q) Ú q º ( p Ú q) Ú q º p Ú ( q Ú q ) º p Ú º substitution for distributive uniqueness identity substitution for De Morgan s II associative excluded middle domination 18Extensible - CSE 240 Logic Networking and Discrete Platform Mathematics 18

Another Example Consider the newspaper headline: Legislature ails to Override Governor s Veto of Bill to Cancel Sales ax Reform Did the legislature vote in favor of or against the sales tax reform? 19Extensible - CSE 240 Logic Networking and Discrete Platform Mathematics 19 Another Example Consider the newspaper headline: Legislature ails to Override Governor s Veto of Bill to Cancel Sales ax Reform Did the legislature vote in favor of or against the sales tax reform? Let s take a vote A) he legislature DID vote in favor B) he legislature DID NO vote in favor 20Extensible - CSE 240 Logic Networking and Discrete Platform Mathematics 20

Another Example Consider the newspaper headline: Legislature ails to Override Governor s Veto of Bill to Cancel Sales ax Reform Did the legislature vote in favor of or against the sales tax reform? Let s stand for sales tax reform Unravel one at a time. -he bill to cancel sales tax reform is s -he governors veto of the bill is s -Overriding this means s -he double negation cancel out, leaving just s herefore the legislature does not support sales tax reform. hey voted in favor of the bill (to cancel it). 21Extensible - CSE 240 Logic Networking and Discrete Platform Mathematics 21 Group Exercise I Break up into groups of 2 or 3 people Solve the following problem: Prove De Morgan s I Law by manipulating symbols (not a truth table) (p Ú q) º p Ù q Hint- Similar to the proof of De Morgan s II Law Reminder DeMorgan s II (p Ù q) º p Ú q 22Extensible - CSE 240 Logic Networking and Discrete Platform Mathematics 22

Predicate Logic Proposition, YES or NO? 3 + 2 = 5 Yes X + 2 = 5 No X + 2 = 5 for all choices of X in {1, 2, 3} X + 2 = 5 for some choice of X in {1, 2, 3} Yes Yes 23Extensible - CSE 240 Logic Networking and Discrete Platform Mathematics 23 Predicates Alicia eats pizza at least once a week. Define: EP(x) = x eats pizza at least once a week. Universe of Discourse - x is a student in cs240 A predicate, or propositional function, is a function that takes some variable(s) as arguments and returns rue or alse. Note that EP(x) is not a proposition, EP(Ariel) is. 24Extensible - CSE 240 Logic Networking and Discrete Platform Mathematics 24

Predicates Suppose Q(x,y) = x > y Proposition, YES or NO? Q(x,y) No Q(3,4) Yes Q(x,9) Predicate, YES or NO? No Q(x,y) Yes Q(3,4) No Q(x,9) Yes 25Extensible - CSE 240 Logic Networking and Discrete Platform Mathematics 25 Universal Quantifier Another way of changing a predicate into a proposition. Suppose P(x) is a predicate on some universe of discourse. Ex. B(x) = x is carrying a backpack, x is set of cs240 students. he universal quantifier of P(x) is the proposition: P(x) is true for all x in the universe of discourse. We write it "x P(x), and say for all x, P(x) "x P(x) is RUE if P(x) is true for every single x. "x P(x) is ALSE if there is an x for which P(x) is false. "x B(x)? What is this asking? Is it true or false? 26Extensible - CSE 240 Logic Networking and Discrete Platform Mathematics 26

Universal Quantifier Universe of discourse is people in this room. B(x) = x is enrolled in CS240. L(x) = x is signed up for at least one class. Y(x)= x is wearing sneakers. Are either of these propositions true? a) "x (B(x) Y(x)) b) "x (Y(x) Ú L(x)) What does this proposition mean? "x (Y(x) Ù B(x)) A: only a is true B: only b is true C: both are true D: neither is true Is it true? 27Extensible - CSE 240 Logic Networking and Discrete Platform Mathematics 27 Existential Quantifier Another way of changing a predicate into a proposition. Suppose P(x) is a predicate on some universe of discourse. Ex. C(x) = x has a candy bar, x is the set of cs240 students. he existential quantifier of P(x) is the proposition: P(x) is true for some x in the universe of discourse. We write it $x P(x), and say for some x, P(x) $x P(x) is RUE if there is an x for which P(x) is true. $x P(x) is ALSE if P(x) is false for every single x. $x C(x)? What is this asking? Is it true or false? 28Extensible - CSE 240 Logic Networking and Discrete Platform Mathematics 28

Existential Quantifier B(x) = x is enrolled in CS240. L(x) = x is signed up for at least one class. Universe of discourse is people in this room. Are either of these propositions true? a) $x B(x) b) $x (B(x) Ù L(x)) What does this proposition mean? $ x (B(x) L(x)) Why do I have to be careful with this proposition? A: only a is true B: only b is true C: both are true D: neither is true 29Extensible - CSE 240 Logic Networking and Discrete Platform Mathematics 29 Predicate Examples L(x) = x is a lion. (x) = x is fierce. C(x) = x drinks coffee. All lions are fierce. Universe of discourse is all creatures. "x (L(x) (x)) Some lions don t drink coffee. $x (L(x) Ù C(x)) Some fierce creatures don t drink coffee. $x ((x) Ù C(x)) 30Extensible - CSE 240 Logic Networking and Discrete Platform Mathematics 30

More Examples B(x) = x is a hummingbird. L(x) = x is a large bird. H(x) = x lives on honey. R(x) = x is richly colored. Universe of discourse is all birds. All hummingbirds are richly colored. No large birds live on honey. Birds that do not live on honey are dully colored. "x (B(x) R(x)) $x (L(x) Ù H(x)) "x ( H(x) R(x)) 31Extensible - CSE 240 Logic Networking and Discrete Platform Mathematics 31 More Examples S(x) = x is a student in this class. C(x) = x has visited Chicago. Universe of discourse is all people. "x (S(x) Ù C(x)) "x (S(x) C(x)) All people are students in this class and all people have visited Chicago All students in this class have visited Chicago $x (S(x) C(x))? $x (S(x) Ù C(x)) Some student in this class has visited Chicago 32Extensible - CSE 240 Logic Networking and Discrete Platform Mathematics 32

Quantifier Negation Not all large birds live on honey. "x (L(x) H(x)) "x P(x) means P(x) is true for every x. What about "x P(x)? Not [ P(x) is true for every x. ] here is an x for which P(x) is not true. $x P(x) So, "x P(x) is the same as $x P(x). $x (L(x) H(x)) 33Extensible - CSE 240 Logic Networking and Discrete Platform Mathematics 33 Quantifier Negation No large birds live on honey. $x (L(x) Ù H(x)) $x P(x) means P(x) is true for some x. What about $x P(x)? Not [ P(x) is true for some x. ] P(x) is not true for all x. "x P(x) So, $x P(x) is the same as "x P(x). "x (L(x) Ù H(x)) 34Extensible - CSE 240 Logic Networking and Discrete Platform Mathematics 34

Quantifier Negation So, "x P(x) is the same as $x P(x). So, $x P(x) is the same as "x P(x). General rule: to negate a quantifier, move negation to the right, changing quantifiers as you go. 35Extensible - CSE 240 Logic Networking and Discrete Platform Mathematics 35