Announcements Homework 2 Due Homework 3 Posted Due next Monday Quiz 2 on Wednesday Read Section 2.1 (Sets), 2.2 (Set Operations) and 5.1 (Mathematical Induction) Exam 1 in two weeks Monday, February 19 th 1Extensible - CSE 240 Logic Networking and Discrete Platform Mathematics 1 Existence Proofs Two ways of proving $x P(x). Either build one, or show one can be built. Constructive Non-constructive Two examples, both involving n! For the examples, think of n! as a list of factors. 2Extensible - CSE 240 Logic Networking and Discrete Platform Mathematics 2
Quantifiers: Existence Proofs Composite = Example: Prove that for all positive integers n, not prime there exist n consecutive composite integers. "n (positive integers), $x so that x, x+1, x+2,, x+n-1 are all composite. Proof: Let n be an arbitrary integer. (n + 1)! + 2 is divisible by 2, \ composite. (n + 1)! + 3 is divisible by 3, \ composite. (n + 1)! + (n + 1) is divisible by n + 1, \ composite. CONSTRUCTIVE x = (n + 1)! + 2 3Extensible - CSE 240 Logic Networking and Discrete Platform Mathematics 3 Quantifiers: Existence Proofs Infinitely many primes! Example: Prove that for all integers n, there exists a prime p so that p > n. "n (integer), $p so that p is prime, and p > n. Proof: Let n be an arbitrary integer, and consider n! + 1. If (n! + 1) is prime, we are done since (n! + 1) > n. But what if (n! + 1) is composite? If (n! + 1) is composite then it has a prime factorization, p 1 p 2 p n = (n! + 1) Consider the smallest p i, how small can it be? 4Extensible - CSE 240 Logic Networking and Discrete Platform Mathematics 4
Quantifiers: Existence Proofs "n (integers), $p so that p is prime, and p > n. Proof: Let n be an arbitrary integer, and consider n! + 1. If (n! + 1) is prime, we are done since (n! + 1) > n. But what if (n! + 1) is composite? If (n! + 1) is composite then it has a prime factorization, p 1 p 2 p n = (n! + 1) Consider the smallest p i, and call it p. How small can it be? So, p > n, and we are done. BUT WE DON T KNOW WHAT p IS!!! NON-CONSTRUCTIVE Can it be 2? Can it be 3? Can it be 4? Can it be n? 5Extensible - CSE 240 Logic Networking and Discrete Platform Mathematics 5 Another Example - Largest Prime Number Prove by contradiction: There is no largest prime number; that is, there are infinitely many prime numbers. Proof: Suppose the given conclusion is false; that is, there is a largest prime number p. So the prime numbers we have are 2,3,5,...,p; assume there are k such primes, p 1,p 2,..,and p k. Let x denote the product of all of these prime numbers plus one: x=(2 * 3 * 5... * p)+1. Clearly, x>p. When x is divided by each of the primes 2,3,5,...,p. we get 1 as the remainder. So x is not divisible by any of the primes. Hence either x must be a prime, or if x is composite then it is divisible by a prime q!= p. In either case, there are more than k primes. But this contradicts the assumption that there are k primes, so our assumption is false. In other words, there is no largest prime number. From Discrete Mathematics with Applications, by Thomas Koshy 6Extensible - CSE 240 Logic Networking and Discrete Platform Mathematics 6
Existence Proofs Proof of theorems of the form Constructive existence proof: Find an explicit value of c, for which P(c) is true. Then is true by Existential Generalization (EG). Example: Show that there is a positive integer that can be written as the sum of cubes of positive integers in two different ways: Proof: 1729 is such a number since 1729 = 10 3 + 9 3 = 12 3 + 1 3 7Extensible - CSE 240 Logic Networking and Discrete Platform Mathematics 7 Counterexamples Recall To establish that is true (or is false) find a c such that P(c) is true or P(c) is false. In this case c is called a counterexample to the assertion. Example: Every positive integer is the sum of the squares of 3 integers. The integer 7 is a counterexample. So the claim is false. 8Extensible - CSE 240 Logic Networking and Discrete Platform Mathematics 8
Uniqueness Proofs Some theorems assert the existence of a unique element with a particular property, $!x P(x). The two parts of a uniqueness proof are Existence: We show that an element x with the property exists. Uniqueness: We show that if y x, then y does not have the property. Example: Show that if a and b are real numbers and a 0, then there is a unique real number r such that ar + b = 0. Solution: Existence: The real number r = b/a is a solution of ar + b = 0 because a( b/a) + b = b + b =0. Uniqueness: Suppose that s is a real number such that as + b = 0. Then ar + b = as + b, where r = b/a. Subtracting b from both sides and dividing by a shows that r = s. 9Extensible - CSE 240 Logic Networking and Discrete Platform Mathematics 9 Proof Strategies for proving p q Choose a method First try a direct method of proof If this does not work, try an indirect method (e.g., try to prove the contrapositive) For whichever method you are trying, choose a strategy First try forward reasoning. Start with the axioms and known theorems and construct a sequence of steps that end in the conclusion. Start with p and prove q, or start with q and prove p. If this doesn t work, try backward reasoning. When trying to prove q, find a statement r that we can prove with the property p q. 10Extensible - CSE 240 Logic Networking and Discrete Platform Mathematics 10
Backward Reasoning Example: Suppose that two people play a game taking turns removing, 1, 2, or 3 stones at a time from a pile that begins with 15 stones. The person who removes the last stone wins the game. Show that the first player can win the game no matter what the second player does. Proof: Let n be the last step of the game. Step n: Player 1 can win if the pile contains 1,2, or 3 stones. Step n-1: Player 2 will have to leave such a pile if the pile that he/she is faced with has 4 stones. Step n-2: Player 1 can leave 4 stones when there are 5,6, or 7 stones left at the beginning of his/her turn. Step n-3: Player 2 must leave such a pile, if there are 8 stones. Step n-4: Player 1 has to have a pile with 9,10, or 11 stones to ensure that there are 8 left. Step n-5: Player 2 needs to be faced with 12 stones to be forced to leave 9,10, or 11. Step n-6: Player 1 can leave 12 stones by removing 3 stones. Now reasoning forward, the first player can ensure a win by removing 3 stones and leaving 12. 11Extensible - CSE 240 Logic Networking and Discrete Platform Mathematics 11 Proof and Disproof: Tilings Example 1: Can we tile the standard checkerboard using dominos? Solution: Yes! One example provides a constructive existence proof. The Standard Checkerboard Two Dominoes One Possible Solution 12Extensible - CSE 240 Logic Networking and Discrete Platform Mathematics 12
Tilings Example 2: Can we tile a checkerboard obtained by removing one of the four corner squares of a standard checkerboard? Solution: Our checkerboard has 64 1 = 63 squares. Since each domino has two squares, a board with a tiling must have an even number of squares. The number 63 is not even. We have a contradiction. 13Extensible - CSE 240 Logic Networking and Discrete Platform Mathematics 13 Tilings Example 3: Can we tile a board obtained by removing both the upper left and the lower right squares of a standard checkerboard? Nonstandard Checkerboard Dominoes 14Extensible - CSE 240 Logic Networking and Discrete Platform Mathematics 14
Tilings Solution?: There are 62 squares in this board. To tile it we need 31 dominos. Key fact: Each domino covers one black and one white square. Therefore the tiling covers 31 black squares and 31 white squares. Our board has either 30 black squares and 32 white squares or 32 black squares and 30 white squares. Contradiction! 15Extensible - CSE 240 Logic Networking and Discrete Platform Mathematics 15 The Role of Open Problems Unsolved problems have motivated much work in mathematics. Fermat s Last Theorem was conjectured more than 300 years ago. It has only recently been finally solved. Fermat s Last Theorem: The equation x n + y n = z n has no solutions in integers x, y, and z, with xyz 0 whenever n is an integer with n > 2. A proof was found by Andrew Wiles in the 1990s https://www.youtube.com/watch?v=6ymtzeetji8 16Extensible - CSE 240 Logic Networking and Discrete Platform Mathematics 16
An Open Problem The 3x + 1 Conjecture: Let T be the transformation that sends an even integer x to x/2 and an odd integer x to 3x + 1. For all positive integers x, when we repeatedly apply the transformation T, we will eventually reach the integer 1. For example, starting with x = 13: T(13) = 3 13 + 1 = 40, T(40) = 40/2 = 20, T(20) = 20/2 = 10, T(10) = 10/2 = 5, T(5) = 3 5 + 1 = 16,T(16) = 16/2 = 8, T(8) = 8/2 = 4, T(4) = 4/2 = 2, T(2) = 2/2 = 1 The conjecture has been verified using computers up to 5.6 10 13 17Extensible - CSE 240 Logic Networking and Discrete Platform Mathematics 17 Additional Proof Methods Later we will see many other proof methods: Mathematical induction, which is a useful method for proving statements of the form "n P(n), where the domain consists of all positive integers. Structural induction, which can be used to prove such results about recursively defined sets. Cantor diagonalization is used to prove results about the size of infinite sets. Combinatorial proofs use counting arguments. 18Extensible - CSE 240 Logic Networking and Discrete Platform Mathematics 18
Proof Techniques - proof by contradiction To prove a proposition p, assume not p and show a contradiction. (Prove that the sky is blue Assume that the sky is not blue ) Suppose the proposition is of the form a b, and recall that a b º a v b º (a Ù b). So assuming the opposite is to assume a Ù b. For a conditional, we assume a and prove b If I study hard, then I will earn an A Assume I study hard and I will Not earn an A 19Extensible - CSE 240 Logic Networking and Discrete Platform Mathematics 19 One More Example Show that at least 3 of any 25 days chosen must fall in the same month of the year 20Extensible - CSE 240 Logic Networking and Discrete Platform Mathematics 20
One More Example Show that at least 3 of any 25 days chosen must fall in the same month of the year Proof by contradiction Suppose p There are at most 2 days of any 25 days chosen that must fall in the same month of the year Because there are 12 months in a year and 2 days could be chosen per month, we have a maximum of 24 days that could be selected. This contradicts choosing from 25 days. Therefore p 21Extensible - CSE 240 Logic Networking and Discrete Platform Mathematics 21 Quick Background on Set Theory A set is an unordered collection of elements. Some examples: {1, 2, 3} is the set containing 1 and 2 and 3. {1, 1, 2, 3, 3} = {1, 2, 3} since repetition is irrelevant. {1, 2, 3} = {3, 2, 1} since sets are unordered. {1, 2, 3, } is a way we denote an infinite set (in this case, the natural numbers). Æ = {} is the empty set, or the set containing no elements. Note: Æ ¹ {Æ} 22Extensible - CSE 240 Logic Networking and Discrete Platform Mathematics 22
Set Theory - Definitions and notation x Î S means x is an element of set S. x Ï S means x is not an element of set S. A Í B means A is a subset of B. or, B contains A. or, every element of A is also in B. or, "x ((x Î A) (x Î B)). A B Venn Diagram 23Extensible - CSE 240 Logic Networking and Discrete Platform Mathematics 23 Set Theory - Cardinality If S is finite, then the cardinality of S, S, is the number of distinct elements in S. If S = {1,2,3}, S = 3 If S = {3,3,3,3,3}, S = 1 If S = Æ, S = 0 If S = { 1, {1}, {1,{1}} }, S = 3 If S = {0,1,2,3, }, S is infinity. (more on this later) 24Extensible - CSE 240 Logic Networking and Discrete Platform Mathematics 24
Set Theory - Power sets If S is a set, then the power set of S is 2 S = { x : x Í S }. If S = {a}, P(S) = 2 S = {Æ, {a}}. aka P(S) If S = {a,b}, If S = Æ, If S = {Æ,{Æ}}, 2 S = {Æ, {a}, {b}, {a,b}}. 2 S = {Æ}. 2 S = {Æ, {Æ}, {{Æ}}, {Æ,{Æ}}}. We say, P(S) is the set of all subsets of S. Fact: if S is finite, P(S) = 2 S. (if S = n, P(S) = 2 n ) 25Extensible - CSE 240 Logic Networking and Discrete Platform Mathematics 25 Set Theory - Operators The union of two sets A and B is: A È B = { x : x Î A v x Î B} If A = {Charlie, Lucy, Linus}, and B = {Lucy, Desi}, then A È B = {Charlie, Lucy, Linus, Desi} B A 26Extensible - CSE 240 Logic Networking and Discrete Platform Mathematics 26
On to Mathematical Induction One rule: Due to peer pressure, if the person before you likes Lucky Charms, then you like Lucky Charms. Person 1 likes Lucky Charms. What can we conclude? Everyone likes Lucky Charms! Suppose we want to prove everyone likes Fruit Loops Need to show two things: Person 1 likes Fruit Loops (FL(1)) Suggests a proof technique If person k likes Fruit Loops, then person k+1 does too. (FL(k) FL(k+1)) "n FL(n) 27Extensible - CSE 240 Logic Networking and Discrete Platform Mathematics 27 Mathematical Induction Suppose we want to prove everyone likes Fruit Loops Need to show two things: "n FL(n) Person 1 likes Fruit Loops (FL(1)) If person k likes Fruit Loops, then person k+1 does too. (FL(k) FL(k+1)) First part is a simple proposition we call the base case. Second part is a conditional. Start by assuming FL(k), and show that FL(k+1) follows. True by peer pressure 28Extensible - CSE 240 Logic Networking and Discrete Platform Mathematics 28
Mathematical Induction Use induction to prove that the sum of the first n positive odd integers is n 2. Prove a base case (n=1) Base case (n=1): the sum of the first 1 odd integer is 1 2. Yes, 1 = 1 2. Prove P(k) P(k+1) Assume P(k): the sum of the first k odd ints is k 2. 1 + 3 + + (2k - 1) = k 2 Prove that 1 + 3 + + (2k - 1) + (2k + 1) = (k+1) 2 1 + 3 + + (2k-1) + (2k+1) = k 2 + (2k + 1) = (k+1) 2 By arithmetic Inductive hypothesis By inductive hypothesis 29Extensible - CSE 240 Logic Networking and Discrete Platform Mathematics 29 Mathematical Induction Prove that 1 1! + 2 2! + + n n! = (n+1)! - 1, "n Base case (n=1): 1 1! = (1+1)! - 1? Yes, 1 1! = 1, 2! - 1 = 1 Assume P(k): 1 1! + 2 2! + + k k! = (k+1)! - 1 Prove that 1 1! + + k k! + (k+1)(k+1)! = (k+2)! - 1 1 1! + + k k! + (k+1)(k+1)! = (k+1)! - 1 + (k+1)(k+1)! = (k+1)(k+1)! + (k+1)! - 1 = (k+1)! ((k+1) + 1) - 1 = (k+1)!(k+2) - 1 = (k+2)! - 1 Inductive hypothesis 30Extensible - CSE 240 Logic Networking and Discrete Platform Mathematics 30
Mathematical Induction Prove that if a set S has S = n, then P(S) = 2 n Base case (n=0): S=ø, P(S) = {ø} and P(S) = 1 = 2 0 Assume P(k): If S = k, then P(S) = 2 k Prove that if S = k+1, then P(S ) = 2 k+1 S = S U {a} for some S Ì S with S = k, and a Î S. Partition the power set of S into the sets containing a and those not. We count these sets separately. Inductive hypothesis 31Extensible - CSE 240 Logic Networking and Discrete Platform Mathematics 31 Mathematical Induction Assume P(k): If S = k, then P(S) = 2 k Prove that if S = k+1, then P(S ) = 2 k+1 S = S U {a} for some S Ì S with S = k, and a Î S. Partition the power set of S into the sets containing a and those not. P(S ) = {X : a Î X} U {X : a Ï X} P(S ) = {X : a Î X} U P(S) Since these are all the subsets of elements in S. Subsets containing a are made by taking any set from P(S), and inserting an a. 32Extensible - CSE 240 Logic Networking and Discrete Platform Mathematics 32
Mathematical Induction Assume P(k): If S = k, then P(S) = 2 k Prove that if S = k+1, then P(S ) = 2 k+1 S = S U {a} for some S Ì S with S = k, and a Î S. P(S ) = {X : a Î X} U {X : a Ï X} P(S ) = {X : a Î X} U P(S) P(S ) = {X : a Î X} + P(S) = 2 P(S) = 2 2 k = 2 k+1 Subsets containing a are made by taking any set from P(S), and inserting an a. So {X : a Î X} = P(S) 33Extensible - CSE 240 Logic Networking and Discrete Platform Mathematics 33