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

Slides:



Advertisements
Similar presentations
Is it rational or irrational?
Advertisements

Introduction to Proofs
PROOF BY CONTRADICTION
Chapter 3 Elementary Number Theory and Methods of Proof.
CSE 20 DISCRETE MATH Prof. Shachar Lovett Clicker frequency: CA.
Prof. Shachar Lovett Clicker frequency: CA CSE 20 Discrete math Prof. Shachar Lovett
1 In this lecture  Number Theory ● Rational numbers ● Divisibility  Proofs ● Direct proofs (cont.) ● Common mistakes in proofs ● Disproof by counterexample.
Proofs, Recursion and Analysis of Algorithms Mathematical Structures for Computer Science Chapter 2 Copyright © 2006 W.H. Freeman & Co.MSCS SlidesProofs,
Logic and Proof. Argument An argument is a sequence of statements. All statements but the first one are called assumptions or hypothesis. The final statement.
CSE115/ENGR160 Discrete Mathematics 01/31/12 Ming-Hsuan Yang UC Merced 1.
1 Indirect Argument: Contradiction and Contraposition.
Introduction to Proofs ch. 1.6, pg. 87,93 Muhammad Arief download dari
Methods of Proof Lecture 4: Sep 16 (chapter 3 of the book)
CSE 20 DISCRETE MATH Prof. Shachar Lovett Clicker frequency: CA.
Methods of Proof & Proof Strategies
CSE 20 – Discrete Mathematics Dr. Cynthia Bailey Lee Dr. Shachar Lovett Peer Instruction in Discrete Mathematics by Cynthia Leeis licensed under a Creative.
Ch 1.5: Basic Proof Methods II Proof by Contraposition of P => Q Suppose ~Q …proof details here…. Therefore, ~P (via a direct proof) Thus, ~Q => ~P. Therefore,
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.
Conditional Statements CS 2312, Discrete Structures II Poorvi L. Vora, GW.
CSE 20 – Discrete Mathematics Dr. Cynthia Bailey Lee Dr. Shachar Lovett Peer Instruction in Discrete Mathematics by Cynthia Leeis licensed under a Creative.
CS 173, Lecture B August 27, 2015 Tandy Warnow. Proofs You want to prove that some statement A is true. You can try to prove it directly, or you can prove.
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.
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.
Reading and Writing Mathematical Proofs Spring 2015 Lecture 2: Basic Proving Techniques.
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.
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.
Week 4 - Monday.  What did we talk about last time?  Divisibility  Quotient-remainder theorem  Proof by cases.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
CS104:Discrete Structures Chapter 2: Proof Techniques.
Week 4 - Friday.  What did we talk about last time?  Floor and ceiling  Proof by contradiction.
Week 4 - Wednesday.  What did we talk about last time?  Divisibility  Proof by cases.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
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.
EXAMPLE 3 Write an indirect proof Write an indirect proof that an odd number is not divisible by 4. GIVEN : x is an odd number. PROVE : x is not divisible.
Methods of Proof Lecture 4: Sep 20 (chapter 3 of the book, except 3.5 and 3.8)
CS 173, Lecture B August 27, 2015 Tandy Warnow. Proofs You want to prove that some statement A is true. You can try to prove it directly, or you can prove.
Dr Nazir A. Zafar Advanced Algorithms Analysis and Design Advanced Algorithms Analysis and Design By Dr. Nazir Ahmad Zafar.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
The Foundations: Logic and Proofs
CSE15 Discrete Mathematics 02/01/17
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett
CISC 2315 Discrete Structures
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett
321 Section, 2-7 Natalie Linnell.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett
“What in the Sam Hill is that?”
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett
Lesson 5 – 4 Indirect Proof
An indirect proof uses a temporary assumption that
Sets and Logic…. Chapter 3
The Foundations: Logic and Proofs
Indirect Proof by Contradiction Direct Proof by Cases
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett
CS 220: Discrete Structures and their Applications
Methods of Proof Rosen 1.7, 1.8 Lecture 4: Sept 24, 25.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett
Foundations of Discrete Mathematics
5.6 Inequalities in Two Triangles and Indirect Proof
Proof: [We take the negation and suppose it to be true.]
Methods of Proof Rosen 1.7, 1.8 Lecture 4: Sept, 2019.
Presentation transcript:

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

Today’s Topics: A second look at contradictions Proof by contradiction template Practice negating theorems

T. A second look at contradictions Q: Do you like CSE20? A: Yes and no...

P AND P = Contradiction It is not possible for both P and NOT P to be true This simply should not happen! This is logic, not Shakespeare Here’s much to do with hate, but more with  love. Why, then, O brawling love! O loving hate! O anything, of nothing first create! O heavy lightness! Serious vanity! Mis-shapen chaos of well-seeming forms! Feather of lead, bright smoke, cold fire, Sick health! Still-waking sleep, that is not what it is! This love feel I, that feel no love in this. [Romeo and Juliet]

Contradictions destroy the entire system that contains them Draw the truth table: F,F,F,F T,T,T,T F,T,F,T F,F,T,T None/more/other p q (p ∧ ¬p) (p ∧ ¬p)  q F T

