Six children are each offered a single scoop of any of 3 flavors of ice cream from the Combinations Creamery. How many ways can each child choose a flavor for their scoop of ice cream so that some flavor of ice cream is selected by exactly three children?
We can approach this problem using the principle of inclusion-exclusion.
First, let's calculate the total number of ways that the children can choose their ice cream flavors without any restrictions. Each child has 3 choices, so there are 3^6 = 729 possible ways.
Next, let's count the number of ways that no flavor is selected by exactly three children. There are three cases to consider:
No flavor is selected by any of the children. In this case, each child has 3 choices, so there are 3^6 = 729 ways.
One flavor is selected by exactly two children, and the other two flavors are selected by two children each. There are three ways to choose the flavor that is selected by two children. Once that flavor is chosen, there are (6 choose 2) ways to choose the two children who will select that flavor, and then the remaining four children each have two choices for their ice cream flavor. So the total number of ways is 3 * (6 choose 2) * 2^4 = 540.
Each flavor is selected by either one or two children. In this case, there are (3 choose 2) ways to choose the two flavors that are selected by two children, and (6 choose 2) ways to choose the two children who will select each of those flavors. The remaining two children each have two choices for their ice cream flavor. So the total number of ways is (3 choose 2) * (6 choose 2) * 2^2 = 540.
Using the principle of inclusion-exclusion, we can now count the total number of ways that some flavor is selected by exactly three children:
Total number of ways = 3^6 - (number of ways no flavor is selected by exactly three children)
= 729 - (729 + 540 + 540 - (number of ways some flavor is selected by exactly two children))
Now we need to count the number of ways that some flavor is selected by exactly two children. There are three ways to choose the flavor that is selected by two children, and (6 choose 2) ways to choose the two children who will select that flavor. The remaining four children each have two choices for their ice cream flavor. So the total number of ways is 3 * (6 choose 2) * 2^4 = 540.
Substituting this value, we get:
Total number of ways = 729 - (729 + 540 - 380) = 160