How many of the subsets of the set $A$ are such that the product of the elements of that subset is divisible by $10$? 
Given that $A=\{1,2,3,4,5\}$
How many of the subsets of the set $A$ are  such that the product of the elements of that subset is divisible by $10$?

My try
10 divisors are ${2,5} , {4,5} ,{2,4,5}$
Number of subsets contain ${2,5} = 2^3=8$
Number of subsets contain ${4,5} = 2^3=8$
Number of subsets contain ${2,4,5} = 2^2=4$
So the total number $=8+8+4=20$
But i think there are overcounting in my solution
Is that true? Provide me explanations please...
 A: Yes, you are indeed overcounting. This is a basic application of the inclusion-exclusion principle, which, for two sets $A,B$, states
$$|A \cup B| = |A| + |B| - |A \cap B|$$
or, in words,
$$\text{(# of elements in A or B) = (# in A) + (# in B)}- \text{(# in both A and B)}$$
This is also easily visualized through a Venn diagram. If you wanted to count the things either in $A$ or in $B$, you could do so in terms of $A$ and $B$ individually, but you double-count the region common to both circles:


In your case, let $A$ denote the subsets of $\{1,2,3,4,5\}$ such that $2,5$ are in them, and $B$ denote the subsets with $4,5$ in them. This works because our desired subsets must have at least one number with a factor of $2$ ($2,4$) and it must also have $5$ in it. By having a factor of two and one of five, then the product of the elements of the set is just some multiple of $10$, precisely what we desire.
What you want is the number of subsets with either $2,5$ or $4,5$, i.e. the left side of our equality, but some subsets exist with $2,4,5$. These are the overcounted ones.
You have correctly calculated that $8$ reside in $A$, $8$ reside in $B$, and $4$ reside in both $A$ and $B$ together. Thus:
$$|A \cup B| = |A| + |B| - |A \cap B| = 8+8-4$$
which will give you your answer.
A: Simpler method: the sets you require


*

*must contain $5$: there is only one option here;

*must contain $2$ or $4$ or both: three options;

*must contain $1$ or $3$ or both or neither: four options.


So the total number of subsets is $1\times3\times4=12$.
