Distribute n distinct objects groups to distinct recepeints Formula for distributing n distinct objects to $r$ distinct recipients: $n^r$
Formula for distributing n identical objects to $r$ distinct recipients: $\binom{n+r-1}{r-1}$
What is the formula for distributing n distinct groups of objects to $r$ distinct recipients?
For example:
Distribute 2,2,3,3,3,4,5 to 3 distinct recipients.
Here, the groups are $(2, 2)$, $(3,3,3)$, $(4)$, $(5)$.
 A: You can calculate the number of ways to distribute the objects from each group easily. Then, you can multiply that for all groups:
If there are $n$ groups with $a_i$ ($1\leq i\leq n$) object in each group, the number of ways to divide $a_i$ objects to $r$ recipients is
$$
\binom {a_i+r-1}{r-1}
$$
Multiplying this for all $a_i$ yields:
$$
\prod_{i=1}^n\binom {a_i+r-1}{r-1}=
\prod_{i=1}^n\binom {a_i+r-1}{a_i}
$$
In the example you give, we have $(a_i)=(2,3,1,1)$. We thus get
$$
\binom{r+1}{2}\binom{r+2}{3}\binom{r}1\binom r1=\frac 12r(r+1)\cdot \frac 16 r(r+1)(r+2)\cdot r\cdot r\\
=\frac 1{12}r^3(r+1)^2(r+2)
$$
A: Treat the groups separately. For instance, suppose you have $r$ people, and you have $a$ identical type A objects, $b$ identical type B objects, and $c$ identical type C objects. 
Then the number of ways to distribute these $a+b+c$ objects among the $r$ people is
$$\binom{a+r-1}{r-1}\binom{b+r-1}{r-1}\binom{c+r-1}{r-1}.$$ 
Just imagine distributing the type A objects first: there are $\binom{a+r-1}{r-1}$ ways to do this, by the formula you quoted. For every way of distributing the type A objects, there are $\binom{b+r-1}{r-1}$ ways to distribute the type B objects, and so on. 
