Number of ways to arrange different types of indistinguishable objects among boxes

I have a problem where I need to calculate the number of ways I can put $n_{1}$ indistinguishable objects and $n_{2}$ indistinguishable objects that are distinguishable from $n_{1}$,into $k$ distinguishable boxes, where each box can only hold one object.

Thank you :)

Edit: $k \geq n_1 + n_2$

• How does k compare to $n_1$ and $n_2$ and their sum? – DJohnM Sep 11 '14 at 19:18
• $k \geq n_1 + n_2$ – William Grunow Sep 11 '14 at 20:19

Here is how I put it: Choose $n_1$ boxes out of $k$ boxes and place all the $n_1$ objects into this selection. Among the remaining $k-n_1$ boxes, choose $n_2$ boxes and place all the $n_2$ boxes in this selection. So, the answer would be ${k \choose n_1}{k-n_1\choose n_2}$, which matches to your answer.

Probably similar to what is given by User58220

This picture may make the calculation easier...

First, let $s$ be the number of excess (and thus empty) boxes:$$s=k-n_1-n_2; \,\,\,\, s>=0$$ Arrange the $k$ distinguishable boxes in any arbitrary order: size, color, whatever, and leave them.

Take the $n_1$ identical objects, $n_2$ identical other objects, and $s$ identical "place holders". Line these $k$ objects up beside the boxes in all possible different ways. (Can you calculate this?)

Then just put each one in its box; the placeholders just mean that box is empty...

• I think I was able to is it $\frac{k!}{n_1!n_2!(k - n_1 -n_2)!}$? – William Grunow Sep 11 '14 at 23:11

If you say $k\geq n_1+n_2$ is the same to say that the boxes can carry zero objects? I assume that yes. This is a permutation with repetitions of three type of objects $(n_1, n_2, \emptyset)$ in k positions:

$$\binom{k}{n_1,n_2,k-n_1-n_2}$$