EECS 1028 M: Discrete Mathematics for Engineers

Similar documents
Tools for reasoning: Logic. Ch. 1: Introduction to Propositional Logic Truth values, truth tables Boolean logic: Implications:

CSC Discrete Math I, Spring Propositional Logic

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

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

Compound Propositions

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

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

Boolean Logic. CS 231 Dianna Xu

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

Introduction to Sets and Logic (MATH 1190)

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

EECS 1028 M: Discrete Mathematics for Engineers

Discrete Mathematical Structures. Chapter 1 The Foundation: Logic

Chapter 1, Section 1.1 Propositional Logic

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

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

Definition 2. Conjunction of p and q

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

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

1.1 Language and Logic

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

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

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

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

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

Mat 243 Exam 1 Review

UNIT-I: Propositional Logic

Truth-Functional Logic

DISCRETE MATHEMATICS BA202

1.1 Statements and Compound Statements

1.1 Language and Logic

Logical Operators. Conjunction Disjunction Negation Exclusive Or Implication Biconditional

Propositional Logic 1

Propositional Equivalence

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

Intro to Logic and Proofs

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

THE LOGIC OF COMPOUND STATEMENTS

Logic and Propositional Calculus

Sec$on Summary. Propositions Connectives. Truth Tables. Negation Conjunction Disjunction Implication; contrapositive, inverse, converse Biconditional

Why Learning Logic? Logic. Propositional Logic. Compound Propositions

PROPOSITIONAL CALCULUS

LOGIC CONNECTIVES. Students who have an ACT score of at least 30 OR a GPA of at least 3.5 can receive a college scholarship.

Today s Topic: Propositional Logic

Note: The area of logic that deals with propositions is called the propositional calculus or propositional logic.

Math.3336: Discrete Mathematics. Propositional Equivalences

Discrete Mathematics and Probability Theory Spring 2014 Anant Sahai Note 1

2.2: Logical Equivalence: The Laws of Logic

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

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

Math.3336: Discrete Mathematics. Applications of Propositional Logic

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

Introduction to Decision Sciences Lecture 2

The statement calculus and logic

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

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

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

Propositional Logic. Spring Propositional Logic Spring / 32

1.3 Propositional Equivalences

Logic: Propositional Logic (Part I)

MAT2345 Discrete Math

Foundation of proofs. Jim Hefferon.

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

software design & management Gachon University Chulyun Kim

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 =

FUNDAMENTALS OF MATHEMATICS HANDOUT 1.3 DR. MCLOUGHLIN

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

The Foundations: Logic and Proofs. Part I

Tautologies, Contradictions, and Contingencies

Discrete Structures for Computer Science

Chapter 1 Elementary Logic

CITS2211 Discrete Structures. Propositional Logic

Section 1.1: Logical Form and Logical Equivalence

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

Math 3336: Discrete Mathematics Practice Problems for Exam I

ECOM Discrete Mathematics

CS Module 1. Ben Harsha Apr 12, 2017

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

CS1021. Why logic? Logic about inference or argument. Start from assumptions or axioms. Make deductions according to rules of reasoning.

Propositional logic ( ): Review from Mat 1348

Mathematical Reasoning (Part I) 1

Discrete Mathematics and Its Applications

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.

Packet #1: Logic & Proofs. Applied Discrete Mathematics

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

CS70 is a course about on Discrete Mathematics for Computer Scientists. The purpose of the course is to teach you about:

Logic and Propositional Calculus

Part Two: The Basic Components of the SOFL Specification Language

Announcements CompSci 102 Discrete Math for Computer Science

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

Supplementary Logic Notes CSE 321 Winter 2009

AI Principles, Semester 2, Week 2, Lecture 5 Propositional Logic and Predicate Logic

DISCRETE STRUCTURES WEEK5 LECTURE1

Section 1.2: Conditional Statements

Discrete Structures of Computer Science Propositional Logic I

Propositional Logic Not Enough

Logic - recap. So far, we have seen that: Logic is a language which can be used to describe:

CHAPTER 1 - LOGIC OF COMPOUND STATEMENTS

Section 1.3. Let I be a set. When I is used in the following context,

HANDOUT AND SET THEORY. Ariyadi Wijaya

Transcription:

