Number of arrangements of marbles into boxes Problem: $n$ different marbles shall be placed in $N$ similar boxes in the following way: $b_1$ boxes should contain $1$ marble each, $b_2$ boxes $2$ marbles each, $b_3$ boxes 3 marbles each and $b_4$boxes $4$ marbles each. $b_1,b_2,b_3,b_4$ are given non-negative integers. How many different ways can we put the marbles into the boxes?

We can see directly that $$b_1+b_2+b_3+b_4=N$$
and
$$b_1+2b_2+3b_3+4b_4=n.$$
I'm unsure how to approach this problem. Can generating functions be used here? I'm also unsure how the fact that the marbles are different but the boxes are similar affects the solution. 
My attempt so far is to start by picking out $N$ marbles and placing one marble in each box. The number of such arrangements I believe is $$\frac{n!}{(n-N)!}.$$
Next pick out $b_2+b_3+b_4$ of the remaining marbles and distribute them into the boxes (only putting max one marble in each box). Again number of arrangements is
$$\frac{(b_2+b_3+b_4)!}{(n-b_2-b_3-b_4)!}.$$
Continuing this way I end up with
$$\frac{n!}{(n-N)!}\cdot \frac{(b_2+b_3+b_4)!}{(n-b_2-b_3-b_4)!}\cdot \frac{(b_3+b_4)!}{(n-b_3-b_4)!} \cdot \frac{(b_4)!}{(n-b_4)!}.$$
Wouldn't be surprised if this was wrong though!
 A: There are many ways to do the analysis, and they may give counts that look superficially different. I would first decide which marbles go into which type of box. The number of ways to choose the marbles that go into the Content 1 boxes can be chosen in $\binom{n}{b_1}$ ways. For each of these ways, there are $\binom{n-b_1}{2b_2}$ ways to choose which marbles will be assigned to the Content 2 boxes. And once this is done, there are $\binom{n-b_1-2b_2}{3b_3}$ ways to choose who will go into the Content 3 boxes. Now the basic distribution is determined. Multiply our binomial coefficients. If you express them in terms of factorials, there is nice cancellation, and we get 
$$\frac{n!}{b_1!(2b_2)!(3b_3)!(4b_4)!}.\tag{1}$$
 Another way of putting it is that the number of ways is the multinomial coefficient $\binom{n}{n_1,2n_2,3n_3,4n_4}$. 
Now we decide how to put the chosen balls into the boxes. The boxes are indistinguishable. So once we have decided on the $b_1$ balls that will go into content 1 boxes, there is only one way to distribute them.
Next we deal with putting the $2b_2$ balls into the $b_2$ content 2 boxes. So we want to divide the $2b_2$ balls into teams of $2$. Then we will want to divide the $3b_3$ balls chosen for the content 3 boxes into teams of $3$, and divide the $4b_4$ balls chosen for content $4$ boxes into teams of $4$.
To get the appropriate numbers, let us see how to divide $mk$ people into $m$ teams of $k$. We do it very briefly. Line up the $mk$ people. There are $(mk)!$ ways to do this. The first $k$ are one team, the next $k$ another, and so on. However, this gives us the teams in $m!$ different orders. And each team occurs in $k!$ different orders, for a total of $m!(k!)^m$. That is the amount of "double-counting." so the number of ways to divide into teams is
$$\frac{(mk)!}{m!(k!)^m}.$$
Thus the number of ways to do the assignment into individual boxes is
$$\frac{(2b_2)!}{b_2!(2!)^{b_2}} \frac{(3b_3)!}{b_3!(3!)^{b_3}}\frac{(4b_4)!}{b_4!(4!)^{b_4}}                           .\tag{2}$$
Multiply (1) and (2) and note the nice cancellations, which means I missed a simpler way of explaining it. 
Remark: The problem is also  a natural for generating functions.  
