Ember baked a tray of cookies containing 4 chocolate chip, 4 oatmeal, and 2 peanut butter cookies.
In how many ways can Ember place these 10 cookies into 4 differently-colored gift bags to give to her friends? (Cookies of the same type are not distinguishable, and gift bags can be empty.)
For each gift bag, there are three options: chocolate chip, oatmeal, or peanut butter. Since the bags are all different colors, the order in which the bags are filled matters.
Thus, there are 3×3×3=27 ways to fill the gift bags.
However, we must divide by 3! since the order in which we place the same type of cookie in a gift bag doesn't matter. (For example, if Ember puts 4 chocolate chip cookies in the first bag, it doesn't matter if they are placed in the order CCC, CCB, CBC, or BCC.)
Therefore, there are 3!27=9 ways to distribute the 10 cookies into 4 gift bags.