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

Similar documents
EECS 1028 M: Discrete Mathematics for Engineers

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

EECS 1028 M: Discrete Mathematics for Engineers

Introduction to Sets and Logic (MATH 1190)

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

EECS 1028 M: Discrete Mathematics for Engineers

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

Predicate Logic. Andreas Klappenecker

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

software design & management Gachon University Chulyun Kim

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.

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

Discrete Mathematics & Mathematical Reasoning Predicates, Quantifiers and Proof Techniques

ECOM Discrete Mathematics

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

1.1 Language and Logic

Mat 243 Exam 1 Review

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

EECS 1028 M: Discrete Mathematics for Engineers

Supplementary Logic Notes CSE 321 Winter 2009

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

Intro to Logic and Proofs

1.1 Language and Logic

CSC Discrete Math I, Spring Propositional Logic

LECTURE NOTES DISCRETE MATHEMATICS. Eusebius Doedel

Logic and Proofs. (A brief summary)

WUCT121. Discrete Mathematics. Logic. Tutorial Exercises

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

Why Learning Logic? Logic. Propositional Logic. Compound Propositions

Chapter 1 Elementary Logic

Logic and Proof. Aiichiro Nakano

MAT 243 Test 1 SOLUTIONS, FORM A

Logic, Sets, and Proofs

CSC165 Mathematical Expression and Reasoning for Computer Science

1.1 Statements and Compound Statements

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

Lecture Notes on DISCRETE MATHEMATICS. Eusebius Doedel

1 The Foundation: Logic and Proofs

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

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

A. Propositional Logic

CSE 311: Foundations of Computing. Lecture 6: More Predicate Logic

1 The Foundation: Logic and Proofs

2.2: Logical Equivalence: The Laws of Logic

Discrete Mathematics Recitation Course 張玟翔

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

Propositional Logic Not Enough

Logical Operators. Conjunction Disjunction Negation Exclusive Or Implication Biconditional

With Question/Answer Animations. Chapter 2

Foundations of Mathematics MATH 220 FALL 2017 Lecture Notes

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

MCS-236: Graph Theory Handout #A4 San Skulrattanakulchai Gustavus Adolphus College Sep 15, Methods of Proof

The Process of Mathematical Proof

The Logic of Compound Statements cont.

First order Logic ( Predicate Logic) and Methods of Proof

Logic and Proofs. (A brief summary)

CSE 20 DISCRETE MATH. Winter

CSCE 222 Discrete Structures for Computing. Review for Exam 1. Dr. Hyunyoung Lee !!!

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

CITS2211 Discrete Structures. 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.

Discrete Mathematics and Its Applications

Predicate Calculus - Syntax

Discrete Mathematics and Probability Theory Spring 2014 Anant Sahai Note 1

Proofs. Chapter 2 P P Q Q

Proofs: A General How To II. Rules of Inference. Rules of Inference Modus Ponens. Rules of Inference Addition. Rules of Inference Conjunction

Proofs. Chapter 2 P P Q Q

Introduction to Decision Sciences Lecture 2

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

Practice Midterm Exam Solutions

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

Unit I LOGIC AND PROOFS. B. Thilaka Applied Mathematics

ANS: If you are in Kwangju then you are in South Korea but not in Seoul.

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

CSE 20. Final Review. CSE 20: Final Review

Some Review Problems for Exam 1: Solutions

Announcements CompSci 102 Discrete Math for Computer Science

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

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

Chapter 16. Logic Programming. Topics. Logic Programming. Logic Programming Paradigm

Compound Propositions

Mathematical Reasoning (Part I) 1

Steinhardt School of Culture, Education, and Human Development Department of Teaching and Learning. Mathematical Proof and Proving (MPP)

Section 1.2: Conditional Statements

UNIVERSITY OF CALICUT SCHOOL OF DISTANCE EDUCATION B Sc (MATHEMATICS) I Semester Core Course. FOUNDATIONS OF MATHEMATICS (MODULE I & ii) QUESTION BANK

