1 Sectio 5.1 The Basics of Coutig Combiatorics, the study of arragemets of objects, is a importat part of discrete mathematics. I this chapter, we will lear basic techiques of coutig which has a lot of applicatios, e.g. how may differet North America telephoe umbers are possible? How may ways are there to select five players from a 10-member teis team to make a trip to a match at aother school? The Product Rule Suppose that a procedure ca be broke dow ito a sequece of two tasks. If there are 1 ways to do the first task ad for each of these ways of doig the first task, there are 2 ways to do the secod task, the there are 1 2 ways to do the procedure. Example 1 The chairs of a auditorium are to be labeled with a letter followed by a positive umber ot exceedig 100. What is the largest umber of chairs that ca be labeled differetly? The product rule exteds to the case a procedure ca be broke dow ito a sequece of more tha just two tasks. Suppose that the procedure is carried out by performig the tasks T 1, T 2,, T k i sequece. If each task T i ca be doe i i ways, regardless of how the previous tasks were doe, the there are 1 2 k ways to carry out the procedure. Example 2 How may differet licese plates are available if each plate cotais a sequece of three letters followed by three digits? Example 3 Let A = {1, 2,, m} ad B = {1, 2,, }. 1. How may fuctios are there from A to B? 2. How may oe-to-oe fuctios are there from A to B? Example 4 The telephoe umbers i North America must cosist of 10 digits, which are split ito a three-digit area code, three-digit office code, ad four-digit statio code. Accordig to the regulatios of the North America Numberig Pla, each umber should be of the form NXX NXX XXXX, where N deotes a digit that ca take ay of the values 2 through 9, ad X deotes a digit that ca take ay of the values 0 through 9. How may differet North America telephoe umbers are possible?
2 We ow itroduce the sum rule. The Sum Rule If a task ca be doe either i oe of 1 ways or i oe of 2 ways, where oe of the set of 1 ways is the same as ay of the set of 2 ways, the there are 1 + 2 ways to do the task. Example 5 A studet ca choose a computer project from oe of three lists. The three lists cotai 23, 15, ad 19 possible projects, respectively. No project is o more tha oe list. How may possible projects are there to choose from? May coutig problems caot be solved usig just the product rule or just the sum rule. However, may complicated coutig problems ca be solved usig both of these rules i combiatio. Example 6 Each user o a computer system has a password, which is six to eight characters log, where each character is a uppercase letter or a digit. Each password must cotai at least oe digit. How may possible passwords are there?
3 Sectio 5.2 The Pigeohole Priciple Suppose that a flock of 20 pigeos flies ito a set of 19 pigeoholes, the we ca say for sure that at least oe of these 19 pigeoholes must have at least two pigeos i it. This illustrates a geeral priciple called Pigeohole Priciple. Pigeohole Priciple Let k be a positive iteger. If k + 1 or more objects are placed ito k boxes, the there is at least oe box cotaiig two or more of objects. Example 1 A fuctio f from a set with k + 1 or more elemets to a set with k elemets is ot oe-to-oe. Example 2 I ay group of 27 Eglish words, there must be at least two that begi with the same letter. Example 3 Assume that there were more tha 100, 000, 000 wage earers i the Uited States who eared less tha 1, 000, 000 dollars. Show that there are two who eared exactly the same amout of moey, to the pey, last year. Example 4 Let d be a positive iteger. Show that amog ay group of d + 1 (ot ecessarily cosecutive) itegers there are two with exactly the same remaider whe they are divided by d. Example 5 Show that for every iteger there is a multiple of that has oly 0s ad 1s i its decimal expasio.
4 Now we wat to geeralize Pigeohole Priciple. Suppose 21 objects are distributed ito 10 boxes, the at least oe box must have at least 3 objects. This is a special case of the followig theorem: The Geeralized Pigeohole Priciple If N objects are placed ito k boxes, the there is at least oe box cotaiig at least N k objects. Proof We use the proof by cotradictio. Suppose ot, that is, each box cotais at most objects i it. The the total umber of objects is at most. Note that N < N + 1, hece k k we have ( ) (( ) ) N N k 1 < k k k + 1 1 = N, which gives a cotradictio. Example 6 Amog 100 people there are at least 100 = 9 who were bor i the same moth. 12 Example 7 There are 38 differet time periods durig which classes at a college ca be scheduled. If there are 677 differet classes, how may differet rooms will be eeded?
5 Sectio 5.3 Permutatios ad Combiatios May coutig problems ca be solved by fidig the umber of ways to arrage a specified umber of distict elemets of a set of a particular size, where the order of these elemets matters. We begi by cosiderig a example. Example 1 I how may ways ca we select three studets from a group of five studets to stad i lie for a picture? I how may ways ca we arrage all five of these studets i a lie for a picture? Defiitio A permutatio of a set of distict objects is a ordered arragemet of these objects. A ordered arragemet of r elemets of a set is called a r-permutatio. Example 2 Let S = {1, 2, 3, 4, 5}. The ordered arragemet (4, 2, 1, 5, 3) is a permutatio of S. (3, 1, 4) is a 3-permutatio of S. Defiitio The umber of r-permutatios of a set with elemets is deoted by P (, r) or P r. We wat to compute P (, r). Example 3 Compute P (5, 2) ad P (5, 3). What is P (5, 5)? I geeral, we get I particular, P (, r) = ( 1) ( 2) ( r + 1) = }{{} r factors P (, ) = ( 1) ( 2) 2 1 =!.! ( r)!. Example 4 How may ways are there to select a first-prize wier, a secod-prize wier, ad a third-prize wier from 100 differet people who have etered a cotest? Example 5 How may permutatios of the letters ABCDEF G cotai the strig ABC?
6 We ow tur our attetio to coutig uordered selectio of objects. Example 6 How may differet committees of two studets ca be formed from a group of four studets? Example 7 I how may ways ca we choose a chair ad a vice chair from a group of four studets? How is this example differet from the previous oe? Defiitio A r-combiatio of elemets of a set is a uordered selectio of r elemets from the set. Example 8 Let S = {1, 2, 3, 4, 5}. The {1, 3, 4} is a 3-combiatio of S. Defiitio The umber of r-combiatios of a set with elemets is deoted by C(, r), C r, or ( r). Example 9 From Example 6, we see that ( 4 2) =. Example 10 Compute ( 5 2). Compute ( 5 3). I geeral, we have the followig theorem. Theorem The umber of r-combiatios of a set with elemets, where is a oegative iteger ad r is a iteger with 0 r, equals ( )! = r r!( r)!. Sketch of Proof We explai with ( 5 3). Let S = {1, 2, 3, 4, 5} ad cosider all 3-permutatios of S cosistig of {1, 2, 4}. They are: (1, 2, 4), (1, 4, 2), (2, 1, 4), (2, 4, 1), (4, 1, 2), ad (4, 2, 1).
7 O the other had, there is oly oe 3-combiatio of S cosistig of {1, 2, 4}; just {1, 2, 4}. Hece there are 6 times as may permutatios as combiatios cosistig of {1, 2, 4}. Here 6 comes from the total umber of differet permutatios of {1, 2, 4}, that is, 6 = 3!. Sice this is true for all 3-combiatios of S, we coclude that ( ) 5 P (5, 3) = 3!. 3 I other words, ( ) 5 = 1 3 3! P (5, 3) = 1 3! 5! (5 2)! = 5! 3!(5 2)!. Example 11 Compute ( 0), ( 1), ad ( ). Example 12 Prove that ( ) ( r = r). Example 13 How may ways are there to select five players from a 10-member teis team to make a trip to a match at aother school? Example 14 Suppose that there are 9 faculty members i the mathematics departmet ad 11 i the computer sciece departmet i a college. How may ways are there to select a committee to develop a discrete mathematics course at the school if the committee is to cosist of three faculty members from the mathematics departmet ad four from the computer sciece departmet?
8 Sectio 5.4 Biomial Coefficiets I this sectio we will see examples i which the umbers ( r) play a cetral role. Whe (x + y) 5 = (x + y)(x + y)(x + y)(x + y)(x + y) is expaded, all products of a term i the first sum, a term i the secod sum,..., a term i the fifth sum are added ad terms of the form x 5, x 4 y, x 3 y 2, x 2 y 3, xy 4, ad y 5 arise. To obtai a term of the form x 5, x must be chose from each of five sums ad this ca be doe i oly oe way ad this meas that the coefficiet of x 5 whe (x + y) 5 is multiplied out is 1. To obtai a term of the form x 3 y 2, x must be chose from three of the five sums (ad cosequetly y must be chose from the remaiig two sums). Sice this ca be doe i ( ) 5 3 ways, the coefficiet of x 3 y 2 whe (x + y) 5 is expaded will be ( 5 3). I geeral, we have the followig theorem. The Biomial Theorem Let x ad y be variables, ad let be a oegative iteger. The (x + y) = = ( k k=0 ( 0 ) x + Example 1 Expad (x + y) 5. ) x k y k ( ) x 1 y + 1 ( ) ( ) x 2 y 2 + + xy 1 + 2 1 ( ) y. Example 2 Fid the coefficiet of x 12 y 13 i the expasio of 1. (x + y) 25 2. (2x 3y) 25 Example 3 Determie whether we have a term of the form x 14 i the expasio of ( x 2 + 1 x) 10. If we do, what is the coefficiet?
9 Example 4 Let be a oegative iteger. Compute ( ) ( ) ( ) ( ) 1. + + + + 0 1 2 2. ( ) ( ) + 2 0 1 ( ) ( ) + 2 2 + + 2 2 ( ) ( ) ( ) 3. + ( 1) + ( 2) 0 1 2 ( ) ( ) + + 2 + 2 1 Defiitio A combiatorial proof (or combiatorial argumet) of a idetity is a proof that uses coutig to prove that both sides of the idetity cout the same object but i differet ways. Example 5 Prove the idetities i Example 4 above usig a combiatorial argumet.
10 Pascal s Idetity Let ad k be positive itegers with k. The ( ) ( ) ( ) + 1 = +. k k 1 k Proof Vadermode s Idetity Let m,, ad r be oegative itegers with r ot exceedig either m or. The ( ) m + r ( )( ) m =. r r k k Proof k=0 Example 6 Show that ( 2 ) = k=0 ( k) 2.
11 The rest of the sectio is devoted to examples where the biomial coefficiets arise. We begi with a defiitio. Defiitio A bit strig (or biary strig) is a strig that cosists of 0 or 1. A k-ary strig is a strig that cosists of 0, 1, 2,, k 1. Example 7 For example, 101010011 is a bit strig of legth ie. Example 8 How may bit strigs of legth are there? How may k-ary strigs of legth are there? How may bit strigs of legth have exactly r 1 s? Example 9 Let ad r be oegative itegers with r. Show combiatorially that ( ) + 1 = r + 1 j=r ( ) j r by coutig the umber of bit strigs of legth + 1 cotaiig r + 1 1 s. Example 10 How may differet strigs ca be made by reorderig the letters of 1. {A, A, B, B, B}? 2. {S, U, C, C, E, S, S}? 3. {D, O, R, M, I, T, O, R, Y }?
12 Example 11 How may shortest paths from A to B are there i the followig? B A Example 12 How may shortest paths from A to B pass through M i the followig? B M A Example 13 How may shortest paths from A to B are there i the followig? (slides) B A
13 Example 14 How may shortest paths from A to B do ot pass above the diagoal i the followig? (slides) B A Example 15 There are 2 people i lie to get ito a theater. Admissio is $5. Of the 2 people, have a $5 bill ad have a $10 bill. The box office rather foolishly begis with a empty cash register. I how may ways ca the people lie up so wheever a perso with a $10 bill buys a ticket, the box office has a $5 bill i order to give chage? Example 16 How may o-decreasig fuctios f : {1, 2, 3, 4, 5} {1, 2, 3, 4, 5} such that f(i) i for all i, 1 i 5, are there?
14 Example 17 How may oegative iteger solutios are there to the equatio x + y + z = 8? Example 18 How may positive iteger solutios are there to the equatio x + y + z = 8? Example 19 How may strictly icreasig fuctios are there from A = {1, 2, 3, 4} to B = {1, 2, 3, 4, 5, 6, 7}? Example 20 How may o-decreasig fuctios are there from A = {1, 2, 3, 4} to B = {1, 2, 3, 4, 5, 6, 7}?