Place $k$ objects in $P$ boxes, such that many objects can be placed in one box

combinatorics

Given $P$ boxes, how many ways are there to place $k$ indistinguishable objects, $k\leq P,$ whereby you can place from $0$ up to $k$ objects in each container. The result should be $C^{k+P-1}_{k},$ which I can eventually prove by induction.

What I don't understand is the way this result is established. Can somebody provide an explanation to derive the result?

Many thanks.

Best Answer

Let $x_i$ be the number of objects in box $i$ with $i=1,\dots ,P$. Then we have to count the number of non negative integer solutions, i.e. $x_i\geq 0$, of $$x_1+x_2+\dots+x_{P-1}+x_P=k.$$ Which is the same (see Stars and Bars Thm 2) to place $P-1$ bars $|$ which divides a sequence of $k+P-1$ stars $\underbrace{\star\star\dots \star\star}_{k+P-1}$ into $P$ blocks: $$ \binom{k+P-1}{P-1}=\binom{k+P-1}{k}.$$ A similar reasoning works when we have to count the number of positive integer solutions, i.e. $x_i\geq 1$, (see Stars and Bars Thm 1) which is given by $$\binom{k-1}{P-1}.$$

P.S. I recommend also the Numberphile's video Stars and Bars (and bagels).