.
Using all digits from 0 to 9, allowing for repetition, how many 3 digit numbers are possible
that contain at least one 5?
~~~~~~~~~~~~~~~
Let U be the set of all three-digit integer positive numbers (an "universal set").
Let A be a subset in U consisting of all three-digit integer positive numbers having "5" as the left-most digit.
Let B be a subset in U consisting of all three-digit integer positive numbers having "5" in the second position.
Let C be a subset in U consisting of all three-digit integer positive numbers having "5" in the third position.
The set A contains 10*10 = 100 numbers;
The set B contains 9*10 = 90 numbers (zero is prohibited as the left-most digit);
The set C contains 9*10 = 90 numbers (zero is prohibited as the left-most digit).
The sets A and B have intersection comprised of all positive integer numbers of the form 55X. There are 10 numbers in this intersection.
The sets A and C have intersection comprised of all positive integer numbers of the form 5X5. There are 10 numbers in this intersection.
The sets B and C have intersection comprised of all positive integer numbers of the form X55. There are 9 numbers in this intersection.
The sets A, B and C have TRIPLE intersection comprised of ONE positive integer number 555. There is 1 number in this intersection.
Now, we want to determine the number of elements in the union (A U B U C).
Use the Inclusion-Exclusion formula
n(A U B U C) = n(A) + N(B) + n(C) - n(A ∩ B) - n(A ∩ C) - n(B ∩ C) + n(A ∩ B ∩ C) =
= 100 + 90 + 90 - 10 - 10 - 9 + 1 = 252.
ANSWER. In all, there are 252 such numbers.
Solved.