How many $4$ digit integer elements $X$ having no digit $0$ are in the set $C$ such that $X$ has exactly one $1$ or $X$ has exactly one $5$? Let $A = \{4~\text{digit integers}~X~\text{having no}~0~\text{such that}~X~\text{has exactly one}~1\}$.
Let $B = \{4~\text{digit integers}~X~\text{having no}~0~\text{such that}~X~\text{has exactly one}~5\}$.
Let $A+B = \{4~\text{digit integers}~X~\text{having no}~0\}$.
Then $|C| = |A| + |B| - |A + B|$.
Set A has $4C1 \cdot 8 \cdot 8 \cdot 8 = 2048$ elements.
Set B has $4C1 \cdot 8 \cdot 8 \cdot 8 = 2048$ elements.
Set $A+B$ has $8 \cdot 8 \cdot 8 \cdot 8 = 4096$ elements.
Therefore $|A| + |B| - |A + B| = 2048 + 2048 - 4096 = 0$.
I think my steps are correct, but doubt that I got the correct answer.
 A: I'd break up the types of numbers this way:


*

*numbers with all nonzero digits, exactly one $1$, and no $5$'s

*numbers with all nonzero digits, exactly one $5$, and no $1$'s

*numbers with all nonzero digits, exactly one $5$, and exactly one $1$


For the first group, choose where you put the $1$, then choose the other three digits such that they're not $0, 1,$ or $5$.  This gives $4 \cdot 7^3$ possibilities.
The second group also has this number of possibilities.
For the third group, choose where the $5$ goes, then where the $1$ goes, then the other two digits such that they're not $0, 1,$ or $5$.  This gives $4 \cdot 3 \cdot 7^2$ possibilities.
Then, the final answer is the sum of elements in groups $1$ and $2$ if your "or" is an exclusive "or," or all three groups if it's a regular "or."
A: You correctly calculated the number of four digit integers with non-zero digits that have exactly one $5$ and the number of four digit integers with non-zero digits having exactly one $1$.  However, their intersection is the set of four digit integers with non-zero digits that have exactly one $1$ and exactly one $5$.  The number of four digit integers with non-zero digits that have exactly one $1$ and exactly one $5$ is 
$$4 \cdot 3 \cdot 7^2 = 588$$
since there are four ways to place the $1$, three ways to place the $5$ in one of the remaining places, and $7$ choices (other than $0$, $1$, or $5$) for each of the two remaining digits.  
Thus, by the Inclusion-Exclusion Principle, the number of four digit integers having no zero and exactly one $1$ or exactly one $5$ is 
$$|A \cup B| = |A| + |B| - |A \cap B| = 2048 + 2048 - 588 = 3508$$ 
