CS 202 Rosen section 1.5 Aaron Bloomfield

Slides:



Advertisements
Similar presentations
Rules of Inference Rosen 1.5.
Advertisements

With examples from Number Theory
Discrete Mathematics University of Jazeera College of Information Technology & Design Khulood Ghazal Mathematical Reasoning Methods of Proof.
Introduction to Proofs
Announcements Grading policy No Quiz next week Midterm next week (Th. May 13). The correct answer to the quiz.
1 Introduction to Abstract Mathematics Valid AND Invalid Arguments 2.3 Instructor: Hayk Melikya
1 Valid and Invalid Arguments CS 202 Epp Section 1.3 Aaron Bloomfield.
CSE115/ENGR160 Discrete Mathematics 01/26/12 Ming-Hsuan Yang UC Merced 1.
Valid Arguments An argument is a sequence of propositions. All but the final proposition are called premises. The last statement is the conclusion. The.
Discrete Structures & Algorithms Propositional Logic EECE 320 : UBC : Spring
CSE115/ENGR160 Discrete Mathematics 01/31/12 Ming-Hsuan Yang UC Merced 1.
CSE115/ENGR160 Discrete Mathematics 02/01/11
Fall 2002CMSC Discrete Structures1 Let’s proceed to… Mathematical Reasoning.
1 Predicates and Quantifiers CS 202, Spring 2007 Epp, Sections 2.1 and 2.2 Aaron Bloomfield.
CS 2210 (22C:019) Discrete Structures Logic and Proof Spring 2015 Sukumar Ghosh.
Methods of Proof & Proof Strategies
Predicates and Quantifiers
Copyright © Curt Hill Rules of Inference What is a valid argument?
CSCI 115 Chapter 2 Logic. CSCI 115 §2.1 Propositions and Logical Operations.
1 Georgia Tech, IIC, GVU, 2006 MAGIC Lab Rossignac Lecture 03: PROOFS Section 1.5 Jarek Rossignac CS1050: Understanding.
1 Methods of Proof CS/APMA 202 Epp, chapter 3 Aaron Bloomfield.
CS 103 Discrete Structures Lecture 07b
Review I Rosen , 3.1 Know your definitions!
March 3, 2015Applied Discrete Mathematics Week 5: Mathematical Reasoning 1Arguments Just like a rule of inference, an argument consists of one or more.
1 Predicates and Quantifiers CS/APMA 202, Spring 2005 Rosen, section 1.3 Aaron Bloomfield.
Proofs1 Elementary Discrete Mathematics Jim Skon.
1 Basic Proof Methods I Basic Proof Methods II Proofs Involving Quantifiers.
CSci 2011 Discrete Mathematics Lecture 6
1 Methods of Proof. 2 Consider (p  (p→q)) → q pqp→q p  (p→q)) (p  (p→q)) → q TTTTT TFFFT FTTFT FFTFT.
10/17/2015 Prepared by Dr.Saad Alabbad1 CS100 : Discrete Structures Proof Techniques(1) Dr.Saad Alabbad Department of Computer Science
Section 1.5. Section Summary Nested Quantifiers Order of Quantifiers Translating from Nested Quantifiers into English Translating Mathematical Statements.
1 Sections 1.5 & 3.1 Methods of Proof / Proof Strategy.
1 Math/CSE 1019C: Discrete Mathematics for Computer Science Fall 2011 Suprakash Datta Office: CSEB 3043 Phone: ext
1 Proof Strategies CS/APMA 202 Rosen section 3.1 Aaron Bloomfield.
Discrete Structures (DS)
Discrete Mathematics. Predicates - the universal quantifier 11/28/2015 Suppose P(x) is a predicate on some universe of discourse. Ex. B(x) = “x is carrying.
1 Discrete Structures – CNS2300 Text Discrete Mathematics and Its Applications Kenneth H. Rosen (5 th Edition) Chapter 3 The Foundations: Logic and Proof,
Chapter 1, Part III: Proofs With Question/Answer Animations 1.
1 Course Summary CS 202 Aaron Bloomfield. 2 Outline A review of the proof methods gone over in class Interspersed with the most popular demotivators from.
Module #1 - Logic Based on Rosen, Discrete Mathematics & Its Applications. Prepared by (c) , Michael P. Frank. Modified By Mingwu Chen 1 Module.
Fall 2008/2009 I. Arwa Linjawi & I. Asma’a Ashenkity 11 The Foundations: Logic and Proofs Rules of inference.
Chapter 1, Part III: Proofs With Question/Answer Animations 1.
CSci 2011 Discrete Mathematics Lecture 4 CSci 2011.
CS104:Discrete Structures Chapter 2: Proof Techniques.
Methods of Proof – Page 1CSCI 1900 – Discrete Structures CSCI 1900 Discrete Structures Methods of Proof Reading: Kolman, Section 2.3.
Week 4 - Friday.  What did we talk about last time?  Floor and ceiling  Proof by contradiction.
Proof Review CS 202 Aaron Bloomfield Spring 2007.
CSci 2011 Discrete Mathematics Lecture 5 CSci 2011.
Chapter 1, Part III: Proofs With Question/Answer Animations Copyright © McGraw-Hill Education. All rights reserved. No reproduction or distribution without.
Chapter 1 Logic and proofs
CS 2210:0001 Discrete Structures Logic and Proof
Methods of Proof Aaron Bloomfield.
CSE15 Discrete Mathematics 01/30/17
In this slide set… Rules of inference for propositions
Discrete Mathematics Logic.
Proof methods We will discuss ten proof methods: Direct proofs
Methods of proof Section 1.6 & 1.7 Wednesday, June 20, 2018
Methods of Proof CS 202 Epp, chapter 3.
Proof Techniques.
Discrete Mathematics and its Applications
Module #10: Proof Strategies
The Foundations: Logic and Proofs
Mathematical Reasoning
Methods of Proof. Methods of Proof Definitions A theorem is a valid logical assertion which can be proved using Axioms: statements which are given.
Inference Rules: Tautologies
Discrete Mathematics Logic.
Information Technology Department SKN-SITS,Lonavala.
Module #10: Proof Strategies
Valid and Invalid Arguments
Mathematical Reasoning
Presentation transcript:

