CIS Spring 2018 (instructor Val Tannen)

Similar documents
Putnam Pigeonhole Principle October 25, 2005

Pigeonhole Principle and Ramsey Theory

CIS Spring 2018 (instructor Val Tannen)

Counting Methods. CSE 191, Class Note 05: Counting Methods Computer Sci & Eng Dept SUNY Buffalo

CS 210 Foundations of Computer Science

CS Foundations of Computing

LECTURE 1. Logic and Proofs

Review 3. Andreas Klappenecker

Definition: Let S and T be sets. A binary relation on SxT is any subset of SxT. A binary relation on S is any subset of SxS.

CMSC 250 Spring 2016: Final Exam Review Questions Key

CSCE 222 Discrete Structures for Computing. Review for the Final. Hyunyoung Lee

Lecture 3: Miscellaneous Techniques

Monochromatic and Rainbow Colorings

MATH 402 : 2017 page 1 of 6

2. Two binary operations (addition, denoted + and multiplication, denoted

F 2k 1 = F 2n. for all positive integers n.

MATH 324 Summer 2011 Elementary Number Theory. Notes on Mathematical Induction. Recall the following axiom for the set of integers.

Basic Logic and Proof Techniques

Some Review Problems for Exam 1: Solutions

Notes. Combinatorics. Combinatorics II. Notes. Notes. Slides by Christopher M. Bourke Instructor: Berthe Y. Choueiry. Spring 2006

Reading and Writing. Mathematical Proofs. Slides by Arthur van Goetham

Algorithms: Background

Lecture 6: The Pigeonhole Principle and Probability Spaces

Contribution of Problems

Writing Mathematical Proofs

Propositional Logic, Predicates, and Equivalence

Outline Goals and Assumptions Real Numbers Rational and Irrational. L11: Numbers. Alice E. Fischer

WUCT121. Discrete Mathematics. Numbers

LECTURE NOTES DISCRETE MATHEMATICS. Eusebius Doedel

MCS-236: Graph Theory Handout #A4 San Skulrattanakulchai Gustavus Adolphus College Sep 15, Methods of Proof

means is a subset of. So we say A B for sets A and B if x A we have x B holds. BY CONTRAST, a S means that a is a member of S.

CDM Combinatorial Principles

Lecture 5 : Proofs DRAFT

Introduction to Decision Sciences Lecture 10

Math 324 Summer 2012 Elementary Number Theory Notes on Mathematical Induction

Lecture 3 - Tuesday July 5th

Math 10850, fall 2017, University of Notre Dame

CHAPTER 8: EXPLORING R

Direct Proof MAT231. Fall Transition to Higher Mathematics. MAT231 (Transition to Higher Math) Direct Proof Fall / 24

Finite and Infinite Sets

The Pigeonhole Principle

6 CARDINALITY OF SETS

Lecture Notes on DISCRETE MATHEMATICS. Eusebius Doedel

Lecture 4: Constructing the Integers, Rationals and Reals

CS 173: Induction. Madhusudan Parthasarathy University of Illinois at Urbana-Champaign. February 7, 2016

a. See the textbook for examples of proving logical equivalence using truth tables. b. There is a real number x for which f (x) < 0. (x 1) 2 > 0.

Equivalence of Propositions

Math 38: Graph Theory Spring 2004 Dartmouth College. On Writing Proofs. 1 Introduction. 2 Finding A Solution

n f(k) k=1 means to evaluate the function f(k) at k = 1, 2,..., n and add up the results. In other words: n f(k) = f(1) + f(2) f(n). 1 = 2n 2.

Chapter 1. Pigeonhole Principle

Combinatorics. But there are some standard techniques. That s what we ll be studying.

The following techniques for methods of proofs are discussed in our text: - Vacuous proof - Trivial proof

Notes on arithmetic. 1. Representation in base B

Math 31 Lesson Plan. Day 2: Sets; Binary Operations. Elizabeth Gillaspy. September 23, 2011

Mat Week 8. Week 8. gcd() Mat Bases. Integers & Computers. Linear Combos. Week 8. Induction Proofs. Fall 2013

CMPSCI 250: Introduction to Computation. Lecture 11: Proof Techniques David Mix Barrington 5 March 2013

THE LOGIC OF QUANTIFIED STATEMENTS. Predicates and Quantified Statements I. Predicates and Quantified Statements I CHAPTER 3 SECTION 3.

CIS Spring 2018 (instructor Val Tannen) Midterm 1 Review WITH SOLUTIONS

Student Responsibilities Week 8. Mat Section 3.6 Integers and Algorithms. Algorithm to Find gcd()

1 Sequences and Summation

Lecture Overview. 2 Weak Induction

Posted Thursday February 14. STUDY IN-DEPTH...the posted solutions to homeworks 1-3. Compare with your own solutions.

Section 20: Arrow Diagrams on the Integers

3 The language of proof

Writing proofs for MATH 61CM, 61DM Week 1: basic logic, proof by contradiction, proof by induction

Notes on induction proofs and recursive definitions

TIPS FOR WRITING PROOFS IN HOMEWORK ASSIGNMENTS. 1. Simple rules

Lecture 7 Feb 4, 14. Sections 1.7 and 1.8 Some problems from Sec 1.8

35 Chapter CHAPTER 4: Mathematical Proof

BmMT 2017 Individual Round Solutions November 19, 2017

1. Propositions: Contrapositives and Converses

After that, we will introduce more ideas from Chapter 5: Number Theory. Your quiz in recitation tomorrow will involve writing proofs like those.

Technische Universität München Department of Computer Science. Joint Advanced Students School 2009 Propositional Proof Complexity.

Lecture 4: Probability, Proof Techniques, Method of Induction Lecturer: Lale Özkahya

Section Summary. Proof by Cases Existence Proofs

Discrete Mathematics and Probability Theory Spring 2016 Rao and Walrand Note 8

Basic Combinatorics. Math 40210, Section 01 Fall Homework 8 Solutions

Before you get started, make sure you ve read Chapter 1, which sets the tone for the work we will begin doing here.

CSE 20 DISCRETE MATH SPRING

Lecture 2: Continued fractions, rational approximations

At the start of the term, we saw the following formula for computing the sum of the first n integers:

The theory of numbers

Your quiz in recitation on Tuesday will cover 3.1: Arguments and inference. Your also have an online quiz, covering 3.1, due by 11:59 p.m., Tuesday.

3 Finite continued fractions

Assignment #2 COMP 3200 Spring 2012 Prof. Stucki

A Brief Introduction to Proofs

Discrete Mathematics and Probability Theory Fall 2018 Alistair Sinclair and Yun Song Note 2

Theorem (Special Case of Ramsey s Theorem) R(k, l) is finite. Furthermore, it satisfies,

MAT115A-21 COMPLETE LECTURE NOTES

Mathematics Review for Business PhD Students Lecture Notes

Proofs. Chapter 2 P P Q Q

Discrete Structures for Computer Science: Counting, Recursion, and Probability

Chapter 1 : The language of mathematics.

MATH 117 LECTURE NOTES

Chapter 1 The Real Numbers

Math 202 notes. Jason Riedy. 27 August, Review 1. 2 Ruling out possibilities Logic puzzles The pigeonhole principle 2

CS103 Handout 08 Spring 2012 April 20, 2012 Problem Set 3

MATH 2200 Final LC Review

SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION

Preparing for the CS 173 (A) Fall 2018 Midterm 1

Transcription:

CIS 160 - Spring 2018 (instructor Val Tannen) Lecture 09 Tuesday, February 13 PROOFS and COUNTING Figure 1: Too Many Pigeons Theorem 9.1 (The Pigeonhole Principle (PHP)) If k + 1 or more pigeons fly to roost in k pigeonholes then there is at least one pigeonhole that shelters at least two or more pigeons. or, equivalently, If f : A B is a function such that A > B then there exist at least two elements x 1, x 2 A such that x 1 x 2 but f(x 1 ) = f(x 2 ). (Why are these two formulations equivalent?) 1 From the second formulation we see that the Pigeonhole Principle is the contrapositive of the Injection Rule that we encountered before. We continue to accept them without proof. 1 In France, they say Principle of the Drawers instead of PHP. It might be easier to place k + 1 pieces of underwear in k drawers than to persuade k + 1 pigeons to fly into k pigeonholes together. 1

For example, the (PHP) can be used to conclude that in any group of thirteen people there are at least two who are born in the same month. Example 9.2 A drawer in a dark room contains red socks, green socks, blue socks, and orange socks. How many socks must you take from the drawer to be sure that you have at least one matching pair? (We assume that any two socks of the same color form a matching pair.) Solution: PHP can be applied by letting the pigeonholes correspond to the four colors: red, green, blue, and orange and the pigeons correspond to the socks. If we pick five or more socks we are guaranteed to have a matching pair. A weird application much beloved by some textbook authors is to prove that in NYC (or another big enough city) there exist two people with exactly the same number of hairs on their head. Surely, the premed students among you already know that the number of hairs on a person s head is at most 200,000. Actually, this only requires a city with 200,000 non-bald inhabitants. With 1M or 10M such inhabitants we can say more, by generalizing PHP as follows. But first, we ll need to formalize a couple concepts. In general, for integers r and n, the division r/n may not yield an integer. The notation r/n is called ceiling and can be defined for any real number, together with its dual, floor: Definition 9.3 Let x R. The ceiling of x, denoted x is the smallest integer z such that z x. Note that: x x < x + 1 The floor of x, denoted x is the largest integer z such that z x. Note that: x 1 < x < x With this definition in hand, we may now generalize PHP. Theorem 9.4 (The Generalized PHP) r objects are placed into n boxes. For any integer k such that r > k n there is at least one box containing at least k + 1 objects. or, equivalently, If f : A B is a function and k is an positive integer such that A > k B then there exist at least k + 1 pairwise distinct elements x 1,..., x k+1 A such that f(x 1 ) = = f(x k+1 ). or, equivalently, If r objects are placed into n boxes then there is at least one box containing at least r/n objects. Proof: Here is a proof of the last formulation of the three for the GPHP (the generalized PHP). You should prove on your own that the first two formulation are equivalent to the last one. 2

We prove the contrapositive. That is, we will show that if each box contains at most r/n 1 objects then the total number of objects is not equal to r. Assume that each box contains at most r/n 1 objects. Then, the total number of objects is at most ( r ) ( r ) n 1 < n n n + 1 1 = r Thus we have shown that the total number of objects is strictly less than r. Using the generalized pigeonhole principle we can conclude that among 100 people, there are at least 100/12 = 9 who are born in the same month. Example 9.5 Suppose each point in the plane is colored either red or blue. Show that there always exist two points of the same color that are exactly one foot apart. Solution: Consider an equilateral triangle with the length of each side being one feet. The three corners of the triangle are colored red or blue. By PHP, two of these three points must have the same color. (Note that the set of points in the plane is infinite, but we do not apply PHP to an infinite set!) Example 9.6 Given a sequence of n integers, show that there exists among them some integers which appear in consecutive positions in the sequence and whose sum is a multiple of n. Solution: Let x 1, x 2,..., x n be the sequence of n integers. Consider the following n sums. x 1, x 1 + x 2, x 1 + x 2 + x 3,..., x 1 + x 2 + + x n If any of these n sums is divisible by n, then we are done. Otherwise, each of the n sums have a non-zero remainder when divided by n. There are at most n 1 different possible remainders: 1, 2,... n 1. Since there are n sums, by PHP, at least two of the n sums have the same remainder, call it r, when divided by n and let x 1 + x 2 + + x p and x 1 + x 2 + + x q with p q, be the two sums that give remainder r. Then, for some integers c 1 and c 2, x 1 + x 2 + + x p = c 1 n + r and x 1 + x 2 + + x q = c 2 n + r W.l.o.g. assume p < q. Subtracting the two sums, we get x p+1 + + x q = (c 2 c 1 )n Hence, x p+1 + + x q is divisible by n. 3

Example 9.7 Show that in any group of six people there are three mutual friends or three mutual strangers. (The unrealistic assumption here is that any two people are either friends or strangers.) Solution: Consider one of the six people, say A. The remaining five people are either friends of A or they do not know A. By PHP, at least 3 of the five people are either friends of A or are unacquainted with A. In the former case, if any two of the three people are friends then these two along with A would be mutual friends, otherwise the three people would be strangers to each other. The proof for the latter case, when three or more people are unacquainted with A, proceeds in the same manner. (BTW, this is a particular case of a famous theorem of Ramsey. We will come back to this later in the course.) Theorem 9.8 (Erdös-Szekeres) Let n be a positive integer. Every sequence of n 2 + 1 distinct integers must contain a monotone (increasing or decreasing) subsequence of length n + 1. Proof: Subsequence means that some of the elements are chosen and listed in the same order. The elements of the subsequence need not be consecutive or adjacent in the sequence. Suppose we have a sequence of distinct integers. (We don t need this in the proof, but w.l.o.g. you can assume that they are positive; why?) For each integer x in the sequence let u x be the length of a longest increasing subsequence that starts at x (we count x in the length) and let d x be the length of a longest decreasing subsequence that starts at x (again we count x in the length). Lemma 9.9 If x y are distinct integers in the sequence such that x occurs before y then (u x, d x ) (u y, d y ). Proof: Indeed, if x < y then u x > u y (why?) and if x > y then d x > d y. Now we prove the theorem by contradiction. Suppose that all monotone subsequences have length at most n. Then for each x in the sequence we have u x, d x [1..n]. We use PHP with the pairs (i, j) [1..n] [1..n] as pigeonholes, with the integers in the sequence as pigeons, and with pigeon x being placed in pigeonhole (u x, d x ). Since we have n 2 + 1 integers in the sequence but only n 2 pairs in [1..n] [1..n], we must have (u x, d x ) = (u y, d y ) for some distinct x y. This contradicts the Lemma. 2 2 Paul Erdös was one of the most famous mathematicians of the 20th century, google Erdos and read the Wikipedia page. 4

PROOFS: INDUCTION The Principle of (Ordinary) Induction of the form is a way (not the only way!) of proving statements for all natural numbers n we have P (n) where P (n) is a predicate whose truth depends on n. Examples of P (n) s of interest: (A) P (n) is 2 0 + 2 1 + + 2 n = 2 n+1 1 (B) P (n) is 1 + 2 + 3 + + n = n(n + 1)/2 (C) P (n) is 1 2 + 2 2 + 3 2 + + n 2 = n(n + 1)(2n + 1)/6 Proof Pattern (BASE CASE) Prove P (0). (INDUCTION STEP) Let k be an arbitrary natural number. Prove P (k) P (k + 1). Then you can conclude that for all natural numbers n we have P (n) (i.e., n N P (n)). The P (k) inside the box in the induction step is called the INDUCTION HYPOTHESIS (IH). The IH only makes sense within the induction step because it refers to a k that is quantified at the beginning of the induction step with let k be.... To understand a proof by induction it helps if the proof writer clearly identifies the IH. We shall accept the Principle of Ordinary Induction without proof. (It is very close to the axioms of Mathematics itself.) We shall see later the Principle of Strong Induction, hence the need for the adjective ordinary, and below the Well-Ordering Principle. These three are logically equivalent to each other, a fact that is not so hard to prove. Try it. Example 9.10 ((A) from above) Prove the following: n N 2 0 + 2 1 + + 2 n = 2 n+1 1 Solution: Here P (n) is 2 0 + 2 1 + + 2 n = 2 n+1 1. (BASE CASE) 2 0 = 1 and 2 0+1 1 = 2 1 = 1. Check. 5

(INDUCTION STEP) Let k be an arbitrary natural number. Assume 2 0 + 2 1 + + 2 k = 2 k+1 1. (This is the IH.) (And WTS 2 0 + 2 1 + + 2 k+1 = 2 k+2 1.) We manipulate the LHS of the equality we want to show: 2 0 + 2 1 + + 2 k+1 = (2 0 + 2 1 + + 2 k ) + 2 k+1 = 2 k+1 1 + 2 k+1 (by IH) = 2 2 k+1 1 = 2 k+2 1 BTW, this identity gives the summation of the geometric progression with ration 2. Sometimes the predicate P (n) used in a proof by induction is not true for n = 0, it is not even defined for n = 0, as is the case in the Examples (B) and (C) above. The following variation on the induction proof pattern takes care of such situations. Proof Pattern (BASE CASE) Prove P (n 0 ). (INDUCTION STEP) Let k N such that k n 0. Prove P (k) P (k + 1). Then you can conclude that for all natural numbers n n 0 we have P (n) (i.e., n N n n 0 P (n)). Using this proof pattern you should try to prove (B) and (C), with n 0 = 1. We will do a slightly more complicated example. Example 9.11 For big enough natural numbers n we have n 2 < 2 n. Part of the problem is to make precise big enough. Solution: To figure out the big enough we try n = 0, 1, 2, 3, 4, 5, 6 and we guess that it can be n 5. (BASE CASE) n = 5. 5 2 = 25 < 32 = 2 5. Check. (INDUCTION STEP) Let k 5. Assume (IH) k 2 < 2 k. (And WTS (k + 1) 2 < 2 k+1.) Note that (k + 1) 2 = k 2 + 2k + 1 and that 2 k+1 = 2 2 k = 2 k + 2 k. We already know by IH that k 2 < 2 k. So it would suffice to also show 2k + 1 k 2. We make this into a separate Lemma: 6

Lemma 9.12 For big enough m N we have 2m + 1 < m 2. Solution: Here, as above, we will assume that m 5. We then see that: 1 < m = 2m + 1 < 2m + m = 3m Similarly, we see that: Combining these two results, we have 3 < m = 3m < m 2 2m + 1 < 3m < m 2 as desired. In fact, we could have proven this Lemma with induction! We leave it as an exercise for the reader. Returning to the main proof, we have that: (k + 1) 2 = k 2 + 2k + 1 < k 2 + k 2 < 2 k + 2 k = 2 k+1 We have shown that n 5 n 2 < 2 n. 7