Question 1197427
<br>
The "stars and bars" method can be used to solve any problem like this involving distributing items into different groups.<br>
Let's look at a simplified example of your problem where there are only 3 items and only 2 boxes.<br>
It's easy to list the 4 possibilities for distributing 3 items into 2 boxes: 0 and 3, 1 and 2, 2 and 1, or 3 and 0.<br>
Here is how to solve this example using stars and bars.<br>
We start with 3 stars (*) to represent the 3 items:<br>
***<br>
To represent dividing the 3 items into 2 boxes, we use 1 bar (|) to represent a divider; note that to divide the items into n=2 groups, only n-1=1 divider is needed.<br>
The different arrangements of the 3 stars and 1 bar represent the distinct ways of distributing the 3 items among the 2 boxes:
|*** --> 0 and 3
*|** --> 1 and 2
**|* --> 2 and 1
***| --> 3 and 0<br>
With formal mathematics, the number of different ways to arrange a string of 4 symbols, of which 3 are the same and the other 1 is different, is calculated like this:<br>
{{{4!/((3!)(1!))=4}}}<br>
We will use this kind of calculation in finding the answers to your questions.<br>
The basic problem in your post (without restrictions) is to find the number of ways of distributing 15 items into 5 boxes.  Using stars and bars, we would have 15 stars and 5-1=4 bars, and the calculation would be<br>
{{{19!/((15!)(4!))=3876}}}<br>
Now let's look at the two questions in your post.<br>
<hr><hr>
The following analysis and solution are faulty.  See farther down in my response for the correct solution.<br>
The second one is actually easier, so we'll do that one first.<br>
To make sure there are no empty boxes, we first put 1 item in each of the 5 boxes.  That assures us that there will be no empty boxes, so there are no restrictions on where the remaining items go.<br>
But that means we have to distribute 15-5=10 items into 5 boxes; the number of ways to do that is<br>
{{{14!/((10!)(4!))=1001}}}<br>
ANSWER for your second question: 1001 ways to have no empty boxes.<br>
And finally your other question: the number of ways to distribute the 15 items if there are at least 2 empty boxes.<br>
Let's consider different numbers of empty boxes.<br>
Clearly there can't be 5 empty boxes.<br>
(1) 4 empty boxes.
All 15 items must go in the one non-empty box; there is only 1 way to do that.  And the non-empty box can be any one of the 5 boxes.
So with 4 empty boxes the number of ways of distributing the 15 items is 1*5 = 5.<br>
(2) 3 empty boxes.
Now the 15 items must be distributed into the 2 non-empty boxes.
By stars and bars, the number of ways to do that is {{{16!/((15!)(1!))=16}}}.
And the number of ways of choosing the 3 empty boxes (or of choosing the 2 non-empty boxes) is "5 choose 2", which is 10.
So with 3 empty boxes the number of ways of distributing the 15 items is 16*10 = 160.<br>
(3) 2 empty boxes.
Now the 15 items must be distributed into the 3 non-empty boxes.
By stars and bars, the number of ways to do that is {{{17!/((15!)(2!))=136}}}.
And the number of ways of choosing the 2 empty boxes (or of choosing the 3 non-empty boxes) is (again) "5 choose 2", which is 10.
So with 2 empty boxes the number of ways of distributing the 15 items is 136*10 = 1360.<br>
ANSWER for your first question: with at least 2 empty boxes, the number of ways of distributing the 15 items is 5+160+1360 = 1525.<br>
<hr><hr>
In the above analysis, the cases overlap, so the counts are faulty.  The analysis below gives the correct results.<br>
To check our results, we will determine the numbers of ways of distributing the 15 items with EXACTLY 0 empty boxes, or with EXACTLY 1 empty box, ..., or with EXACTLY 4 empty boxes.  The sum of the numbers for the separate cases should be the total number of ways, which was determined earlier to be 3876.<br>
The analysis for each case needs to do the following:
(1) determine the number of ways of choosing the given number of empty boxes from among the 5 boxes;
(2) put one item in each of the non-empty boxes to ensure that the number of empty boxes is correct for that case; and
(3) use stars and bars to determine the number of ways to distribute the remaining items in the non-empty boxes.<br>
Exactly 0 empty boxes....<br>
The number of ways of choosing 0 of the 5 boxes to be empty is "5 choose 0" = 1.
Put 1 item in each of the 5 non-empty boxes, leaving 10 items yet to be distributed.
Use stars and bars to find that the number of ways of distributing the remaining 10 items into 5 boxes is "14 choose 4": {{{14!/((10!)(4!))=1001}}}.
Number of ways with exactly 0 empty boxes: (1)(1001) = 1001.<br>
Exactly 1 empty box....<br>
The number of ways of choosing 1 of the 5 boxes to be empty is "5 choose 1" = 5.
Put 1 item in each of the 4 non-empty boxes, leaving 11 items yet to be distributed.
Use stars and bars to find that the number of ways of distributing the remaining 11 items into 4 boxes is "14 choose 3": {{{14!/((11!)(3!))=364}}}.
Number of ways with exactly 1 empty box: (5)(364) = 1820.<br>
Exactly 2 empty boxes....<br>
The number of ways of choosing 2 of the 5 boxes to be empty is "5 choose 2" = 10.
Put 1 item in each of the 3 non-empty boxes, leaving 12 items yet to be distributed.
Use stars and bars to find that the number of ways of distributing the remaining 12 items into 3 boxes is "14 choose 2": {{{14!/((12!)(2!))=901}}}.
Number of ways with exactly 2 empty boxes: (10)(91) = 910.<br>
Exactly 3 empty boxes....<br>
The number of ways of choosing 3 of the 5 boxes to be empty is "5 choose 3" = 10.
Put 1 item in each of the 2 non-empty boxes, leaving 13 items yet to be distributed.
Use stars and bars to find that the number of ways of distributing the remaining 13 items into 2 boxes is "14 choose 1": {{{14!/((13!)(1!))=14}}}.
Number of ways with exactly 3 empty boxes: (10)(14) = 140.<br>
Exactly 4 empty boxes....<br>
The number of ways of choosing 4 of the 5 boxes to be empty is "5 choose 4" = 5.
Put 1 item in the 1 non-empty box, leaving 14 items yet to be distributed.
Use stars and bars to find that the number of ways of distributing the remaining 14 items into 1 box is "14 choose 0" = 1.<br>
Number of ways with exactly 4 empty boxes: (5)(1) = 5.<br>
The total number of ways for the different numbers of empty boxes is<br>
1001 + 1820 + 910 + 140 + 5 = 3876<br>
This verifies that the numbers for the separate cases are correct.<br>
So now we can answer your two questions correctly.<br>
i) Number of ways of having at least two empty boxes: 910 + 140 + 5 = 1055<br>
ii) Number of ways of having no empty box: 1001<br>