Download presentation
Presentation is loading. Please wait.
1
Proof by Contradiction
Discrete Structures (CS 173) Adapted from Derek Hoiem, University of Illinois
2
Proof by Contradiction
Sometimes you want to show that something is impossible 2 cannot be written as a ratio of integers There is no compression algorithm that reduces the size of all files A cycle with an odd number of nodes can’t be colored with two colors Difficult to prove non-existence directly, and can’t prove by example Solution: show that the negation of the claim leads to a contradiction
3
Contradiction A set of propositions is a contradiction if their conjunction is always false Contradiction? 𝑝∧¬𝑝 𝑝∨¬𝑝 (𝑥>5)∧(𝑥>21) 𝑥=20 and 𝑥 is odd (𝑥>5)∧(𝑥<21) (𝑥<5)∧(𝑥>21) 𝑥 is negative number and 𝑥 is real
4
Proof by contradiction
Claim: There are infinitely many prime numbers Equivalent claim: There is not a finite set of primes. Suppose that there exist only finitely many primes p1 < p2 < ... < pr. Let N = p1.p2.....pr. The integer N-1, being a product of primes, has a prime divisor pi in common with N; so, pi divides N - (N-1) =1, which is absurd!
5
Basic form of proof by contradiction
I need to show proposition 𝑝 Suppose, instead, that 𝑝 is false. Then, we can see that both 𝑞 and¬𝑞, which is a contradiction. Therefore, 𝑝 must be true.
6
Why proof by contradiction works
We need to prove proposition 𝑝 Instead, we show ¬𝑝→𝐹, i.e., that we can conclude a contradiction from not 𝑝 By contrapositive, ¬𝑝→𝐹≡𝑇→𝑝≡𝑝
7
Another explanation We need to prove proposition 𝑝=𝑇 Instead, we show ¬𝑝→𝐹, i.e., that we can conclude a contradiction from ¬ 𝑝 But ¬𝑝→𝐹 means that ¬𝑝=𝐹, so 𝑝=𝑇
8
See this blog post about P=NP problem
Danger of proof by contradiction: a mistake in the proof might also lead to a contradiction See this blog post about P=NP problem
9
Proof by contradiction
Claim: 2 is irrational Equivalent claim: There does not exist a pair of integers 𝑎, 𝑏 without common factors such that 𝑎 𝑏 = 2 Both even
10
Proof by contradiction
Claim: No lossless compression algorithm can reduce the size of every file. Suppose your boss tells you to create an audio compression algorithm that is guaranteed to reduce the size of any file. You realize that this is an impossible task and want to prove it. How?
11
Why image compression works: images are mostly smooth
12
Proof by contradiction
Claim: A cycle graph with an odd number of nodes is not 2-colorable. V_0=V_n+1 and must be red and blue since even blue and odd red and both the same.
13
Proof by contradiction or contrapositive
Claim: For all integers 𝑛, if 𝑛 2 is odd, then 𝑛 is odd. Prove by contradiction, then prove by contrapositive. ( n even -> n^ even)
14
When to use each type of proof
Match the situation to the proof type Situation Can see how conclusion directly follows from hypothesis Need to demonstrate claim for an unbounded set of integers Easier to show that negation of hypothesis follows from negation of conclusion Need to show that something doesn’t exist Need to show that something exists Proof type Direct proof Proof by example or counter-example Proof by contrapositive (or logical equivalence) Induction Proof by contradiction
15
When to use each type of proof
Match the situation to the proof type Situation Can see how conclusion directly follows from claim (a) Need to demonstrate claim for an unbounded set of integers (d) Easier to show that negation of hypothesis follows from negation of conclusion (c) Need to show that something doesn’t exist (e) Need to show that something exists (b) Proof type Direct proof Proof by example or counter-example Proof by contrapositive (or logical equivalence) Induction Proof by contradiction
16
When to use each type of proof
Match the claim to the suitable proof type Claim There is no real 𝑥, such that 𝑥 2 <0. If 𝑛 2 is odd, then 𝑛 is odd. There is an integer 𝑥, such that 𝑥 2 =0. If 𝑛 is odd, then 𝑛 2 is odd. All trees have more nodes than edges. A wheel graph can’t be colored with two colors. Not every natural number is a square. The sum of two rational numbers is rational. An even number can’t be created from the product of odd numbers. Proof type Direct proof Proof by example or counter-example Proof by contrapositive (or logical equivalence) Induction Proof by contradiction
17
State diagrams state transition action
18
Simple example: traffic signal
19
Transition functions and state diagrams
States: Village, Rock, Snake, Chasm, Gold, Desert Transitions: (Village, North) Desert (Village, East) Snake (Desert, South) Village (Desert, East) Rock (Rock, West) Desert (Snake, West)Village (Snake, East) Chasm (Snake, South) Gold (Gold, North)Snake
20
Transition functions and state diagrams
Input sequence to beat the game: N, E, E, E, E, N, E, N, W, GET ROCK, N, W, N, W, N, W, N, THROW ROCK, N, DRINK WATER, E, GET STICK, THROW STICK, W, N, THROW STICK, LOOK HOLE, GET NOTE, N, W, LIFT ROCK, N, GET NOTE, E, GET LOCKET, E, E, S, W, W, LOOK HOLE, GET CRACKER, E, N, N, W, N, W, N, SAY HOCUS, N, GO HOUSE, GET APPLE, W, N, LOOK GNOME, N, E, SAY HISS, GO CREVICE, S, S, S, GET BREAD, GET LOCKET, GET CRACKER, UNLOCK DOOR, OPEN DOOR, GO DOOR, U, GO HOLE, N, E, S, GIVE CRACKER, GET VIAL, N, W, S, W, W, THROW BREAD, N, GET ROPE, GO BOAT USE BLANKET, N, N, DRINK WATER, N, E, E, E, GO BEACH, N, N, E, GET ANCHOR, W, TIE ROPE, TO ANCHOR, THROW ANCHOR, UP, GET SHOVEL, DOWN, S, S, DIG X, LOOK TREASURE, GRAB CHEST, LEAVE, E, N, W, GO CAVE, OPEN CHEST, LOOK CHEST, GET HARP, N, E, N, DRINK VIAL, FLY NORTH, N, GET RING, N, W, FOLLOW RAINBOW, GET COIN, N, SAY LUCY, W, W, N, GO CAVE, GET ALL, N, S, W, PLAY HARP, N, N, BUY HORN, N, N, BLOW HORN, N, U, E, OPEN CLOSET, LOOK CLOSET, GET SHOES, LOOK SHOES, W, D, W, W, LOOK THRONE, THROW APPLE, N, E, LOOK CABINET, PICK LOCK, WITH KNIFE, OPEN DOOR, E, U, D, U, WEAR RING, RUB RING, D, E, KISS FROG, WEAR SHOES, SAY WHOOSH Adventures in Serenia
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.