CS 202 Rosen section 1.5 Aaron Bloomfield Methods of Proof CS 202 Rosen section 1.5 Aaron Bloomfield

In this slide set… Rules of inference for propositions Rules of inference for quantified statements Ten methods of proof

Proof methods in this slide set Logical equivalences via truth tables via logical equivalences Set equivalences via membership tables via set identities via mutual subset proof via set builder notation and logical equivalences Rules of inference for propositions for quantified statements Pigeonhole principle Combinatorial proofs Ten proof methods in section 1.5: Direct proofs Indirect proofs Vacuous proofs Trivial proofs Proof by contradiction Proof by cases Proofs of equivalence Existence proofs Constructive Non-constructive Uniqueness proofs Counterexamples Induction Weak mathematical induction Strong mathematical induction Structural induction

Modus Ponens Consider (p  (p→q)) → q p q p→q p(p→q)) (p(p→q)) → q T F

Modus Ponens example Assume you are given the following two statements: “you are in this class” “if you are in this class, you will get a grade” Let p = “you are in this class” Let q = “you will get a grade” By Modus Ponens, you can conclude that you will get a grade

Modus Tollens Assume that we know: ¬q and p → q Recall that p → q = ¬q → ¬p Thus, we know ¬q and ¬q → ¬p We can conclude ¬p

Modus Tollens example Assume you are given the following two statements: “you will not get a grade” “if you are in this class, you will get a grade” Let p = “you are in this class” Let q = “you will get a grade” By Modus Tollens, you can conclude that you are not in this class

Quick survey I feel I understand moduls ponens and modus tollens Very well With some review, I’ll be good Not really Not at all

Addition & Simplification Addition: If you know that p is true, then p  q will ALWAYS be true Simplification: If p  q is true, then p will ALWAYS be true

