Calculate number of elements in a set How many natural numbers are there below 1000 that are multiples of 3 or that contain 3 in any digit of the number?
My effort : Here we need to calculate union of two set. First set is natural number which are multiple of 3. So it's cardinality will be the nearest integer of 1000/3, which will be 333. But I am confused with second set.
Any help/hint in this regards would be highly appreciated. Thanks in advance!

Well, inclussion exclusion says the answer will be
(A)#numbers divisible by three + (B)#numbers with at least one three - (C)#numbers divisible by three and at least on three.
(A) is easy.  $\lfloor \frac{1000}3 \rfloor = 333$.
(B) = #total number - #numbers with not threes.
If we consider the numbers as three digits from $000$ to $999$ there are $10^3$ where the digits can be anything and $9^3$ where the digits can be anything but $3$.  So $B=  10^3 -9^3 = (10-9)(10^2 + 10*9 + 9^2)= 271$
(C) is the tricky one but if you know the "rule of three" that if $100a + 10b + c$ is a multiple of $3$ then $a+b+c$ is a multiple of $3$.  And if one of $a,b,c$ is $3$ then the other two add to a multiple of $3$.
Those options are $0+3, 1+2, 2+1,3+0, 0+6, 1+5$ etc.  but we have to worry of double counting.
(C) = (D)#with exactly one three and the other two adding to a multiple of three + (E)#with exactly two threes and the third being a muliptle of three + (F)#with exactly three threes.
For (D) the other two numbers can be $(1,2),(2,1),(1,5),(2,4),(4,2),(5,1),(1,8),(2,7),(4,5),(5,4),(7,2),(8,1)$.  That is $12$ options.  ANd there are three options for which digit is the $3$.  So $D = 3*12=36$
For (E) the third digit can be $0,6$ or $9$.  And there are $3$ positions it can be in.  So (E) = $3*3=9$.
And (F) is obviously equal to $1$.
So $C = 36+9 + 1 = 46$.
We have A + B -C= $333 + 271- 46 =558$.
