On 7/3/2022 10:33 AM,
henh...@gmail.com wrote:
how many ways can 5 people (1, 2, 3, 4, 5) be assigned to
3 rooms (A, B, C) when...
(1) No room can be empty
(2) One room can be empty
[spoiler space]
Without any restrictions, there are 3^5 = 243 ways to assign the people.
With restriction (2), only 3 of those ways are invalid:
a) All five people are assigned to room A
b) All five people are assigned to room B
c) All five people are assigned to room C
so the other 240 ways are valid.
With restriction (1), those 3 ways are invalid, plus:
* 2^5 ways to assign them to rooms A and B, minus 2 ways to assign
all five to just one of those rooms (since those ways were already
excluded above). So 2^5 - 2 = 30 total.
* Similarly, 30 ways to assign to rooms A and C (but not already
excluded), and 30 ways to assign them to rooms B and C (but not
already excluded).
So the number of valid ways is 243 - 3 - 30 - 30 - 30 = 150.
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)