Candies to other Children

I'm giving out 100 identical candies to 5 kids. The two youngest kids want at most 1 piece. The middle kid will take any number of pieces. The two oldest kids, Calvin and Lin, both demand an odd number of pieces. In how many ways can I distribute the candy?


The answer is 4950.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

1 solution

Alan Yan
Aug 30, 2015

Casework would seem kind of messy. So instead we will try to make a generating function.

The generating function for the youngest two kids are : ( 1 + x ) 2 (1+x)^2

because they only want zero or one candy.

The generating function for the middle kid is: 1 + x + x 2 + . . . 1+x+x^2+...

because he is fine with any number of candy.

The generating function for Calvin and Lin are: x + x 3 + x 5 + . . . ) 2 x+x^3+x^5+...)^2

since they only want an odd number of candy.

Therefore the number of ways to distribute the 100 candies is equivalent to the coefficient of the x 100 x^{100} term of:

( 1 + x ) 2 ( 1 + x + x 2 + . . . ) ( x + x 3 + x 5 + . . . ) 2 = x 2 ( 1 + x ) 2 ( 1 x ) ( 1 x 2 ) 2 (1+x)^2(1+x+x^2+...)(x+x^3+x^5+...)^2 = \frac{x^2(1+x)^2}{(1-x)(1-x^2)^2}

= x 2 ( 1 x ) 3 = x 2 k = 0 ( k + 2 2 ) x k = \frac{x^2}{(1-x)^3} = x^2\sum_{k=0}^{\infty}{{k+2 \choose 2}x^k}

It is easy to see that the x 100 x^{100} term coefficient is just the x 98 x^{98} term coefficient of k = 0 ( k + 2 2 ) x k \sum_{k=0}^{\infty}{{k+2 \choose 2}x^k} . This implies that the number of ways to distribute the candy is just ( 100 2 ) = 4950 {100 \choose 2} = \boxed{4950} .

Notice how ( 100 2 ) 100 \choose 2 is the number of ways to sort 101 101 identical candies into three non-empty piles. I'll leave it up to the reader to find a one to one correspondence. :)

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...