Putting Balls in Urns If we have $a_1$ balls of one color, $a_2$ balls of another color, ..., $a_k$ balls of color k, how many different ways are there to put those balls in $n$ urns, where the urns are distinguishable?
I was trying to solve the problem for 4 balls of one color, 3 balls of another color, and 4 urns, and I was quite befuddled. I think you can do this with generator functions, but I can't come up with a general solution. 

Hint: Let $F(a_1)$ be the number of ways to put the $a_1$ red balls into $n$ urns, $F(a_2)$ the number of ways to put the $a_2$ green balls into $n$ urns, and so on. Then the number of ways to do our job is $F(a_1)F(a_2)\cdots F(a_k)$.
