im studying previous math exams for my discrete math finals next week, no solutions are provided for past exams so i figured id try posting here.
Q: How many non-negative integers less than one hundred thousand, 100 000, contain at least one 2 and at least one 5?
A:
let $A$ be the set of all non-negative integers <100000 that do not contain a 2.
let $B$ be the set of all non-negative integers <100000 that do not contain a 5.
$$|A|=9^5$$ $$|B|=9^5$$ $$|A\cap B|=8^5$$
The number of non-negative integers <100000 that contain neither 2 or 5 is (by inclusion/exclusion): $$|A\cup B| = |A| +|B|-|A\cap B|$$ $$=9^5+9^5-8^5=85330$$
Thus, the number of non-negative integers <100000 that contain 2 and 5 is: $$100000-|A\cup B| =100000-85330=14670$$
Assuming that the question you forgot to ask was “Is my solution correct?”: As has been stated in the comments, your solution is correct.