Proofs. Introduction II. Notes. Notes. Notes. Slides by Christopher M. Bourke Instructor: Berthe Y. Choueiry. Fall 2007

LECTURE NOTES DISCRETE MATHEMATICS. Eusebius Doedel

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

CSE 20 DISCRETE MATH. Fall

Section 2.1: Introduction to the Logic of Quantified Statements

THE LOGIC OF QUANTIFIED STATEMENTS

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

DISCRETE MATH: FINAL REVIEW

Review for Midterm 1. Andreas Klappenecker

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

Chapter 4, Logic using Propositional Calculus Handout

HANDOUT AND SET THEORY. Ariyadi Wijaya

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

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

2-4: The Use of Quantifiers

Transcription:

1 Math/CSE 1019N: Discrete Mathematics for Computer Science Winter 2007 Suprakash Datta datta@cs.yorku.ca Office: CSEB 3043 Phone: 416-736-2100 ext 77875 Course page: http://www.cs.yorku.ca/course/1019 Today Ch. 1.2: Propositional Logic - continued Compound propositions, precedence rules Tautologies and logical equivalences Ch. 1.3: Predicate Logic Predicates and quantifiers Rules of Inference 1/8/2007 1 1/8/2007 2 Proof using contrapositive Prove: If x 2 is even, x is even Proof 1: x 2 = 2a for some integer a. Since 2 is prime, 2 must divide x. Proof 2: if x is not even, x is odd. Therefore x 2 is odd. This is the contrapositive of the original assertion. Compound Propositions Example: p q r : Could be interpreted as (p q) r or p (q r) precedence order: (IMP!) (Overruled by brackets) We use this order to compute truth values of compound propositions. 1/8/2007 3 1/8/2007 4 Tautology A compound proposition that is always TRUE, e.g. q q Logical equivalence redefined: p,q are logical equivalences if p q is a tautology. Symbolically p q. Intuition: p q is true precisely when p,q have the same truth values. Manipulating Propositions Compound propositions can be simplified by using simple rules. Read page 24-25. Some are obvious, e.g. Identity, Domination, Idempotence, double negation, commutativity, associativity Less obvious: Distributive, De Morgan s laws, Absorption 1/8/2007 5 1/8/2007 6

2 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. 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 be false. (q r) q r Intuition For the LHS to be true: q r must be false. This is the same as saying q or r must be false. Proof: use truth tables. 1/8/2007 7 1/8/2007 8 Using the laws Q: Is p (p q) a tautology? Can use truth tables Limitations of Propositional Logic What can we NOT express using predicates? Ex: How do you make a statement about all even integers? A more general language: Predicate logic 1/8/2007 9 1/8/2007 10 Predicate Logic A predicate is a proposition that is a function of one or more variables. E.g.: P(x): x is an even number. So P(1) is false, P(2) is true,. Examples of predicates: Domain ASCII characters - IsAlpha(x) : TRUE iff x is an alphabetical character. Domain floating point numbers - IsInt(x): TRUE iff x is an integer. Domain integers: Prime(x) - TRUE if x is prime, FALSE otherwise. Quantifiers describes the values of a variable that make the predicate true. E.g. x P(x) Domain or universe: range of values of a variable (sometimes implicit) 1/8/2007 11 1/8/2007 12

