^
In how many ways can five students be placed in three distinct rooms so that no room is empty?
Please demo, thanks
Stars and bars would be if the five objects to be placed (students here) were identical, which is not the case here. One way to do it is as follows.
Call the rooms 1, 2, 3. Let U be the set of all possible arrangements without restrictions, and let S
k be the set of all arrangements if room k is empty (k = 1, 2, 3). Then we are after the value of |S
1c ∩ S
2c ∩ S
3c|, which is equal to |U| – |S
1 ∪ S
2 ∪ S
3|.
Since the students and rooms are distinct, we have |U| = 3
5 (each student could go in any of three rooms).
Now, note |S
1| = 2
5 (if room 1 is empty, each of the five students can go in one of two rooms). By symmetry, |S
2| = |S
3| = 2
5.
Now, |S
1 ∩ S
2| = 1 (if rooms 1 and 2 are to be empty, only one way to arrange the students, namely by putting them all in the last room). By symmetry, the other two pairwise intersections have cardinality 1.
Also, |S
1 ∩ S
2 ∩ S
3| = 0 (if all rooms are empty, 0 ways to arrange the students).
So
Answer = |U| – |S
1 ∪ S
2 ∪ S
3|
= |U| – (3|S
1| – 3|S
1 ∩ S
2| + |S
1 ∩ S
2 ∩ S
3|) (using the
inclusion/exclusion principle)
= 3
5 – (3×2
5 – 3×1 + 0)
= 150.