EECS 1028 M: Discrete Mathematics for Engineers Suprakash Datta Office: LAS 3043 Course page: http://www.eecs.yorku.ca/course/1028 Also on Moodle S. Datta (York Univ.) EECS 1028 W 18 1 / 26

Why Study Logic? A formal mathematical language for precise reasoning. Start with propositions. Add other constructs like negation, conjunction, disjunction, implication etc. All of these are based on ideas we use daily to reason about things. Later: A more expressive language Predicate logic S. Datta (York Univ.) EECS 1028 W 18 2 / 26

Propositions Declarative sentence. Must be either True or False. Examples of propositions: York University is in Toronto York University is in downtown Toronto All students at York are Computer Science majors Examples of statements that are not propositions: Do you like this class? There are n students in this class. S. Datta (York Univ.) EECS 1028 W 18 3 / 26

Propositions - 2 Truth value: True or False Variables: p, q, r, s,... Negation: p (In English, not p ) Truth tables enumerative definition of propositions p p T F F T S. Datta (York Univ.) EECS 1028 W 18 4 / 26

Negating Propositions p: Literally, it is not the case that p is true p: it rained more than 20 inches in Toronto last month q: John has many ipads Page 12, Q10 (a) r: the election is decided Practice: Questions 1-7 page 12. S. Datta (York Univ.) EECS 1028 W 18 5 / 26

Combining Propositions Purpose: express more complex statements Conjunction, Disjunction Exclusive OR (XOR) Conditionals, Biconditionals Logical Equivalence S. Datta (York Univ.) EECS 1028 W 18 6 / 26

Conjunctions and Disjunctions Purpose: combine statements using or and and Conjunction: p q [ p and q ] Disjunction: p q [ p or q ] p q p q p q F F F F F T F T T F F T T T T T S. Datta (York Univ.) EECS 1028 W 18 7 / 26

Examples Q11, page 13 p: It is below freezing q: It is snowing It is below freezing and snowing It is below freezing but not snowing It is either snowing or below freezing (or both) S. Datta (York Univ.) EECS 1028 W 18 8 / 26

Exclusive OR Notation: p q TRUE if p and q have different truth values, FALSE otherwise Colloquially, we often use OR ambiguously an entree comes with soup or salad implies XOR, but students can take MATH XXXX if they have taken MATH 2320 or MATH 1019 usually means the normal OR (so a student who has taken both is still eligible for MATH XXXX). S. Datta (York Univ.) EECS 1028 W 18 9 / 26

Conditionals Notation: p q [ if p then q ] p: hypothesis, q: conclusion Examples: If you turn in a homework late, it will not be graded If you get 100% in this course, you will get an A+ A conditional is a proposition Tricky question: Is p q TRUE if p is FALSE? Think of If you get 100% in this course, you will get an A+ as a promise is the promise violated if someone gets 50% and does not receive an A+? Q: How does this compare to a if(...) then... statement in programming? S. Datta (York Univ.) EECS 1028 W 18 10 / 26

Conditionals - Truth Table p q: When is it False? Q17, pg 14: If 1 + 1 = 3 then 2 + 2 = 4 If 1 + 1 = 3 then 2 + 2 = 5 If 1 + 1 = 2 then 2 + 2 = 4 If 1 + 1 = 2 then 2 + 2 = 5 FALSE p q p q p q F F T T F T T T T F F F T T T T S. Datta (York Univ.) EECS 1028 W 18 11 / 26

English Statements to Conditionals (pg 6) p q may be expressed as A sufficient condition for q is p q whenever p q unless p Difficult: A necessary condition for p is q if p happened, q must have happened, i.e., p cannot happen if we do not have q. p only if q: not the same as p if q! Same as the previous point, if p happened, q must have happened S. Datta (York Univ.) EECS 1028 W 18 12 / 26

Logical Equivalence p q and p q have the truth table. Does that make them equal? equivalent? p q and p q are logically equivalent Truth tables are the simplest way to prove such facts. We will learn other ways later. S. Datta (York Univ.) EECS 1028 W 18 13 / 26

Biconditionals Notation: p q [ if and only if ] True if p, q have same truth values, false otherwise. Can also be defined as (p q) (q p) Example: Q16(c) 1+1=3 if and only if monkeys can fly. Q: How is this related to XOR? p q p q p q F F T F F T F T T F F T T T T F S. Datta (York Univ.) EECS 1028 W 18 14 / 26

