Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


Presentation on theme: "CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett"— Presentation transcript:

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

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

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

4 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]

5 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

6 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!

7 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.

8 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

9 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

10 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”

11 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

12 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.

13 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.

14 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

15 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

16 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.

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

18 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

19 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.

20 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.

21 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.

22 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!

23 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!


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

Similar presentations


Ads by Google