This is really two related questions. First, it seems to me that given a set of $n$ objects you can divide it into a set of subsets of $a_1$ sets containing $n_1$ objects, $a_2$ sets containing $n_2$ objects and so on such that $a_1\cdot n_1 + a_2\cdot n_2 + \cdots + a_m\cdot n_m = n$ in the following way:
$\frac{\binom{n}{n_1}\cdot\binom{n-n_1}{n_1}\cdots\binom{n-(a_1-1)n_1}{n_1}\cdot\binom{n-a_1n_1}{n_2}\cdots\binom{n-a_1n_1-(a_2-1)n_2}{n_2}\cdots\binom{n-a_1n_1-a_2n_2\cdots}{n_m}}{a_1!a_2!\cdots a_m!}$
An example of this would be to divide a set of 13 distinct objects into 2 sets of 2 object and 3 sets of 3:
$\frac{\binom{13}{2}\binom{11}{2}\binom{9}{3}\binom{6}{3}\binom{3}{3}}{2!3!}$
However, deriving from another question in my book there seems to be another general formula for calculating this whose combinatoric explanation I don't really understand:
$\frac{n!}{a_1!a_2!\cdots a_m!(n_1 !)^{a_1} \cdot (n_2 !)^{a_2} \cdots (n_m !)^{a_m}}$
Based on my above example I would get:
$\frac{13!}{2!(2!)^2 3!(3!)^3}$
First is this general formula right and if so how do you explain it?
I hope the explanation to the first part is clear.