# In how many ways can I put 1 to 5 mirrors in 8 rooms?

A queen has 8 rooms and 12 indistinguishable mirrors, how many ways are there to hang these mirrors in 8 rooms such that every room has at least 1 mirror?

• Are the mirrors distinguishable? Oct 11, 2018 at 20:16
• I don't know, this is the problem statement as is. The answer is 330, I'm trying to understand the logic. Oct 11, 2018 at 20:16
• Ok, it's indistinguishable if 330 is the answer. Oct 11, 2018 at 20:17

We have 12 mirrors, but 8 of them must be allocated so each room has at least 1. So all we care about is placing the remaining 4 mirrors in 8 rooms.

This is a perfect place to use stars and bars, since we have 4 mirrors to spread across 8 rooms. This leads us to find the total number of combinations as $${8+4-1\choose4} ={11\choose4} =\color{red}{330}$$

If you are confused as why $$8+4-1\choose4$$ is what we desire, imagine that the * are mirrors, and | dividers, which determine which room the mirrors fall into. Since there are 8 rooms, we have 7 dividers, i.e., we seek the number of distinct combinations of

****|||||||

• It is even easier if you use the basic stars and bars. You put the $12$ mirrors in a row and can place four dividers between them. You can only place one divider between any pair of mirrors, so each room gets at least one. There are $11$ spaces for the four dividers, giving $11 \choose 4$ Oct 11, 2018 at 20:37

Let the numbers of mirror in a room be $$x_i$$, where $$x_i$$ is a positive integer.

We need to find solutions for,

$$x_1+x_2+x_3+x_4+x_5+x_6+x_7+x_8=12$$

This can be seen as 12 stars and 7 bars.

************   ||||||||


Now there are 11 gaps between 12 stars and you have 7 bars to place, where each bar separates number of mirrors in a room.

• I do not understand why this answer received so many downvotes. $\binom{11}{7}=\binom{11}{4}$ and following this answer gives the same result as the other answer. Oct 11, 2018 at 20:39