CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.

Slides:



Advertisements
Similar presentations
Introduction to Proofs
Advertisements

PROOF BY CONTRADICTION
CSE 20 DISCRETE MATH Prof. Shachar Lovett Clicker frequency: CA.
Chapter 3 Direct Proof and Proof by Contrapositive
Prof. Shachar Lovett Clicker frequency: CA CSE 20 Discrete math Prof. Shachar Lovett
CSE 20 DISCRETE MATH Prof. Shachar Lovett Clicker frequency: CA.
Logic: Connectives AND OR NOT P Q (P ^ Q) T F P Q (P v Q) T F P ~P T F
So far we have learned about:
1 Indirect Argument: Contradiction and Contraposition.
What it is? Why is it a legitimate proof method? How to use it?
Methods of Proof & Proof Strategies
Section 1.5 Implications. Implication Statements If Cara has a piano lesson, then it is Friday. If it is raining, then I need to remember my umbrella.
Introduction to Proofs
CSE 20 – Discrete Mathematics Dr. Cynthia Bailey Lee Dr. Shachar Lovett Peer Instruction in Discrete Mathematics by Cynthia Leeis licensed under a Creative.
Mathematics Review Exponents Logarithms Series Modular arithmetic Proofs.
Proofs 1/25/12.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
Methods of Proof. This Lecture Now we have learnt the basics in logic. We are going to apply the logical rules in proving mathematical theorems. Direct.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
Methods of Proofs PREDICATE LOGIC The “Quantifiers” and are known as predicate quantifiers. " means for all and means there exists. Example 1: If we.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
10/17/2015 Prepared by Dr.Saad Alabbad1 CS100 : Discrete Structures Proof Techniques(1) Dr.Saad Alabbad Department of Computer Science
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
1 Sections 1.5 & 3.1 Methods of Proof / Proof Strategy.
Chapter 5 Existence and Proof by contradiction
Methods of Proof Lecture 3: Sep 9. This Lecture Now we have learnt the basics in logic. We are going to apply the logical rules in proving mathematical.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
CSE 20 – Discrete Mathematics Dr. Cynthia Bailey Lee Dr. Shachar Lovett Peer Instruction in Discrete Mathematics by Cynthia Leeis licensed under a Creative.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
CSE 20 – Discrete Mathematics Dr. Cynthia Bailey Lee Dr. Shachar Lovett Peer Instruction in Discrete Mathematics by Cynthia Leeis licensed under a Creative.
1 Methods of Proof Proof techniques in this handout –Direct proof –Division into cases –Proof by contradiction In this handout, the proof techniques will.
Conditional Statements
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
Fall 2008/2009 I. Arwa Linjawi & I. Asma’a Ashenkity 11 The Foundations: Logic and Proofs Introduction to Proofs.
1 Discrete Structures – CNS2300 Text Discrete Mathematics and Its Applications Kenneth H. Rosen (5 th Edition) Chapter 3 The Foundations: Logic and Proof,
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
CS104:Discrete Structures Chapter 2: Proof Techniques.
Introduction to Proofs
Section 1.7. Definitions A theorem is a statement that can be shown to be true using: definitions other theorems axioms (statements which are given as.
Methods of Proof Lecture 4: Sep 20 (chapter 3 of the book, except 3.5 and 3.8)
Chapter 1 Logic and proofs
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
Dr Nazir A. Zafar Advanced Algorithms Analysis and Design Advanced Algorithms Analysis and Design By Dr. Nazir Ahmad Zafar.
Proof And Strategies Chapter 2. Lecturer: Amani Mahajoub Omer Department of Computer Science and Software Engineering Discrete Structures Definition Discrete.
Discrete Structures for Computer Science Presented By: Andrew F. Conn Slides adapted from: Adam J. Lee Lecture #1: Introduction, Propositional Logic August.
Lecture 2: Proofs and Recursion. Lecture 2-1: Proof Techniques Proof methods : –Inductive reasoning Lecture 2-2 –Deductive reasoning Using counterexample.
Chapter 1 Logic and Proof.
Hubert Chan (Chapters 1.6, 1.7, 4.1)
The Foundations: Logic and Proofs
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett
Chapter 4 (Part 1): Induction & Recursion
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett
Predicate Calculus Validity
Proof Techniques.
Hubert Chan (Chapters 1.6, 1.7, 4.1)
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett
The Foundations: Logic and Proofs
CS201: Data Structures and Discrete Mathematics I
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett
Indirect Proof by Contradiction Direct Proof by Cases
Applied Discrete Mathematics Week 2: Proofs
CS 220: Discrete Structures and their Applications
Foundations of Discrete Mathematics
Introduction to Proofs
Introduction to Proofs
Presentation transcript:

CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett

Today’s Topics: 1. Proof by contraposition 2. Proof by cases 2

1. Proof by contraposition 3

Proof by contraposition  To prove a statement of the form  You can equivalently prove its contra-positive form  Remember: (p→q)  (  q→  p) 4

Truth table for implication 5 pqp → q TTT TFF FTT FFT Rule this row out!

Contrapositive proof of p→q Procedure: 1. Derive contrpositive form: (  q→  p) 2. Assume q is false (take it as “given”) 3. Show that  p logically follows 6

Example  Thm.: “Let x,y be integers such that x  0. Then either x+y  0 or x-y  0.”  Proof:  Given (contrapositive form): Let  WTS (contrapositive form): …  Conclusion: … 7 ???

Example  Thm.: “Let x,y be integers such that x  0. Then either x+y  0 or x-y  0.”  Proof:  Given (contrapositive form): Let … A. x+y  0 or x-y  0 B. x+y=0 or x-y=0 C. x+y=0 and x-y=0 D. y  0 E. None/more/other 8 ???

Example  Thm.: “Let x,y be integers such that x  0. Then either x+y  0 or x-y  0.”  Proof:  Given (contrapositive form): Let x+y=0 and x-y=0  WTS (contrapositive form): A. x  0 B. x=0 C. x+y  0 or x-y  0 D. x+y=0 or x-y=0 E. None/more/other 9 ???

Example  Thm.: “Let x,y be integers such that x  0. Then either x+y  0 or x-y  0.”  Proof:  Given (contrapositive form): Let x+y=0 and x-y=0  WTS (contrapositive form): x=0  Conclusion: … 10 Try yourself first

Example  Thm.: “Let x,y be integers such that x  0. Then either x+y  0 or x-y  0.”  Proof:  Given (contrapositive form): Let x+y=0 and x-y=0  WTS (contrapositive form): x=0  Conclusion: x=0 11 By assumption x+y=0 and x-y=0. Summing the two equations together gives 0=0+0=(x+y)+(x-y)=2x So, 2x=0. Dividing by 2 gives that x=0.

When should you use contra- positive proofs?  You want to prove  Which is equivalent to  So, it shouldn’t matter which one to prove  In practice, one form is usually easier to prove - depending which assumption gives more information (either P(x) or  Q(x)) 12

2. Proof by cases 13

Breaking a proof into cases  Theorem: for any integer n, n(n+1) is even  Proof by cases: n is even or n is odd 14

Breaking a proof into cases  Theorem: for any integer n, n(n+1) is even  Proof by cases: n is even or n is odd  Case 1: n is even.  By definition, n=2k for some integer k.  Then n(n+1)=2k(2k+1).  So n(n+1)=2a for a=k(2k+1).  a is an integer, so n(n+1) is even. 15

Breaking a proof into cases  Theorem: for any integer n, n(n+1) is even  Proof by cases: n is even or n is odd  Case 2: n is odd.  By definition, n=2k+1 for some integer k.  Then n(n+1)=(2k+1)(2k+2).  So n(n+1)=2a for a=(2k+1)(k+1).  a is an integer, so n(n+1) is even. 16

Breaking a proof into cases  We will now see a more complicated example  6 friends, Alice, Bob, Charlie, Don, Eve and Frank meet at a party  Each pair of friends either shakes hands, or not  Theorem: one of these must be true: Either there are either 3 people who all shook hands with each other; Or there are 3 people who all did not shake hands with each other 17

Breaking a proof into cases  Theorem: one of these must be true: Either there exist 3 people who all shook hands with each other; or there exist 3 people who all did not shake hands with each other  Proof: The proof is by case analysis. Case 1: Alice shook hands with at least 3 other people. Case 2: Alice shook hands with at most 2 other people.  Notice it says “there are two cases”  You’d better be right there are no more cases!  Cases must completely cover possibilities  Tip: you don’t need to worry about trying to make the cases “equal size” or scope  Sometimes 99% of the possibilities are in one case, and 1% are in the other  Whatever makes it easier to do each proof 18

Breaking a proof into cases  Theorem: one of these must be true: Either there exist 3 people who all shook hands with each other; or there exist 3 people who all did not shake hands with each other  Case 1: Alice shook hands with at least 3 other people (lets call them X,Y,Z)  Case 1.1: X,Y,Z did not shake hands with each other. In this case we proved the theorem (2 nd option)  Case 1.2: Some pair among X,Y,Z shook hands (say X,Y); Then Alice,X,Y all shook hands with each other. In this case we also proved the theorem (1 st option)  Notice it says: “This case splits into two subcases”  Again, you’d better be right there are no more than these two!  Subcases must completely cover the possibilites within the case 19

Breaking a proof into cases  Theorem: one of these must be true: Either there exist 3 people who all shook hands with each other; or there exist 3 people who all did not shake hands with each other  Case 2: Alice shook hands with at most 2 other people. Let X,Y,Z be 3 people she did not shake hands with.  Case 2.1: X,Y,Z all shook hands with each other. In this case we proved the theorem (1 st option)  Case 2.2: Some pair among X,Y,Z did not shake hands (say X,Y); Then Alice,X,Y all did not shake hands with each other. In this case we also proved the theorem (2 nd option). 20

Breaking a proof into cases  Theorem: …  Proof: There are two cases to consider  Case 1: there are two cases to consider  Case 1.1: Verify theorem directly  Case 1.2: Verify theorem directly  Case 2: there are two cases to consider  Case 2.1: Verify theorem directly  Case 2.2: Verify theorem directly 21

Perspective: Theorem in language of graphs  Graph: diagram which captures relations between pairs of objects  Example: objects=people, relation=shook hands 22 A B C D A,B shook hands A,C shook hands A,D shook hands B,C shook hands B,D didn’t shake hands C,D didn’t shake hands

Perspective: Theorem in language of graphs  Graph terminology  People = vertices  Shook hands = edge  Didn’t shake hands = no edge 23 A B C D

Perspective: Theorem in language of graphs 24  Equivalent theorem  Theorem: any graph with 6 vertices either contains a triangle (3 vertices with all edges between them) or an empty triangle (3 vertices with no edges between them)  Same theorem as before, except that we ignore the meaning of edges and non-edges in the story  This is math – isolating the core ingredients in a question, and then solving it generically.