Hi, I'm having troubles with this counting problem:
How many numbers between 1000 and 9999 have at least one digit that is a 2 AND at least one digit that is a 5?
I'm thinking I need to take the total amount of numbers (9000) and subtract from it:
a) The numbers with 2 but not 5, plus
b) The numbers with 5 but not 2
The problem is I'm not sure how to calculate (a) and (b). I was thinking I could do it like so:
a) Case 1: 2 is the first digit, then: (1 * 9 * 9 * 9) = 729
Case 2: 2 isn't the first digit, so it has 3 possibilities in the last 3 digits, then: (8 * 3 * 9 * 9) = 1944
Then, 729 + 1944 = 2673 the total for (a).
b) Essentially the same process, just for 5 instead of 2 so result should be the same: 2673.
So then, 9000 - 2673 - 2673 = 3654 numbers with at least one 2 and at least one 5. But something about the way I got (a) and (b) feels off to me, so I think my answer is wrong. Could somebody help me out with this problem please? Thanks in advance.
How many numbers between 1000 and 9999 have at least one digit that is a 2 AND at least one digit that is a 5?
I'm thinking I need to take the total amount of numbers (9000) and subtract from it:
a) The numbers with 2 but not 5, plus
b) The numbers with 5 but not 2
The problem is I'm not sure how to calculate (a) and (b). I was thinking I could do it like so:
a) Case 1: 2 is the first digit, then: (1 * 9 * 9 * 9) = 729
Case 2: 2 isn't the first digit, so it has 3 possibilities in the last 3 digits, then: (8 * 3 * 9 * 9) = 1944
Then, 729 + 1944 = 2673 the total for (a).
b) Essentially the same process, just for 5 instead of 2 so result should be the same: 2673.
So then, 9000 - 2673 - 2673 = 3654 numbers with at least one 2 and at least one 5. But something about the way I got (a) and (b) feels off to me, so I think my answer is wrong. Could somebody help me out with this problem please? Thanks in advance.