Example of proof Does this imply that “we will be home by sunset”? “It is not sunny this afternoon and it is colder than yesterday” “We will go swimming only if it is sunny” “If we do not go swimming, then we will take a canoe trip” “If we take a canoe trip, then we will be home by sunset” Does this imply that “we will be home by sunset”? “It is not sunny this afternoon and it is colder than yesterday” “We will go swimming only if it is sunny” “If we do not go swimming, then we will take a canoe trip” “If we take a canoe trip, then we will be home by sunset” Does this imply that “we will be home by sunset”? “It is not sunny this afternoon and it is colder than yesterday” “We will go swimming only if it is sunny” “If we do not go swimming, then we will take a canoe trip” “If we take a canoe trip, then we will be home by sunset” Does this imply that “we will be home by sunset”? “It is not sunny this afternoon and it is colder than yesterday” “We will go swimming only if it is sunny” “If we do not go swimming, then we will take a canoe trip” “If we take a canoe trip, then we will be home by sunset” Does this imply that “we will be home by sunset”? Example 6 of Rosen, section 1.5 We have the hypotheses: “It is not sunny this afternoon and it is colder than yesterday” “We will go swimming only if it is sunny” “If we do not go swimming, then we will take a canoe trip” “If we take a canoe trip, then we will be home by sunset” Does this imply that “we will be home by sunset”? “It is not sunny this afternoon and it is colder than yesterday” “We will go swimming only if it is sunny” “If we do not go swimming, then we will take a canoe trip” “If we take a canoe trip, then we will be home by sunset” Does this imply that “we will be home by sunset”? ¬p  q r → p ¬r → s s → t t p q r s t

Example of proof ¬p  q 1st hypothesis ¬p Simplification using step 1 r → p 2nd hypothesis ¬r Modus tollens using steps 2 & 3 ¬r → s 3rd hypothesis s Modus ponens using steps 4 & 5 s → t 4th hypothesis t Modus ponens using steps 6 & 7

So what did we show? We showed that: [(¬p  q)  (r → p)  (¬r → s)  (s → t)] → t That when the 4 hypotheses are true, then the implication is true In other words, we showed the above is a tautology! To show this, enter the following into the truth table generator at http://sciris.shu.edu/~borowski/Truth/: ((~P ^ Q) ^ (R => P) ^ (~R => S) ^ (S => T)) => T

More rules of inference Conjunction: if p and q are true separately, then pq is true Disjunctive syllogism: If pq is true, and p is false, then q must be true Resolution: If pq is true, and ¬pr is true, then qr must be true Hypothetical syllogism: If p→q is true, and q→r is true, then p→r must be true

Example of proof Rosen, section 1.5, question 4 Given the hypotheses: “If it does not rain or if it is not foggy, then the sailing race will be held and the lifesaving demonstration will go on” “If the sailing race is held, then the trophy will be awarded” “The trophy was not awarded” Can you conclude: “It rained”? (¬r  ¬f) → (s  l) s → t ¬t r

Example of proof ¬t 3rd hypothesis s → t 2nd hypothesis ¬s Modus tollens using steps 2 & 3 (¬r¬f)→(sl) 1st hypothesis ¬(sl)→¬(¬r¬f) Contrapositive of step 4 (¬s¬l)→(rf) DeMorgan’s law and double negation law ¬s¬l Addition from step 3 rf Modus ponens using steps 6 & 7 r Simplification using step 8

Quick survey I feel I understand that proof… Very well With some review, I’ll be good Not really Not at all

Fallacy of affirming the conclusion Modus Badus Fallacy of affirming the conclusion Consider the following: Is this true? p q p→q q(p→q)) (q(p→q)) → p T F Not a valid rule!

Modus Badus example Assume you are given the following two statements: “you will get a grade” “if you are in this class, you will get a grade” Let p = “you are in this class” Let q = “you will get a grade” You CANNOT conclude that you are in this class You could be getting a grade for another class

Fallacy of denying the hypothesis Modus Badus Fallacy of denying the hypothesis Consider the following: Is this true? p q p→q ¬p(p→q)) (¬p(p→q)) → ¬q T F Not a valid rule!

Modus Badus example Assume you are given the following two statements: “you are not in this class” “if you are in this class, you will get a grade” Let p = “you are in this class” Let q = “you will get a grade” You CANNOT conclude that you will not get a grade You could be getting a grade for another class

Quick survey I feel I understand rules of inference for Boolean propositions… Very well With some review, I’ll be good Not really Not at all

Just in time for Valentine’s Day…

