How many ways can you give $n$ distinct toys to $3$ children given certain conditions

142 Views Asked by At

How many ways can you give $n$ distinct toys to $3$ children given certain conditions:
Child 1 wants an odd number of toys
Child 2 wants at most 3 toys
Child 3 wants any number of toys

I would like to count the number of ways by first coming up with a generating function then determining the coefficient for $n$.

For Child 1, the generating function is: $\frac{e^x-e^{-x}}{2}$

Child 2's generating function is: $1 + x + \frac{x^2}{2!} + \frac{x^3}{3!}$

Child 3's is: $e^x$

Now we multiply all generating functions to get the generating function for all 3 children giving us:
$(\frac{e^x-e^{-x}}{2})(1 + x + \frac{x^2}{2!} + \frac{x^3}{3!})(e^x)$

Now I would like to find the Taylor expansion for this function and find the $n^{th}$ coefficient.

Am I on the right track so far?

1

There are 1 best solutions below

0
On BEST ANSWER

You have the correct exponential generating function. It only remains to extract the coefficient of $x^n$. So $$\begin{align} f(x) &= \frac{1}{2}(e^x-e^{-x})\left(1+x+ \frac{1}{2!}x^2 + \frac{1}{3!}x^3 \right) e^{x} \\ &= \frac{1}{2}(e^{2x}-1)\left(1+x+ \frac{1}{2!}x^2 + \frac{1}{3!}x^3 \right) \\ &=\frac{1}{2} \left( e^{2x} + x e ^{2x} + \frac{1}{2!}x^2 e^{2x} + \frac{1}{3!} x^3 e^{2x} -1 - x -\frac{1}{2!}x^2 - \frac{1}{3!}x^3 \right) \tag{1} \end{align}$$ Then using the "coefficient of $x^n$" operator $[x^n]$, $$\begin{align} [x^n]f(x) &= \frac{1}{2} \left( [x^n]e^{2x} + [x^{n-1}] e ^{2x} + \frac{1}{2!} [x^{n-2}] e^{2x} + \frac{1}{3!} [x^{n-3}] e^{2x} \right) \tag{2}\\ &= \frac{1}{2} \left(\frac{2^n}{n!} + \frac{2^{n-1}}{(n-1)!} +\frac{1}{2!} \frac{2^{n-2}}{(n-2)!} +\frac{1}{3!} \frac{2^{n-3}}{(n-3)!}\right) \tag{3} \end{align}$$ but since this is an exponential generating function, what we really want is $$n! [x^n]f(x) = \frac{1}{2} \left( 2^n + n 2^{n-1} +\frac{1}{2!}n(n-1) 2^{n-2} + \frac{1}{3!} n(n-1)(n-2) 2^{n-3} \right) $$ for $ n \ge 4$.

Do you see why this formula is only valid for $n \ge 4$? Hint: I left some terms out at equation $(2)$. Also, the transition from equation $(2)$ to equation $(3)$ is not valid for $n < 4$.

I leave it to you to fill in the missing values for $n=0,1,2,3$. It shouldn't be too hard, if you start with equation $(1)$.