Number of colorings using inclusion–exclusion principle
Let's say there are $21$ possibilities to color an object using an inventory of the colors red, green and blue. (By 'inventory' I mean that we don't have to use all three colors, we can also only use 1 or 2 of these colors.)
And let's say there are $6$ possibilities to color this object for each inventory of 2 of the above colors. (so $6$ possibilities for the inventory consisting of red+green, 6 possibilities for the inventory consisting of red+blue, 6 possibilities for the inventory consisting of green+blue)
I want to determine the number of colorings using
- (a) exactly 3 colors
- (b) at least 2 colors
(a)
Let
$A...$ set of all colorings using an inventory consisting of the color red
$B...$ set of all colorings using an inventory consisting of the color green
$C...$ set of all colorings using an inventory consisting of the color blue
So we have $$|A|=|B|=|C|=1\\|A\cap B|=|A\cap C|=|B\cap C|=6\\|A\cap B\cap C|=21$$
My solution is $1+1+1-6-6-6+21=6$. Is that correct?
For (b) my idea was to compute the number of colorings using exactly $2$ colors and add it to my solution of (a). How can I compute the number of colorings using exactly $2$ colors using the inclusion-exclusion principle? I thought we have $1+1+1-6-6-6$ but this is obviously wrong.
Your mistake is in how you have defined the sets. You write $|A| = |B| = |C| = 1$. If $|A| = 1$, how is $|A \cap B| = 6$ possible when $A \cap B \subset A$?
For $(b)$, you can simply subtract number of ways to color with exactly one color which is $3$. So the answer to $(b)$ is $~21 -3 = 18$.
Given the question, I would define $A$ as set of all colorings with exactly one color, $B$ with exactly two colors and $C$ with exactly three colors. Note they are disjoint sets.
$|A| + |B| + |C| = 21$
$|A| = 3, ~ |B| = 3 \cdot (6 - 2) = 12$
$|C| = 21 - 12 - 3 = 6$
Answer to $(b)$ is,
$|B| + |C| = 12 + 6 = 18 ~$ or $~21 - |A| = 18$