Bittersweets: Dejected sayings I MISS MY EX PEAKED AT 17 MAIL ORDER TABLE FOR 1 I CRY ON Q U C MY BLOG? REJECT PILE PILLOW HUGGIN ASYLUM BOUND DIGNITY FREE PROG FAN STATIC CLING WE HAD PLANS XANADU 2NITE SETTLE 4LESS NOT AGAIN

Bittersweets: Dysfunctional sayings RUMORS TRUE PRENUP OKAY? HE CAN LISTEN GAME ON TV CALL A 900# P.S. I LUV ME DO MY DISHES UWATCH CMT PAROLE IS UP! BE MY YOKO U+ME=GRIEF I WANT HALF RETURN 2 PIT NOT MY MOMMY BE MY PRISON C THAT DOOR?

What we have shown Rules of inference for propositions Next up: rules of inference for quantified statements

Rules of inference for the universal quantifier Assume that we know that x P(x) is true Then we can conclude that P(c) is true Here c stands for some specific constant This is called “universal instantiation” Assume that we know that P(c) is true for any value of c Then we can conclude that x P(x) is true This is called “universal generalization”

Rules of inference for the existential quantifier Assume that we know that x P(x) is true Then we can conclude that P(c) is true for some value of c This is called “existential instantiation” Assume that we know that P(c) is true for some value of c Then we can conclude that x P(x) is true This is called “existential generalization”

Example of proof Rosen, section 1.5, question 10a Given the hypotheses: “Linda, a student in this class, owns a red convertible.” “Everybody who owns a red convertible has gotten at least one speeding ticket” Can you conclude: “Somebody in this class has gotten a speeding ticket”? C(Linda) R(Linda) x (R(x)→T(x)) x (C(x)T(x))

Example of proof x (R(x)→T(x)) 3rd hypothesis R(Linda) → T(Linda) Universal instantiation using step 1 R(Linda) 2nd hypothesis T(Linda) Modes ponens using steps 2 & 3 C(Linda) 1st hypothesis C(Linda)  T(Linda) Conjunction using steps 4 & 5 x (C(x)T(x)) Existential generalization using step 6 Thus, we have shown that “Somebody in this class has gotten a speeding ticket”

Example of proof Rosen, section 1.5, question 10d Given the hypotheses: “There is someone in this class who has been to France” “Everyone who goes to France visits the Louvre” Can you conclude: “Someone in this class has visited the Louvre”? x (C(x)F(x)) x (F(x)→L(x)) x (C(x)L(x))

Example of proof x (C(x)F(x)) 1st hypothesis C(y)  F(y) Existential instantiation using step 1 F(y) Simplification using step 2 C(y) Simplification using step 2 x (F(x)→L(x)) 2nd hypothesis F(y) → L(y) Universal instantiation using step 5 L(y) Modus ponens using steps 3 & 6 C(y)  L(y) Conjunction using steps 4 & 7 x (C(x)L(x)) Existential generalization using step 8 Thus, we have shown that “Someone in this class has visited the Louvre”

How do you know which one to use? Experience! In general, use quantifiers with statements like “for all” or “there exists” Although the vacuous proof example on slide 40 is a contradiction

Quick survey I feel I understand rules of inference for quantified statements… Very well With some review, I’ll be good Not really Not at all

Proof methods We will discuss ten proof methods: Direct proofs Indirect proofs Vacuous proofs Trivial proofs Proof by contradiction Proof by cases Proofs of equivalence Existence proofs Uniqueness proofs Counterexamples

Direct proofs Consider an implication: p→q If p is false, then the implication is always true Thus, show that if p is true, then q is true To perform a direct proof, assume that p is true, and show that q must therefore be true

Direct proof example Rosen, section 1.5, question 20 Assume n is even Show that the square of an even number is an even number Rephrased: if n is even, then n2 is even Assume n is even Thus, n = 2k, for some k (definition of even numbers) n2 = (2k)2 = 4k2 = 2(2k2) As n2 is 2 times an integer, n2 is thus even

Quick survey These quick surveys are really getting on my nerves… They’re great - keep ‘em coming! They’re fine A bit tedious Enough already! Stop!

End of lecture on 10 February 2005

Indirect proofs Consider an implication: p→q It’s contrapositive is ¬q→¬p Is logically equivalent to the original implication! If the antecedent (¬q) is false, then the contrapositive is always true Thus, show that if ¬q is true, then ¬p is true To perform an indirect proof, do a direct proof on the contrapositive

