MAT 344 (1999S) Test #2: Solutions

[30] 1. How many ways are there to buy 25 pens if there are 10 different colours, at most 6 pens of each colour are available, and at least one pen of each colour must appear?

Answer: This is equivalent to the number of integer solutions to e1 + e2 + ...e10 = r where 1 <= ei <= 6. The generating function which models this is

g(x) = ( x + x2 + x3 + x4 + x5 + x6 ) 10
and we are interested in its x25 coefficient
[ x25 ] g(x)
     = [ x25 ] ( x + x2 + x3 + x4 + x5 + x6 ) 10
     = [ x25 ] x10 ( 1 + x + x2 + x3 + x4 + x5 ) 10
     = [ x15 ] ( 1 + x + x2 + x3 + x4 + x5 ) 10
     = [ x15 ] ( 1 - x6 ) 10 / ( 1 - x ) 10
     = [ x15 ] ( C(10,0) x0 - C(10,1) x6 + C(10,2) x12 - ... ) ( C(9,0) x0 + C(10,1) x + C(11,2) x2 + ... )
     = C(10,0) C(24,15) - C(10,1) C(18,9) + C(10,2) C(12,3) 
     = 811,404 

[30] 2. How many ways are there to distribute 10 different sweaters among 3 people, A, B and C, so that each person gets at least sweater? In how many of these distributions will person A get 4 sweaters?

Answer: There are 310 ways in which zero or more people get none, 3*210 ways in which one or more get none, and 3*110 in which two get none. There are therefore 310 - 3*210 + 3*110 = 55,980 ways in which each person gets at least one sweater.

If you would rather do this with exponential generating functions, then you need to calculate

[ x10/10! ] ( ex - 1 ) 3 = [ x10/10! ] ( e3x - 3e2x + 3ex - 1 )
which works out to the same value.

For the second part, there are C(10,4) ways to choose which sweaters A gets, and ( 26 - 2 ) ways in which to decide how to split the rest between B and C. The total number of distributions is therefore C(10,4) * ( 26 - 2 ) = 18,600.

(Still under construction)