The question comes in two parts:
-
For positive integers between 999 and 100 inclusive, how many contain the digit 5 at least once?
-
For positive integers between 999 and 100 inclusive, how many contain the digit 5 exactly once?
Question 1
Numbers between 999 and 100 inclusive:
999 – 99 = 900
Numbers between 999 and 100 inclusive that do not contain digit 5:
8 * 9 * 9 = 648 (The 8 is because the first digit can't be 5 or 0)
Numbers that contain digit 5 at least once:
900 – 648 = 252
Question 2
Total numbers that contain digit 5 exactly once:
(1*9*9) + (8*1*9) + (8*9*1) = 225
I think I got it wrong but not sure which part.
Best Answer
This is enough information to fill in the diagram above.