Indirect proof example If n2 is an odd integer then n is an odd integer Prove the contrapositive: If n is an even integer, then n2 is an even integer Proof: n=2k for some integer k (definition of even numbers) n2 = (2k)2 = 4k2 = 2(2k2) Since n2 is 2 times an integer, it is even

Which to use When do you use a direct proof versus an indirect proof? If it’s not clear from the problem, try direct first, then indirect second If indirect fails, try the other proofs

Example of which to use Rosen, section 1.5, question 21 Prove that if n is an integer and n3+5 is odd, then n is even Via direct proof n3+5 = 2k+1 for some integer k (definition of odd numbers) n3 = 2k+6 Umm… So direct proof didn’t work out. Next up: indirect proof

Example of which to use Rosen, section 1.5, question 21 (a) Prove that if n is an integer and n3+5 is odd, then n is even Via indirect proof Contrapositive: If n is odd, then n3+5 is even Assume n is odd, and show that n3+5 is even n=2k+1 for some integer k (definition of odd numbers) n3+5 = (2k+1)3+5 = 8k3+12k2+6k+6 = 2(4k3+6k2+3k+3) As 2(4k3+6k2+3k+3) is 2 times an integer, it is even

Quick survey I feel I understand direct proofs and indirect proofs… Very well With some review, I’ll be good Not really Not at all

Proof by contradiction Given a statement p, assume it is false Assume ¬p Prove that ¬p cannot occur A contradiction exists Given a statement of the form p→q To assume it’s false, you only have to consider the case where p is true and q is false

Proof by contradiction example 1 Theorem (by Euclid): There are infinitely many prime numbers. Proof. Assume there are a finite number of primes List them as follows: p1, p2 …, pn. Consider the number q = p1p2 … pn + 1 This number is not divisible by any of the listed primes If we divided pi into q, there would result a remainder of 1 We must conclude that q is a prime number, not among the primes listed above This contradicts our assumption that all primes are in the list p1, p2 …, pn.

Proof by contradiction example 2 Rosen, section 1.5, question 21 (b) Prove that if n is an integer and n3+5 is odd, then n is even Rephrased: If n3+5 is odd, then n is even Assume p is true and q is false Assume that n3+5 is odd, and n is odd n=2k+1 for some integer k (definition of odd numbers) n3+5 = (2k+1)3+5 = 8k3+12k2+6k+6 = 2(4k3+6k2+3k+3) As 2(4k3+6k2+3k+3) is 2 times an integer, it must be even Contradiction!

A note on that problem… Rosen, section 1.5, question 21 Prove that if n is an integer and n3+5 is odd, then n is even Here, our implication is: If n3+5 is odd, then n is even The indirect proof proved the contrapositive: ¬q → ¬p I.e., If n is odd, then n3+5 is even The proof by contradiction assumed that the implication was false, and showed a contradiction If we assume p and ¬q, we can show that implies q The contradiction is q and ¬q Note that both used similar steps, but are different means of proving the implication

How the book explains proof by contradiction A very poor explanation, IMHO Suppose q is a contradiction (i.e. is always false) Show that ¬p→q is true Since the consequence is false, the antecedent must be false Thus, p must be true Find a contradiction, such as (r¬r), to represent q Thus, you are showing that ¬p→(r¬r) Or that assuming p is false leads to a contradiction

A note on proofs by contradiction You can DISPROVE something by using a proof by contradiction You are finding an example to show that something is not true You cannot PROVE something by example Example: prove or disprove that all numbers are even Proof by contradiction: 1 is not even (Invalid) proof by example: 2 is even

Quick survey I feel I understand proof by contradiction… Very well With some review, I’ll be good Not really Not at all

Vacuous proofs Consider an implication: p→q If it can be shown that p is false, then the implication is always true By definition of an implication Note that you are showing that the antecedent is false

Vacuous proof example Consider the statement: All criminology majors in CS 202 are female Rephrased: If you are a criminology major and you are in CS 202, then you are female Could also use quantifiers! Since there are no criminology majors in this class, the antecedent is false, and the implication is true

Trivial proofs Consider an implication: p→q If it can be shown that q is true, then the implication is always true By definition of an implication Note that you are showing that the conclusion is true

