Section 1.6 The Number of Integer Solutions of Equations 13 ositive int lined up and that we want to divide them into r nonempty groups.To do so.we can as to obtain oooloooloo nobjects 0 Chooser-l of the spaces FIGURE 1.:Number of positive solutions then the resulting vector is.2.As there are possible selections,we have the following proposition. .There aredistinct positive integer-valued vector x2.)satisfying the equation x1+x2+.+x,=n>0,i=1,r thatumber of onncai (s oppocd to posite) 8mnea0irioticnsof1 =nis the sam )Hence.from Proposition 61.we obtain the following proposition. Proposition There are distinct nomnegative integer-valued vee tors (x.)satisfying the equation x1+x2+···+Xr=n (6.1 EXAMPLE 6a How many distinct nonnegative integer-valued solutions of+3are possible? Soluion.There are(3支2:1)=4 suotion(o,30,2.2.1.以a.0u.■ EXAMPLE 6b An investor has 20 thousand dollars to invest among 4 possible investments.Each investment must be in units of a thousand dollars.If the total 20 thousand is to be
Section 1.6 The Number of Integer Solutions of Equations 13 To compute this number, let us start by considering the number of positive integervalued solutions. Toward that end, imagine that we have n indistinguishable objects lined up and that we want to divide them into r nonempty groups. To do so, we can select r − 1 of the n − 1 spaces between adjacent objects as our dividing points. (See Figure 1.2.) For instance, if we have n = 8 and r = 3 and we choose the 2 divisors so as to obtain ooo|ooo|oo 0 ^ 0 ^ 0 ^ . . . ^ 0 ^ 0 n objects 0 Choose r 1 of the spaces ^. FIGURE 1.2: Number of positive solutions then the resulting vector is x1 = 3, x2 = 3, x3 = 2. As there are n − 1 r − 1 possible selections, we have the following proposition. Proposition 6.1. There are n − 1 r − 1 distinct positive integer-valued vectors (x1, x2, . , xr) satisfying the equation x1 + x2 + ··· + xr = n xi > 0, i = 1, . ,r To obtain the number of nonnegative (as opposed to positive) solutions, note that the number of nonnegative solutions of x1 + x2 + ··· + xr = n is the same as the number of positive solutions of y1 + ··· + yr = n + r (seen by letting yi = xi + 1, i = 1, . ,r). Hence, from Proposition 6.1, we obtain the following proposition. Proposition 6.2. There are n + r − 1 r − 1 distinct nonnegative integer-valued vectors (x1, x2, . , xr) satisfying the equation x1 + x2 + ··· + xr = n (6.1) EXAMPLE 6a How many distinct nonnegative integer-valued solutions of x1 + x2 = 3 are possible? Solution. There are 3 + 2 − 1 2 − 1 = 4 such solutions: (0, 3), (1, 2), (2, 1), (3, 0). . EXAMPLE 6b An investor has 20 thousand dollars to invest among 4 possible investments. Each investment must be in units of a thousand dollars. If the total 20 thousand is to be
14 Chapter 1 Combinatorial Analysis Solution If we let ri-1 2 3 4 denote the numher of thousands in investment i,then,when all is to be invested,are integers satisfying the equation 1+3+3+x4=20x≥0 Hence,by Proposition 6.2.there are=1771 possible investment strategies.If not all of the me need be invested.the if we let re denote the amount kept in reserve.a strategy is a nonnegative integer-valued vector ()satisfying the equation +2++4+5-20 Hence,by Proposition 6.2.there are now=10.626 possible strategies. EXAMPLE 6c How many terms are there in the multinomial expansion of (++x)? Solution. 国++.+r=∑(”n) where the sum is over all nonnegative integer-valued(m .,n)such that m+.+ Hence.by Proposition 62.there are such tem. r-1 EXAMPLE 6d and)functional is to determine the number of linear orderines in which no two defectives are next to each other.To determine this number,let us imagine that the d cve it a up among them he n l ones ar oftrtdelecivethe mber of fctionlteweetwo defectives,and so on.That is,schematically.we have 10x20.xm0xm+ number of vectors.+that satisfy the equation +.+xm+1=n-m≥0,xm+1≥0>0,i=2,m
14 Chapter 1 Combinatorial Analysis invested, how many different investment strategies are possible? What if not all the money need be invested? Solution. If we let xi, i = 1, 2, 3, 4, denote the number of thousands invested in investment i, then, when all is to be invested, x1, x2, x3, x4 are integers satisfying the equation x1 + x2 + x3 + x4 = 20 xi Ú 0 Hence, by Proposition 6.2, there are 23 3 = 1771 possible investment strategies. If not all of the money need be invested, then if we let x5 denote the amount kept in reserve, a strategy is a nonnegative integer-valued vector (x1, x2, x3, x4, x5) satisfying the equation x1 + x2 + x3 + x4 + x5 = 20 Hence, by Proposition 6.2, there are now 24 4 = 10,626 possible strategies. . EXAMPLE 6c How many terms are there in the multinomial expansion of (x1 + x2 + ··· + xr)n? Solution. (x1 + x2 + ··· + xr) n = n n1, . , nr x n1 1 ··· xnr r where the sum is over all nonnegative integer-valued (n1, . , nr) such that n1 + ··· + nr = n. Hence, by Proposition 6.2, there are n + r − 1 r − 1 such terms. . EXAMPLE 6d Let us consider again Example 4c, in which we have a set of n items, of which m are (indistinguishable and) defective and the remaining n − m are (also indistinguishable and) functional. Our objective is to determine the number of linear orderings in which no two defectives are next to each other. To determine this number, let us imagine that the defective items are lined up among themselves and the functional ones are now to be put in position. Let us denote x1 as the number of functional items to the left of the first defective, x2 as the number of functional items between the first two defectives, and so on. That is, schematically, we have x1 0 x2 0 ··· xm 0 xm+1 Now, there will be at least one functional item between any pair of defectives as long as xi > 0, i = 2, . , m. Hence, the number of outcomes satisfying the condition is the number of vectors x1, . , xm+1 that satisfy the equation x1 + ··· + xm+1 = n − m x1 Ú 0, xm+1 Ú 0, xi > 0, i = 2, . , m
Summary 15 But. on le equation 1+2十.+m+1=n-m+2 Hence,by Proposition6.1,there aresuch outcomes,in agreement with the results of Example 4c. nthat we are in the number of which each pai equation +.+xm+1=n-m为≥0.xm+1≥0.≥2.i=2,m hte etheoet Upon letting y1 =x 1.yi=xi-1,i =2.m.) 1+.+ym+1=n-2m+3 Hence,from Proposition 6.1.,there are such outcomes. SUMMARY exptereare1).2.1 possible linear orderings of n items.The qu2eyosdciaedlocquli ())=m-m callcdcuotromnencmrmwhich statesthat +=()y- For nonnegative integers m.,nsumming to n, is the number of divisions of n items intordistinct nonoverlapping subgroups of sizes 1,2,n
Summary 15 But, on letting y1 = x1 + 1, yi = xi, i = 2, . , m, ym+1 = xm+1 + 1, we see that this number is equal to the number of positive vectors (y1, . , ym+1) that satisfy the equation y1 + y2 + ··· + ym+1 = n − m + 2 Hence, by Proposition 6.1, there are n − m + 1 m such outcomes, in agreement with the results of Example 4c. Suppose now that we are interested in the number of outcomes in which each pair of defective items is separated by at least 2 functional items. By the same reasoning as that applied previously, this would equal the number of vectors satisfying the equation x1 + ··· + xm+1 = n − m x1 Ú 0, xm+1 Ú 0, xi Ú 2, i = 2, . , m Upon letting y1 = x1 + 1, yi = xi − 1, i = 2, . , m, ym+1 = xm+1 + 1, we see that this is the same as the number of positive solutions of the equation y1 + ··· + ym+1 = n − 2m + 3 Hence, from Proposition 6.1, there are n − 2m + 2 m such outcomes. . SUMMARY The basic principle of counting states that if an experiment consisting of two phases is such that there are n possible outcomes of phase 1 and, for each of these n outcomes, there are m possible outcomes of phase 2, then there are nm possible outcomes of the experiment. There are n! = n(n − 1)··· 3 · 2 · 1 possible linear orderings of n items. The quantity 0! is defined to equal 1. Let n i = n! (n − i)! i! when 0 . i . n, and let it equal 0 otherwise. This quantity represents the number of different subgroups of size i that can be chosen from a set of size n. It is often called a binomial coefficient because of its prominence in the binomial theorem, which states that (x + y) n = n i=0 n i xi yn−i For nonnegative integers n1, . , nr summing to n, n n1, n2, . , nr = n! n1!n2! ··· nr! is the number of divisions of n items into r distinct nonoverlapping subgroups of sizes n1, n2, . , nr.
16 Chapter 1 Combinatorial Analysis PROBLEMS 10.In how many ways can 8 people be seated in a ()there are no restrictions on the scating license plate. 2.1 other? n12 scan play (b)the be and 12.Five separate aw rds(best schola ship,best leac first digit was an in the second dig (al 6.A well kno ake place? i met a man with 7 wives Each wife had 7 sacks Each sack had 7 cats. Each cat had 7 kittens dthen paired off,how many 16.A student has to sell 2 books from a collection of (b)iarow? books.How 3 be (a)both books are to be on the same subject? (b)the (e)y if oly the boys ust st boks are to be on d ubject 17 (d)ngther? same ser dewn of the 18 2 Democrats.and Independents,is to be cho (a)Fluke? 9.A child has 12 blocks.of which 6 are black.4 are (b)2of the women refuse to serve together? (e)1 man and 1 woman refuse to serve together?
16 Chapter 1 Combinatorial Analysis PROBLEMS 1. (a) How many different 7-place license plates are possible if the first 2 places are for letters and the other 5 for numbers? (b) Repeat part (a) under the assumption that no letter or number can be repeated in a single license plate. 2. How many outcome sequences are possible when a die is rolled four times, where we say, for instance, that the outcome is 3, 4, 3, 1 if the first roll landed on 3, the second on 4, the third on 3, and the fourth on 1? 3. Twenty workers are to be assigned to 20 different jobs, one to each job. How many different assignments are possible? 4. John, Jim, Jay, and Jack have formed a band consisting of 4 instruments. If each of the boys can play all 4 instruments, how many different arrangements are possible? What if John and Jim can play all 4 instruments, but Jay and Jack can each play only piano and drums? 5. For years, telephone area codes in the United States and Canada consisted of a sequence of three digits. The first digit was an integer between 2 and 9, the second digit was either 0 or 1, and the third digit was any integer from 1 to 9. How many area codes were possible? How many area codes starting with a 4 were possible? 6. A well-known nursery rhyme starts as follows: “As I was going to St. Ives I met a man with 7 wives. Each wife had 7 sacks. Each sack had 7 cats. Each cat had 7 kittens.” How many kittens did the traveler meet? 7. (a) In how many ways can 3 boys and 3 girls sit in a row? (b) In how many ways can 3 boys and 3 girls sit in a row if the boys and the girls are each to sit together? (c) In how many ways if only the boys must sit together? (d) In how many ways if no two people of the same sex are allowed to sit together? 8. How many different letter arrangements can be made from the letters (a) Fluke? (b) Propose? (c) Mississippi? (d) Arrange? 9. A child has 12 blocks, of which 6 are black, 4 are red, 1 is white, and 1 is blue. If the child puts the blocks in a line, how many arrangements are possible? 10. In how many ways can 8 people be seated in a row if (a) there are no restrictions on the seating arrangement? (b) persons A and B must sit next to each other? (c) there are 4 men and 4 women and no 2 men or 2 women can sit next to each other? (d) there are 5 men and they must sit next to each other? (e) there are 4 married couples and each couple must sit together? 11. In how many ways can 3 novels, 2 mathematics books, and 1 chemistry book be arranged on a bookshelf if (a) the books can be arranged in any order? (b) the mathematics books must be together and the novels must be together? (c) the novels must be together, but the other books can be arranged in any order? 12. Five separate awards (best scholarship, best leadership qualities, and so on) are to be presented to selected students from a class of 30. How many different outcomes are possible if (a) a student can receive any number of awards? (b) each student can receive at most 1 award? 13. Consider a group of 20 people. If everyone shakes hands with everyone else, how many handshakes take place? 14. How many 5-card poker hands are there? 15. A dance class consists of 22 students, of which 10 are women and 12 are men. If 5 men and 5 women are to be chosen and then paired off, how many results are possible? 16. A student has to sell 2 books from a collection of 6 math, 7 science, and 4 economics books. How many choices are possible if (a) both books are to be on the same subject? (b) the books are to be on different subjects? 17. Seven different gifts are to be distributed among 10 children. How many distinct results are possible if no child is to receive more than one gift? 18. A committee of 7, consisting of 2 Republicans, 2 Democrats, and 3 Independents, is to be chosen from a group of 5 Republicans, 6 Democrats, and 4 Independents. How many committees are possible? 19. From a group of 8 women and 6 men, a committee consisting of 3 men and 3 women is to be formed. How many different committees are possible if (a) 2 of the men refuse to serve together? (b) 2 of the women refuse to serve together? (c) 1 man and 1 woman refuse to serve together?
Problems 17 20.A person has 8 friends,of whom 5 will be invited toa party 名6e,same room.how many ved by 4 ch o 21.Consider h rid of points shown here.Suppos d(r1+2x+3r)4 one step to the right at each m 28. are pos 29. the gh op three and 2 in the bottom three? other and th 22.In Problem 21, divided m A to B tha the following lattice? 32 board at the basement with 8 the ator operator)and dis TheT6nowenew5aghe or have the people the va people cons opp rtwnites. Each i men and there are minimal investments that need to b yiffer inme sraee (a)an investment must be made in each opportu- (b)ments must be made in at least 3of the to these beds so that each set of twins sleeps 4 opportunities?
Problems 17 20. A person has 8 friends, of whom 5 will be invited to a party. (a) How many choices are there if 2 of the friends are feuding and will not attend together? (b) How many choices if 2 of the friends will only attend together? 21. Consider the grid of points shown here. Suppose that, starting at the point labeled A, you can go one step up or one step to the right at each move. This procedure is continued until the point labeled B is reached. How many different paths from A to B are possible? Hint: Note that to reach B from A, you must take 4 steps to the right and 3 steps upward. B A 22. In Problem 21, how many different paths are there from A to B that go through the point circled in the following lattice? B A 23. A psychology laboratory conducting dream research contains 3 rooms, with 2 beds in each room. If 3 sets of identical twins are to be assigned to these 6 beds so that each set of twins sleeps in different beds in the same room, how many assignments are possible? 24. Expand (3x2 + y)5. 25. The game of bridge is played by 4 players, each of whom is dealt 13 cards. How many bridge deals are possible? 26. Expand (x1 + 2x2 + 3x3)4. 27. If 12 people are to be divided into 3 committees of respective sizes 3, 4, and 5, how many divisions are possible? 28. If 8 new teachers are to be divided among 4 schools, how many divisions are possible? What if each school must receive 2 teachers? 29. Ten weight lifters are competing in a team weightlifting contest. Of the lifters, 3 are from the United States, 4 are from Russia, 2 are from China, and 1 is from Canada. If the scoring takes account of the countries that the lifters represent, but not their individual identities, how many different outcomes are possible from the point of view of scores? How many different outcomes correspond to results in which the United States has 1 competitor in the top three and 2 in the bottom three? 30. Delegates from 10 countries, including Russia, France, England, and the United States, are to be seated in a row. How many different seating arrangements are possible if the French and English delegates are to be seated next to each other and the Russian and U.S. delegates are not to be next to each other? ∗31. If 8 identical blackboards are to be divided among 4 schools, how many divisions are possible? How many if each school must receive at least 1 blackboard? ∗32. An elevator starts at the basement with 8 people (not including the elevator operator) and discharges them all by the time it reaches the top floor, number 6. In how many ways could the operator have perceived the people leaving the elevator if all people look alike to him? What if the 8 people consisted of 5 men and 3 women and the operator could tell a man from a woman? ∗33. We have 20 thousand dollars that must be invested among 4 possible opportunities. Each investment must be integral in units of 1 thousand dollars, and there are minimal investments that need to be made if one is to invest in these opportunities. The minimal investments are 2, 2, 3, and 4 thousand dollars. How many different investment strategies are available if (a) an investment must be made in each opportunity? (b) investments must be made in at least 3 of the 4 opportunities?