3 Two Popular Quantifiers Universal: x P(x) P(x) for all x in the domain Existential: x P(x) P(x) for some x in the domain or there exists x such that P(x) is TRUE. Either is meaningless if the domain is not known/specified. Examples (domain real numbers) x (x 2 >= 0) x (x >1) ( x>1) (x 2 > x) quantifier with restricted domain Using Quantifiers Domain integers: Using implications: The cube of all negative integers is negative. x (x < 0) (x 3 < 0) Expressing sums : n n (Σ i = n(n+1)/2) i=1 1/8/2007 13 1/8/2007 14 Scope of Quantifiers have higher precedence than operators from Propositional Logic; so x P(x) Q(x) is not logically equivalent to x (P(x) Q(x)) x (P(x) Q(x)) x R(x) Say P(x): x is odd, Q(x): x is divisible by 3, R(x): (x=0) (2x >x) Logical Equivalence: P Q iff they have same truth value no matter which domain is used and no matter which predicates are assigned to predicate variables. Negation of Quantifiers There is no student who can Not all professors are bad. There is no Toronto Raptor that can dunk like Vince x P(x) x P(x) why? x P(x) x P(x) Careful: The negation of Every Canadian loves Hockey is NOT No Canadian loves Hockey! Many, many students make this mistake! 1/8/2007 15 1/8/2007 16 Nested Quantifiers Allows simultaneous quantification of many variables. E.g. domain integers, x y z x 2 + y 2 = z 2 n x y zx n +y n =z n (Fermat s Last Theorem) Domain real numbers: x y z (x < z < y) (y < z < z) 1/8/2007 17 Nested Quantifiers - 2 x y (x + y = 0) is true over the integers Assume an arbitrary integer x. To show that there exists a y that satisfies the requirement of the predicate, choose y = -x. Clearly y is an integer, and thus is in the domain. So x + y = x + (-x) = x x = 0. Since we assumed nothing about x (other than it is an integer), the argument holds for any integer x. Therefore, the predicate is TRUE. 1/8/2007 18

4 Nested Quantifiers - 3 Caveat: In general, order matters! Consider the following propositions over the integer domain: x y (x < y) and y x (x < y) x y (x < y) : there is no maximum integer y x (x < y) : there is a maximum integer Not the same meaning at all!!! Negation of Nested Quantifiers Use the same rule as before carefully. Ex 1: x y (x + y = 0) This is equivalent to x y (x + y = 0) This is equivalent to x y (x + y = 0) This is equivalent to x y (x + y 0) Ex 2: x y (x < y) This is equivalent to x y (x < y) This is equivalent to x y (x < y) This is equivalent to x y (x y) 1/8/2007 19 1/8/2007 20 Exercises Check that: x y (x + y = 0) is not true over the positive integers. x y (x + y = 0) is not true over the integers. x <>0 y (y = 1/x) is true over the real numbers. Readings and notes Read pages 21-24. Next: Rules of inference. 1/8/2007 21 1/8/2007 22 Inference rules Recall: the reason for studying logic was to formalize derivations and proofs. How can we infer facts using logic? Simplest possible inference: From p q and p is TRUE, we can infer that q is TRUE. (Modus Ponens) Similarly, From p q, q r and p is TRUE, we can infer that r is TRUE. Read rules on page 66. Inference rules - 2 Understanding the rules are crucial, memorizing is not. You should be able to see that the rules make sense and correspond to our intuition about formal reasoning. 1/8/2007 23 1/8/2007 24

5 Dissecting a proof Prove: If x 2 is even, x is even Proof: if x is not even, x is odd. Therefore x 2 is odd. This is the contrapositive of the original assertion. Note that the problem is to prove an implication. Universal generalization Dissecting a proof - 2 Prove: If x is even, x+2 is even Proof: 1/8/2007 25 1/8/2007 26 Inference rules for quantified statements Read rules on page 70 Again, understanding is required, memorization is not. Aside: Inference and Planning The steps in an inference are useful for planning an action. Example: your professor has assigned reading from an out-of-print book. How do you do it? Example 2: you are participating in the television show Amazing race. How do you play? 1/8/2007 27 1/8/2007 28 Aside 2: Inference and Automatic Theorem-Proving The steps in an inference are useful for proving assertions from axioms and facts. Why is it important for computers to prove theorems? Proving program-correctness Hardware design Data mining.. Next Introduction to Proofs. What is a (valid) proof? Why are proofs necessary? 1/8/2007 29 1/8/2007 30