Contrapositive Contrapositive of p q is q p E.g. The contrapositive of If you get 100% in this course, you will get an A+ is If you do not get an A+ in this course, you did not get 100%. Any conditional and its contrapositive are logically equivalent (have the same truth table). p q p q q p q p F F T T T T F T T F T T T F F T F F T T T F F T S. Datta (York Univ.) EECS 1028 W 18 15 / 26

Proof using Contrapositive Prove: If x 2 is even, then x is even Proof 1: Using contradiction, seen before. Proof 2: x 2 = 2a for some integer a. Since 2 is prime, 2 must divide x. (Uses knowledge of primes) Proof 3: if x is not even, then x is odd. Therefore x 2 is odd. This is the contrapositive of the original assertion. (Uses only facts about odd and even numbers) S. Datta (York Univ.) EECS 1028 W 18 16 / 26

Converse and Inverse Converse of p q is q p Converse of p q is p q Converse examples: If you get 100% in this course, you will get an A+, converse If you get an A+ in this course, you scored 100%. If you won the lottery, you are rich, converse If you are rich, you (must have) won the lottery. Neither is logically equivalent to the original conditional p q p q q p p q F F T T T F T T F F T F F T T T T T T T S. Datta (York Univ.) EECS 1028 W 18 17 / 26

Tautology and Logical Equivalence Tautology: A (compound) proposition that is always TRUE, e.g. q q Logical equivalence redefined: p, q are logical equivalences (Symbolically p q) if p q is a tautology.. Intuition: p q is true precisely when p, q have the same truth values. S. Datta (York Univ.) EECS 1028 W 18 18 / 26

Compound Propositions: Precedence Example: p q r: Could be interpreted as (p q) r or p (q r) precedence order:,,,, (Overruled by brackets) We use this order to compute truth values of compound propositions. S. Datta (York Univ.) EECS 1028 W 18 19 / 26

Translating English Sentences to Propositional Logic statements Pages 14-15: I will remember to send you the address only if you send me an email message The beach erodes whenever there is a storm John will go swimming unless the water is too cold Getting elected follows from knowing the right people. S. Datta (York Univ.) EECS 1028 W 18 20 / 26

Readings and Notes Read pages 1-12. Think about the notion of truth tables. Master the rationale behind the definition of conditionals. Practice translating English sentences to propositional logic statements. S. Datta (York Univ.) EECS 1028 W 18 21 / 26

Manipulating Propositions Compound propositions can be simplified by using simple rules. Read page 25-28. Some are obvious, e.g. Identity, Domination, Idempotence, Negation, Double negation, Commutativity, Associativity Less obvious: Distributive, De Morgans laws, Absorption S. Datta (York Univ.) EECS 1028 W 18 22 / 26

Distributive Laws p (q r) (p q) (p r) Intuition (not a proof!) - For the LHS to be true: p must be true and q or r must be true. This is the same as saying p and q must be true or p and r must be true. p (q r) (p q) (p r) Intuition (less obvious) - For the LHS to be true: p must be true or both q and r must be true. This is the same as saying p or q must be true and p or r must be true. Proof: use truth tables. S. Datta (York Univ.) EECS 1028 W 18 23 / 26

De Morgan s Laws (q r) q r Intuition - For the LHS to be true: neither q nor r can be true. This is the same as saying q and r must both be false. (q r) q r Intuition - For the LHS to be true: q r must be false. This is the same as saying that q or r must be false. Proof: use truth tables. S. Datta (York Univ.) EECS 1028 W 18 24 / 26

Negating Conditionals The negation of p q is NOT p q or any other conditional Easiest to negate the logically equivalent form of p q, viz., p q. So (p q) ( p q) p q Relate to the truth table of p q p q p q (p q) p q F F T F F F T T F F T F F T T T T T F F S. Datta (York Univ.) EECS 1028 W 18 25 / 26

Using the laws Q: Is p (p q) a tautology? Can use truth tables p q p q p (p q) F F T T F T T T T F F F T T T T Can write a compound proposition and simplify: p (p q) p ( p q) p p q p q This is False when p is True and q is False S. Datta (York Univ.) EECS 1028 W 18 26 / 26