Unformatted text preview:

CS/Math 240: Introduction to Discrete Mathematics 5/5/2011Lecture 27 : Combinatorial ArgumentsInstructor: Dieter van Melkebeek Scribe: Dalibor Zelen´yDRAFTLast time we continued our discussion of counting. In general, this is a problem in which weare given a description of a finite set, and our goal is to find the set’s cardinality. Last time wediscussed some more examples and also the inclusion-exclusion principle which is a generalizationof the sum rule from two lec tur e s ago.Today we give another example of the inclusion-exclusion principle. Afte r that, we discuss thepigeonhole principle. The pigeonhole principle is not a counting technique. It allows us to provethat some events happen, but does not provide any more details about how they occur. Our lasttopic (today and in this course) will be combinatorial arguments. The idea behind those is that wecan often count a set in multiple ways, and viewing it in different ways yields some identities andinequalities between mathematical objects.27.1 Inclusion-Exclusion ContinuedRecall that the inclusion-exclusi on formula is a generalization of the sum rule. We have sets S1through Ss, and want to find the cardinality of their union as a function of cardinalities of othersets. In particular, we have the following identity.s[i=1Si=X06=I⊆[s](−1)|I|+1\i∈ISi=sXi=1|Si| −X1≤i<j≤s|Si∩ Sj| +X1≤i<j<k≤s|Si∩ Sj∩ Sk| − ··· + (−1)s+1|S1∩ ··· ∩ Ss|Let’s see an example. We would l i ke to count the primes less than or equal t o 100. One way todo it would be two write down all numbers between 2 and 100 and cross out nontrivial multiplesof each number. The numbers that are left are primes. This algorithm is known as the sieve ofEratosthenes. It works fairly well for small sets of primes, but gets too complex for larger sets . Weuse the inclusion-exclusion formula to count the primes.Example 27.1: Instead of counting the primes, we count integers that are at most 100 and arenontrivial multiples of other integers k > 2. Let M′kbe the set of multiples of k that are less than100. That is M′2= {2, 4, 6, . . . , 98, 100}, M′3= {3, 6, 9, . . . , 96, 99}, and so on.We c l ai m that every non-prime less than 100 is divisible by a prime less than√100. We canprove this by c ontradiction. Every non-prime number n has two (possibly equal) prime factors. Ifboth of them are more than√100 = 10, we would have n > 10 · 10 = 100, so n would not be aninteger that’s at most 100.The previous paragraph implies that each non-prime that’s at most 100 has one of the primes2, 3, 5, 7 as a divisor. Hence, if we count t he nontrivial multiples of these four primes that areat most 100 and subtract them from the total numbe r of integers between 2 and 100, we get thenumber of primes between 2 and 100.1Lecture 27: Combinatorial Arguments 27.2. Pigeonhole PrincipleThe nontrivial multiples of our four primes live in the sets M′2, M′3, M′5and M′7. Then theylive in their union. The union of those sets also contains our four pr i me s, so after we find |M′2∪M′3∪M′5∪M′7|, we need to subtract 4 from that number to get the number of non-pr i me s between2 and 100. We use the inclusion-exclusion formula to count the number of elements in the union.|M′2∪ M′3∪ M′5∪ M′7| = |M′2| + |M′3| + |M′5| + |M′7|−− |M′2∩ M′3| − |M′2∩ M′5| − |M′2∩ M′7| − |M′3∩ M′5| − |M′3∩ M′7| − |M′5∩ M′7|++ |M′2∩ M′3∩ M′5| + |M′2∩ M′3∩ M′7| + |M′2∩ M′5∩ M′7| + |M′3∩ M′5∩ M′7|−− |M′2∩ M′3∩ M′5∩ M′7|.We have shown some facts about sets related to our sets M′kon t he pre v i ous homework. Inparticular, Mkwas the set of all multiples of k, and if p and q are two different primes, weshowed that Mp∩ Mq= MpqThis fact transfers to our “primed” versions of the sets, i.e., wehave M′p∩ M′q= M′pqfor any primes p and q. In fact, this generalizes even more. For any set ofdistinct primes p1, p2, . . . , pr, we have M′p1∩ M′P2∩ ··· ∩ M′pr= Mp1p2···pr. Hence, we can rewriteour ex pr e ssi on for |M′2∪ M′3∪ M′5∪ M′7| as follows.|M′2∪ M′3∪ M′5∪ M′7| = |M′2| + |M′3| + |M′5| + |M′7|−− |M′6| − |M′10| − |M′14| − |M′15| − |M′21| − |M′35|++ |M′30| + |M′42| + |M′70| + |M′105|−− |M′210|.The last two sets in t he expression above are actual l y empty. There are no multiples of 105 or 210that are at most 100. In general, t he l ar ge st multiple of k that b e l ongs to M′kis ⌊100/k⌋, and wecan use this to fin d the number of integers that are at most 100 and are multiples of at least oneof our primes.|M′2∪ M′3∪ M′5∪ M′7| = 50 + 33 + 20 + 14−− 16 − 10 − 7 − 6 − 4 − 2++ 3 + 2 + 1 + 0−− 0= 78.We need to subtract 4 from thi s number because M′contains four primes. It follows that there are74 integers between 2 and 100 that are not primes, so there are 99 −74 = 25 primes between 2 an d100. ⊠The example we just worked out seemed to be a lot of work. Indeed, for prim es up to 100,carrying out the sieve of Eratosthenes could be a faster way. However, for finding the number ofprimes up to n for a large n, it would be fas te r to use our inclusion-exclusion strategy becausejust writing down all integers from 2 to n would take a long time. What makes inclusion-exclusionappealing for this is that we can characterize all the intersections that arise during the computation.This saves a considerable amount of work.27.2 Pigeonhole PrincipleThe pigeonhole principle is not a counting technique, but it is a powerful tool, so it deservesmentioning now. It often gets used after we find the cardinality of some set.2Lecture 27: Combinatorial Arguments 27.3. Combinatorial ArgumentsTheorem 27.1 (Pigeonhol e principle). Let S and T be sets such that |T | > |S|. Then for everytotal function f : T → S, there are at least two elements in T that map to the same element of sunder f.Before we see an application, let’s discuss why this is called the pigeonhole principle. In thetheorem above, think of the elements of T as pigeons, and of elements of S as pigeonholes. Since|T | > |S|, there ar e more pigeons than pigeonholes, so after all pigeons enter some pige onhol e , therehas to be at least one hole that contains at least two pigeons.Example 27.2: The


View Full Document

UW-Madison CS 240 - Lecture 27

Download Lecture 27
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Lecture 27 and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Lecture 27 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?