The number of ways of distributing 10 identical balls in 4 distinct boxes is? case 1 : no box should be empty. case2 : atmost three boxes ca be empty.

1 Answer

case 1 = 84, case 2 = 286


First of all, this is a question that uses the "stars and bars" technique. In case you don't know "stars and bars", we can think of the problem as laying out the 10 balls in a row and then building boxes around the balls. Since the two walls "at the end" of the boxes is trivial, we ignore them and look only at the walls that actually divide the balls.

We can denote the balls with a 0 and the walls of the boxes as a 1.

We can have this:


which is 3 balls in three boxes and 1 ball in one box.

And so what we can do is look at the number of ways we can distribute the walls (the 1s). This is a combinations problem, the formula for which is:

#C_(n,k)=(n!)/((k!)(n-k)!)# with #n="population", k="picks"#

And so with "stars and bars" problems, we look at the number of unique combinations of placing the 0s and 1s.

1. no empty boxes

In this first case, we can assign 4 balls and put one each into a box. That leaves 6 balls to be divided amongst the 4 boxes. Since we need 3 box walls to denote the 4 boxes (just like in our example above), we can then find unique combinations of 6 balls and 3 walls across 4 walls (using 3 walls) is:


2. at most 3 empty boxes

With the 3 wall technique, we'll always have at least one box with balls (we'd need a 4th wall to wall off the boxes completely from the balls. One arrangement is:


this is the first 3 boxes with no balls and the last with all of them)

And so we can look at the number of ways to combine all 10 balls and 3 walls:



This question/answer on was invaluable in helping me arrive at a methodology: