A hotel has 5 distinct rooms, all with single beds for up to 2 people. The hotel has no other guests and 5 friends want to spend the night there. In how many ways can the 5 friends choose their rooms?
Solution

Analyzing only the number of people per room, without considering the order, the possible distributions can be associated with the lists:

$$
(1,1,1,1,1),(1,1,1,2) \text { or }(2,2,1)
$$

We will now analyze list by list the number of ways to distribute the friends.

i) In the list ( $1,1,1,1,1)$, all friends will stay in different rooms. There are 5 choices of room for the first friend, 4 for the second, 3 for the third, and so on. The total number of choices is:

$$
5 \cdot 4 \cdot 3 \cdot 2 \cdot 1=120
$$

ii) In the list ( $1,1,1,2)$, we can choose the room that will have two friends in 5 ways and the room that will have no one in 4 ways. Thus, there are $5 \cdot 4=20$ ways to distribute the friends among the 5 rooms. To choose the two friends who will stay together, we have $\frac{5 \cdot 4}{2}=10$ possible choices. The other three, as in the previous item, can be distributed in the three rooms in $3 \cdot 2 \cdot 1=6$ ways. The total number of distributions in this case is $5 \cdot 4 \cdot 10 \cdot 6=1200$.

iii) In the list (2,2,1), there are 5 ways to choose the room that will have only one friend. Of the remaining four, we can choose the ones that will have two guests in $\frac{4 \cdot 3}{2}=6$ ways. Once the number of friends per room is chosen, there are $\frac{5 \cdot 4}{2}=10$ choices of two friends for the first double room and $\frac{3 \cdot 2}{2}=3$ choices of 2 friends, among the remaining, for the other double room. Finally, the friend who is left will stay in the remaining room. The total number of distributions in this case is

$$
5 \cdot 6 \cdot 10 \cdot 3 \cdot 1=900
$$

Finally, the total number of distributions is

$$
120+1200+900=2220
$$