TITLE: Why would Inclusion-Exclusion be used here?
QUESTION [5 upvotes]: I'm trying to do some discrete mathematics work and I am told I need to use Inclusion-exclusion, but I really don't see why the exclusion would be needed?
The question:

What is the number of ways to color $n$ objects with 3 colors if every color must be used at least once?

If we let each color represent a circle on a venn diagram, we would come up with this something like this:

Let's say the green circle is $A$, the blue circle is $B$ and the red circle is $C$.
If we used inclusion-exclusion, $|A \cup B \cup C| = |A| + |B| + |C| = |A \cap B| - |A \cap C| - |B \cap C| + |A \cap C \cap C|$
Why would you exclude $|A \cap B| - |A \cap C| - |B \cap C|$? That would be getting rid of yellow, purple, and baby blue. Is there something I'm missing?
I would say there are 7 possible colors per object, therefore, the number of ways to color n objects with 3 colors would be $n^7$.

REPLY [2 votes]: It is not made clear whether the objects to be painted are distinct (like houses) or should be considered identical, like balls. The answers in the two cases are different. We study only the case where the objects are distinct.
Remember the side condition that each colour must be used at least once.
Suppose we forget about that condition. Assume say that there are $10$ distinct objects to be painted.
If there were no condition about using each colour at least once, the answer would be simple. For every one of the $10$ objects, there are $3$ colour choices, for a total of $3^{10}$.
Let the colours be blue, red, and white.  Some of the $3^{10}$ choices mentioned above are bad choices. For example, some of these choices do not use the colour blue.
How many choices do not use blue? Then we are using a $2$-colour palette. So $2^{10}$ choices do not use blue. Similarly, $2^{10}$ choices do not use red, and $2^{10}$ choices do not use white.
So is the number of bad choices equal to $3\cdot 2^{10}$?  Not quite. Each of the $2^{10}$ choices includes $2$ choices in which only one colour is used. So each one colour choice has been counted by $3\cdot 2^{10}$ twice. So there are in fact only $3\cdot 2^{10}-3$ bad choices.
Thus the total number of valid choices is $3^{10}-3\cdot 2^{10}+3$. It is useful to write this as $\binom{3}{3}3^{10}-\binom{3}{2}2^{10}+\binom{3}{1}1^{10}$.