Contradictions destroy the entire system that contains them p q (p ∧ ¬p) (p ∧ ¬p)  q F T Draw the truth table: Here’s the scary part: it doesn’t matter what q is! q=“All irrational numbers are integers.” q=“The Beatles were a terrible band.” q=“Dividing by zero is totally fine!” All these can be “proved” true in a system that contains a contradiction!

Proof by contradiction template Thm. [write theorem] Proof (by contradiction): Assume not. That is, suppose that [theorem] (Don’t just write (theorem). For example,  changes to , use DeMorgan’s law if needed, etc.) [write something that leads to a contradiction: “… [p] … so [p]. But [p], a contradiction”] Conclusion: So the assumed assumption is false and the theorem is true. QED.

Example 1 Thm. There is no integer that is both even and odd. Proof (by contradiction) Assume not. That is, suppose All integers are both odd and even All integers are not even or not odd. There is an integer n that is both odd and even. There is an integer n that is neither even nor odd. Other/none/more than one

Some useful notation Z = “set of all integers” E = “set of even integers” O = “set of odd integers” 𝑛∈𝑍: n belongs to set Z (n is an integer) 𝑛∈𝐸: n belongs to set E (n is an even integer) 𝑛∈𝑂: n belongs to set O (n is an odd integer) We will learn much more about sets later

Be careful about doing negations Theorem: “there is no integer that is both even and odd”   nZ (nE  nO)  nZ  (nE  nO) Negation:  nZ (nE  nO) “There is an integer n that is both even and odd”

Example 1 Try by yourself first Thm. There is no integer that is both even and odd. Proof (by contradiction) Assume not. That is, suppose there exists an integer n that is both even and odd. Try by yourself first

Example 1 Thm. There is no integer that is both even and odd. Proof (by contradiction) Assume not. That is, suppose there exists an integer n that is both even and odd. Conclusion: The assumed assumption is false and the theorem is true. QED. Since n is even n=2a for an integer a. Since n is odd n=2b+1 for an integer b. So 2a=2b+1. Subtracting, 2(a-b)=1. So a-b=1/2 but this is impossible for integers a,b. A contradiction.

Example 2 A number x is rational if x=a/b for integers a,b. A number is irrational if it is not rational E.g (proved in textbook) Theorem: If x2 is irrational then x is irrational.

Example 2 Theorem: If x2 is irrational then x is irrational. Proof: by contradiction. Assume that There exists x where both x,x2 are rational There exists x where both x,x2 are irrational There exists x where x is rational and x2 irrational There exists x where x is irrational and x2 rational None/other/more than one

Example 2 Try by yourself first Theorem: If x2 is irrational then x is irrational. Proof: by contradiction. Assume that there exists x where x is rational and x2 irrational. Try by yourself first

Example 2 Theorem: If x2 is irrational then x is irrational. Proof: by contradiction. Assume that there exists x where x is rational and x2 irrational. Since x is rational x=a/b where a,b are integers. But then x2=a2/b2. Both a2,b2 are also integers and hence x2 is rational. A contracition.

Example 3 Theorem: 6 is irrational Proof (by contradiction). THIS ONE IS MORE TRICKY. TRY BY YOURSELF FIRST IN GROUPS.

6 is irrational Theorem: 6 is irrational Proof (by contradiction): Assume it is rational So: 6 =𝑎/𝑏 where a,b are integers We can assume that a,b are not both even (otherwise we can divide both by 2) Squaring gives: 6= 𝑎 2 / 𝑏 2 𝑎 2 =6 𝑏 2 So 𝑎 2 is even. We will need to show this implies that also 𝑎 is even

Lemma 1 Lemma 1: let n be an integer. If n2 is even then n is even. Lemma = mini-proof, as part of a larger proof; like a function in a larger program. Proof: by contradiction. Assume n is odd. So 𝑛=2𝑎+1 for some integer a. Then 𝑛 2 = 2𝑎+1 2 =4 𝑎 2 +4𝑎+1=2 2 𝑎 2 +2𝑎 +1. So 𝑛 2 =2b+1 for integer b (b=2 𝑎 2 +2𝑎). Contradiction.

6 is irrational Back to proof that 6 is not rational We had (towards contradiction) 𝑎 2 =6 𝑏 2 𝑎 2 is even  by lemma, 𝑎 is even So a=2c for some integer c 6 𝑏 2 = 2𝑐 2 =4 𝑐 2 3 𝑏 2 =2 𝑐 2 3 𝑏 2 is even; we need to show b is even (this will require another lemma) This will give us the contradiction, as we assumed that a,b are not both even.

Lemma 2 Lemma 2: let n be an integer. If 3n2 is even then n is even. Proof: by contradiction. Assume n is odd. So 𝑛=2𝑎+1 for some integer a. Then 3 𝑛 2 = 3 2𝑎+1 2 =T2 𝑎 2 +12𝑎+3=2 6 𝑎 2 +6𝑎+1 +1. So 𝑛 2 =2b+1 for integer b (b=6 𝑎 2 +6𝑎+1). Contradiction.

6 is irrational: summary Goal: prove that 6 is not rational We assumed towards contradiction it is, 6 =𝑎/𝑏 We can assume a,b have no common factor (otherwise we can cancel it) However, we proved that both a,b are even, e.g. both divisible by two A contradiction!

6 is irrational: summary We want to prove that 6 is not rational Use proof by contradiction Along the way, we realize that we need Lemma 1 So we prove it Continuing on, we realize that we also need Lemma 2 And we reached a contradiction!