Discrete Mathematics, Spring 2004 Homework 4 Sample Solutions 4.2 #77. Let s n,k denote the number of ways to seat n persons at k round tables, with at least one person at each table. (The numbers s n,k are called Stirling numbers of the first kind.) The ordering of the tables is not taken into account. The seating arrangement at a table is taken into account, except for rotations. (a) Show that s n,k = 0 if k > n. (b) Show that s n,n = 1 for all n 1. (c) Show that s n,1 = (n 1)! for all n 1. (d) Show that s n,n 1 = C(n,2) for all n 2. (e) Show that for all n 2. (f) Show that ( s n,2 = (n 1)! 1 + 1 2 + 1 3 + + 1 ) n 1 n s n,k = for all n 1. (g) Find a formula for s n,n 2, n 3, and prove it. Solution. (a) If k < n, there are no ways to place n people at k tables without at least one of the tables being empty. (b) There is exactly one way to place n people at n tables; each table has a single person seated at it. (c) Denote the individuals by x 1,...,x n ; we wish to seat them at a single table. Since rotations are not taken into account, given any ordering of the x i in a line with x 1 in the first position, we can associate to it a unique seating around the table; simply proceed counterclockwise around the table, starting with x 1. Clearly we can reverse this process, so that given a seating we can obtain an ordering of the x i in a line with x 1 in the first position. 1
But given that x 1 must be in the first position of the line, there are exactly (n 1)! ways to order the remaining elements, and hence s n,1 = (n 1)!. (d) With notation as in (c), the choice of any unordered pair {x i,x j } determines a unique seating of the n people at n 1 tables; this pair sits at a single table (there is only one way to seat them there), and each of the remaining tables has a single person seated there. So the number of possible seatings is C(n,2). (e) We determine a seating of x 1,...,x n at two tables in the following process: (1) Select a k-person subset of {x 2,...,x n } to sit at the same table with x 1. The remaining individuals will, of course, sit at the other table. (Notice that k cannot equal n 1, or else no one will be sitting at the other table.) (2) Order the people sitting at the same table as x 1. (3) Order the people at the other table. For a fixed value of k, there are C(n 1,k) ways to perform step 1. By the same argument as in (c), there are k! ways to perform step 2, and there are (n k 2)! ways to perform step 3 (note that one performs this step after already having chosen the set of people to sit at this table, so fix one of them and then use the same argument as in (c)). Summing over the possible values of k, it follows that the total number of ways to seat x 1,...,x n at two tables is given by n 2 k=0 C(n 1,k) k!(n k 2)! = n 2 k=0 = n 2 k=0 = (n 1)! (n 1)! k!(n k 2)! k!(n 1 k)! (n 1)! n k 1 ( 1 n 1 + 1 n 2 + + 1 2 + 1 (f) We prove this statement by induction on n. Clearly s 1,1 = 1 = 1!, so the base case holds. Now suppose that n s n,k =, and consider the problem of seating n + 1 individuals x 1,...,x n+1 at k tables. If k = n + 1 there is clearly only one way to do this, and if k = 1 then there are ways to do this, by part (c). So suppose 2 k n, and let x 1,...,x n,x n+1 be seated at k tables. Then either (i) x n+1 is seated alone at a single table and the remaining individuals are seated at k 1 tables, or (ii) we have at least one of x 1,...,x n seated at each of the k tables. Case (i) can occur in any of s n,k 1 ways (by the definition of s n,k ). For case (ii), we can seat the individuals x 1,...,x n in any one of s n,k ways (again by the definition). Given such ). 2
a seating, there are n different ways to seat x n+1. [Why? Given a fixed seating of m people around a table, there are m distinct places to insert x n+1, namely between two adjacent people. Summing over the tables gives us n ways in all to seat x n+1.] So case (ii) can therefore occur in any one of ns n,k ways, and we conclude that s n+1,k = ns n,k + s n,k 1. Then we have n+1 s n+1,k = s n+1,1 + s n+1,n+1 + n s n+1,k = + 1 + n (ns n,k + s n,k 1 ) = + 1 + n n s n,k + n = + 1 + n n s n,k + n 1 s n,k 1 s n,k by reindexing = + n n s n,k + n s n,k since s n,n = 1 = + n( s n,1 ) + by inductive assumption = + n( (n 1)!) + by (c) = 2() + n(n 1)!(n 1) = 2() + (n 1) = ()(2 + n 1) = (n + 1) = (n + 1)!. So by induction the claim is proved. (g) We claim that s n,n 2 = 2C(n,3) + 3C(n,4) for n 4 and s 3,1 = 2 (the n = 3 case). The second case was proven in (c). To see that the formula holds for n 4, observe that any seating of n people at n 2 tables falls into exactly one of two categories: (i) 3 people are seated at a single table, and the remaining individuals are seated one to a table, or (ii) 2 people are seated at each of two tables, and the remaining individuals are seated one to a table. A seating of type (i) can occur in exactly 2C(n,3) ways (choose 3 people from x 1,...,x n to sit at a single table; then there are 2 possible ways to arrange these three around the table). A seating of type (ii) can occur in exactly 3C(n,4) ways, for there are C(n,4) ways to choose the subset {x i1,x i2,x i3,x i4 } of four who will not be sitting alone, and given this subset there are exactly 3 ways to choose a partner for x i1 to sit at the same table. The claim follows. 4.6 #11. An exam has 12 problems. How many ways can (integer) points be assigned to the problems if the total of the points is 100 and each problem is worth at least five points? Solution. First note that any assignment of 100 points to 12 problems with each problem 3
worth at least five points corresponds uniquely to an assignment of 40 points to 12 problems with no restrictions (given any assignment of point values x 1,...,x 12 of the first type, y i = x i 5 gives an assignment y 1,...,y 12 of point values of the second type, and similarly in the other direction). So we are looking for the number of ways to assign 40 points to 12 problems. Each such assignment corresponds to an unordered selection (with replacement) of 40 elements from the set {1,...,12}, where the number of elements of type j is the point value of the jth problem. The number of such selections is C(40 + 12 1,12 1) = C(51,11). 4.6 #17. Suppose you are given one pile each of identical red, blue, and green balls, and each pile contains at least 10 balls. In how many ways can 10 balls be selected from the three piles if at least one red ball, at least two blue balls, and at least three green balls must be selected? Solution. Arguing just as in Exercise 11, we see that the problem reduces to finding the number of ways to select 10 1 2 3 = 4 balls from a pile of red, blue or green balls, with no restrictions. This equals the number of ways to choose 4 elements, unordered and with replacement, from a set of three (the colors red, green, and blue). Hence this number is given by C(4 + 3 1,3 1) = C(6,2) = 15, so this is our solution. 4.6 #29. Show that that number of solutions in nonnegative integers of the inequality x 1 + x 2 +... + x n M, where M is a nonnegative integer, is C(M + n,n). Solution. Suppose that we define x n+1 to be M (x 1 +... + x n ). Then any solution of the above inequality also satisfies the equality x 1 +... + x n + x n+1 = M in nonnegative integers, and the reverse is true also. It follows that the number of solutions is the same as the number of ways in which one can choose M items, unordered and with replacement, from a set of n+1 distinct items (the x i s), which is C((n+1)+M 1,(n+1) 1) = C(n+M,n). 4.6 #30. How many integers between 1 and 1,000,000 have the sum of the digits equal to 15? Solution. Clearly 1,000,000 does not have the sum of its digits equal to 15, so it suffices to search among the set of integers from 1 to 999,999. All such integers can be uniquely expressed in the form x 1 x 2 x 3 x 4 x 5 x 6, where the x i are integers with 0 x i 9 (not the 4
product of the integers, merely a concatenation of the digits) and x 1 + x 2 +... + x 6 = 15. So we are looking for the number of integer solutions of the equation x 1 + x 2 +... + x 6 = 15, subject to the conditions 0 x 1 9,..., 0 x 6 9. Now the number of nonnegative integer solutions of the above equation is given by C(15 + 6 1,6 1) = C(20,5), as each solution corresponds to an unordered selection of 15 items from a set of 6 elements (x i being the number of elements of type i selected). But we need to remove the bad solutions. What is a bad solution, in this context? It is a solution (x 1,...,x 6 ) in nonnegative integers of the equation above such that at least one of the x i 10, since in this case x i cannot then represent a digit. Clearly such a bad solution will have exactly one of its x i being 10, for the sum must equal 15, and in particular be less than 20. Now the number of nonnegative integer solutions of x 1 +... + x 6 = 15 with x 1 10 is equal to the number of nonnegative integer solutions of y 1 +... + y 6 = 15 10 = 5 (again, see the argument of Exercise 11), and hence this equals C(5 + 6 1, 6 1) = C(10, 5). We conclude that the total number of bad solutions is 6 C(10,5), and therefore that the number of good solutions (i.e. the ones for which 0 x i 9 for all i) is C(20,5) 6 C(10,5). 4.6 #49. What is wrong with the following argument, which supposedly counts the number of partitions of a 10-element set into eight (nonempty) subsets? List the elements of the set with blanks between them: x 1 x 2 x 3 x 4 x 5 x 6 x 7 x 8 x 9 x 10. Every time we fill seven of the nine blanks with seven vertical bars, we obtain a partition of {x 1,...,x 10 } into eight subsets. For example, the partition {x 1 }, {x 2 }, {x 3,x 4 }, {x 5 }, {x 6 }, {x 7,x 8 }, {x 9 }, {x 10 } would be represented as Thus the solution to the problem is C(9,7). x 1 x 2 x 3 x 4 x 5 x 6 x 7 x 8 x 9 x 10. Solution. The argument does not count all possible 8-subset partitions of {x 1,...,x n }; in fact, it fails to count any partition in which at least one of the subsets consists of nonconsecutive elements. For example, the argument fails to count {x 1,x 3 }, {x 2 }, {x 4,x 6 }, {x 5 }, {x 7 }, {x 8 }, {x 9 }, {x 10 } as a valid partition. 5
4.7 #11. Find the number of terms in the expansion of the expression (w + x + y + z) 12. Solution. Each term in the expansion corresponds to a choice of 12 items from a set of four elements, unordered and with replacement (each of the twelve factors (w+x+y +z) contributes a term w or x or y or z). Thus the number of terms is given by C(4+12 1,4 1) = C(15,3). 4.7 #14. (a) Show that C(n,k) < C(n,k + 1) if and only if k < (n 1)/2. (b) Use part (a) to deduce that the maximum of C(n,k) for k = 0,1,...,n is C(n, n/2 ). Solution. (a) From the formula for C(n,k) we have C(n,k + 1) = (k + 1)!(n k 1)! = n k k + 1 k!(n k)! = n k k + 1 C(n,k), and so C(n,k) < C(n,k + 1) C(n,k) < n k k + 1 C(n,k) 1 < n k k + 1 k + 1 < n k, and solving the last inequality for k gives k < (n 1)/2, as desired. (b) By part (a), we see that for n even the maximum value for C(n,k) must occur at k = n/2, and for n odd the maximum value must occur at k = (n 1)/2. Since n/2 = n/2 for n even and equals (n 1)/2 for n odd, the claim follows. 4.7 #24. Prove (a + b + c) n = 0 i+j n i!j!(n i j)! ai b j c n i j. Solution. Since each term in the expanded product (before combining like terms) consists of a product of n elements, each one of which is either an a or a b or a c, we see that the expansion of (a + b + c) n must indeed consist of terms of the form a i b j c n i j. We essentially want to show that the number of times that the expression a i b j c n i j appears in this expansion is 6
equal to i!j!(n i j)!. To see this, we notice simply that the number of ways to rearrange the elements in a sequence of i a s, j b s, and (n i j) c s is given by i!j!(n i j)!. But each rearrangement corresponds uniquely to a term of the expanded product before combining like terms, so we are done. Note: one could also obtain this formula using the Binomial Theorem for (x + y) n, where x = a + b and y = c, and using the Binomial Theorem again on each of the x k in the sum n 0 C(n,k)xk y n k. 7