# Thread: Number of different distributions

1. ## Number of different distributions

Suppose there are seven distinct colored balls. How many ways can we distribute these seven balls among four identical containers where container(s) can be left empty?

I had a feeling that the solution is simply $\displaystyle 4^{7}$ but I might be leaving something out. Since the containers are identical, the order does that matter, so we can just simply line them up and then for each ball, there are four choices, so it would simply be $\displaystyle 4 \times 4\times 4\times 4 \times 4 \times 4\times 4 = 4^{7}$ But then I realized that having, for example, all of the balls in the "first container" is the same as having them all in the "last container" so I figure that we'd have to divide $\displaystyle 4^{7}$ by $\displaystyle 4!$. So would the answer simply be $\displaystyle \frac{4^{7}}{4!}$? Thanks.

Edit: Nevermind, that's not even a whole number. I'm kinda stuck. If no containers are to be left empty then it'd be, by Stirling numbers of a second kind, $\displaystyle \frac{1}{4!}[4^{7} -+ 4(3^{7}) + 6(2^{7}) - 4(1^{7})]$, but I am not sure how to account for the number of ways where there are empty container(s).

2. Originally Posted by Pinkk
Suppose there are seven distinct colored balls. How many ways can we distribute these seven balls among four identical containers where container(s) can be left empty?

I had a feeling that the solution is simply $\displaystyle 4^{7}$ but I might be leaving something out. Since the containers are identical, the order does that matter, so we can just simply line them up and then for each ball, there are four choices, so it would simply be $\displaystyle 4 \times 4\times 4\times 4 \times 4 \times 4\times 4 = 4^{7}$ But then I realized that having, for example, all of the balls in the "first container" is the same as having them all in the "last container" so I figure that we'd have to divide $\displaystyle 4^{7}$ by $\displaystyle 4!$. So would the answer simply be $\displaystyle \frac{4^{7}}{4!}$? Thanks.

Edit: Nevermind, that's not even a whole number. I'm kinda stuck. If no containers are to be left empty then it'd be, by Stirling numbers of a second kind, $\displaystyle \frac{1}{4!}[4^{7} -+ 4(3^{7}) + 6(2^{7}) - 4(1^{7})]$, but I am not sure how to account for the number of ways where there are empty container(s).
The answer is the Stirling number S(7,4) = $\displaystyle \frac{1}{4!}\sum_{j=0}^{4}\left({4\atop j}\right)\left(-1\right)^{j}\left(4-j\right)^{7}$

3. Originally Posted by oldguynewstudent
The answer is the Stirling number S(7,4) = $\displaystyle \frac{1}{4!}\sum_{j=0}^{4}\left({4\atop j}\right)\left(-1\right)^{j}\left(4-j\right)^{7}$

Sorry that is only if each recipient receives at least one object.

You have to sum the Stirling numbers for no restrictions.

$\displaystyle \sum_{i=1}^{7}S(7,i)$