# Help with probability question

1. Jan 7, 2014

### z.js

Hi everyone, I'm having a hard time with this problem:

Of the integers from 1000 to 9999, how many have at least one digit a 5 or 7?

My working :
[1000, 9999] = 9000 outcomes
∴ 9000 possible outcomes
Desired outcomes : (2*8^3) + (2^2*8^2)+(2^3*8)+(2^4), since 5 or 7 = 2 choices, any other numbers = 8 choices (from 0 - 9)
∴ 1360*4 desired outcomes (there are 4 places, and order matters here) = 5440 desired outcomes

But the textbook answers say 5416.

I was thinking :
maybe I should subtract from 5440 all desired outcomes which have a leading '0':
(1*8*8)+(1*2*8)+(1*2*2) = 84
∴ 5440 - 84 = 5356 (wrong!)
I'm not going to try and do numbers that have 2 leading '0's or more since the first is already proven that the answer is wrong.

Really confused about what I'm doing.
Any help would be very appreciated!
Thanks
Steve

2. Jan 7, 2014

### pwsnafu

I don't understand where got you this expression from.

"At least" problems are solved by "calculate the opposite and subtract from the total sample space".
Do understand what the opposite of problem would be?