Trivial proof example Consider the statement: If you are tall and are in CS 202 then you are a student Since all people in CS 202 are students, the implication is true regardless

Proof by cases Show a statement is true by showing all possible cases are true Thus, you are showing a statement of the form: is true by showing that:

Proof by cases example Prove that Cases: Note that b ≠ 0 Case 1: a ≥ 0 and b > 0 Then |a| = a, |b| = b, and Case 2: a ≥ 0 and b < 0 Then |a| = a, |b| = -b, and Case 3: a < 0 and b > 0 Then |a| = -a, |b| = b, and Case 4: a < 0 and b < 0 Then |a| = -a, |b| = -b, and

The think about proof by cases Make sure you get ALL the cases The biggest mistake is to leave out some of the cases

Quick survey I feel I understand trivial and vacuous proofs and proof by cases… Very well With some review, I’ll be good Not really Not at all

End of prepared slides

Proofs of equivalences This is showing the definition of a bi-conditional Given a statement of the form “p if and only if q” Show it is true by showing (p→q)(q→p) is true

Proofs of equivalence example Rosen, section 1.5, question 40 Show that m2=n2 if and only if m=n or m=-n Rephrased: (m2=n2) ↔ [(m=n)(m=-n)] Need to prove two parts: [(m=n)(m=-n)] → (m2=n2) Proof by cases! Case 1: (m=n) → (m2=n2) (m)2 = m2, and (n)2 = n2, so this case is proven Case 2: (m=-n) → (m2=n2) (m)2 = m2, and (-n)2 = n2, so this case is proven (m2=n2) → [(m=n)(m=-n)] Subtract n2 from both sides to get m2-n2=0 Factor to get (m+n)(m-n) = 0 Since that equals zero, one of the factors must be zero Thus, either m+n=0 (which means m=n) Or m-n=0 (which means m=-n)

Existence proofs Given a statement: x P(x) We only have to show that a P(c) exists for some value of c Two types: Constructive: Find a specific value of c for which P(c) exists Nonconstructive: Show that such a c exists, but don’t actually find it Assume it does not exist, and show a contradiction

Constructive existence proof example Show that a square exists that is the sum of two other squares Proof: 32 + 42 = 52 Show that a cube exists that is the sum of three other cubes Proof: 33 + 43 + 53 = 63

Non-constructive existence proof example Rosen, section 1.5, question 50 Prove that either 2*10500+15 or 2*10500+16 is not a perfect square A perfect square is a square of an integer Rephrased: Show that a non-perfect square exists in the set {2*10500+15, 2*10500+16} Proof: The only two perfect squares that differ by 1 are 0 and 1 Thus, any other numbers that differ by 1 cannot both be perfect squares Thus, a non-perfect square must exist in any set that contains two numbers that differ by 1 Note that we didn’t specify which one it was!

Uniqueness proofs A theorem may state that only one such value exists To prove this, you need to show: Existence: that such a value does indeed exist Either via a constructive or non-constructive existence proof Uniqueness: that there is only one such value

Uniqueness proof example If the real number equation 5x+3=a has a solution then it is unique Existence We can manipulate 5x+3=a to yield x=(a-3)/5 Is this constructive or non-constructive? Uniqueness If there are two such numbers, then they would fulfill the following: a = 5x+3 = 5y+3 We can manipulate this to yield that x = y Thus, the one solution is unique!

Counterexamples Given a universally quantified statement, find a single example which it is not true Note that this is DISPROVING a UNIVERSAL statement by a counterexample x ¬R(x), where R(x) means “x has red hair” Find one person (in the domain) who has red hair Every positive integer is the square of another integer The square root of 5 is 2.236, which is not an integer

Mistakes in proofs Modus Badus Proving a universal by example Fallacy of denying the hypothesis Fallacy of affirming the conclusion Proving a universal by example You can only prove an existential by example!

Quick survey I felt I understood the material in this slide set… Very well With some review, I’ll be good Not really Not at all

Quick survey The pace of the lecture for this slide set was… Fast About right A little slow Too slow

Quick survey How interesting was the material in this slide set? Be honest! Wow! That was SOOOOOO cool! Somewhat interesting Rather borting Zzzzzzzzzzz