# How many ways are there to put 6 identical balls to 3 distinct bins such that no bin is empty?

How many ways are there to put 6 identical balls to 3 distinct bins such that no bin is empty ?

I tried to solve by stars and bars problem. As it is saying that no bin is empty, means every bin must have atleast one ball.

After, putting one ball in each I am left with three balls. So left 3 balls can be put in C(5,2).

But, the answer is 540. Where am i going wrong ?

• This is equivalent to solve $a_1+a_2+a_3=6$ with $a_i \geq 1$. Can you now apply the stars and bars technique? – u1571372 Nov 9 '16 at 3:56
• I have applied the same. But, answer is 540 – Jon Garrick Nov 9 '16 at 3:57
• The answer is for the wrong question. – Graham Kemp Nov 9 '16 at 4:06

The count of distinct ways to distribute 6 identical balls among 3 distinct bins is indeed: $$\binom{3+2}{2} = 10$$

The count of distinct ways to distribute 6 distinct balls among 3 distinct bins is: $$3^6- \binom{3}{1}2^6+\binom 3 2 1^6 = 540$$

• Thanks Graham for clearing . – Jon Garrick Nov 9 '16 at 4:06

The stated problem is equivalent to finding the triples $(a_1,a_2,a_3)$ with $a_i \geq 1$ and $a_1+a_2+a_3=6$. By the stars and bars technique, this number is $\binom{5}{2}=10$.