SOLUTION: how many numbers between 100 and 1000 have at least one 2 in the number

Algebra ->  Probability-and-statistics -> SOLUTION: how many numbers between 100 and 1000 have at least one 2 in the number      Log On


   



Question 567696: how many numbers between 100 and 1000 have at least one 2 in the number
Found 2 solutions by Edwin McCravy, richard1234:
Answer by Edwin McCravy(20055) About Me  (Show Source):
You can put this solution on YOUR website!
There are these 7 cases, where the letters X and Y represent 
numbers which are NOT 2's.  Remember there are 9 digits which are
not 2.

The cases are 2XY, X2Y, XY2, X22, 22X, 2X2, 222

Case 1: 2XY

There are 9 ways to choose a digit for the X and for each of 
those 9 ways there are 9 ways to choose a digit for the Y.

That's 9·9 or 81 ways


Case 2: X2Y

There are 8 ways to choose the X (it can't be 0 or 2) and for each 
of those 8 ways there are 9 ways to choose the Y.

That's 8·9 or 72 ways

Case 3: XY2

That's just like Case 2.  That's 72 more ways.

Case 4: X22

There are 8 ways to choose the X (it can't be 2 or 0).  That's 8 more ways.

Case 5: 22X

There are 9 ways to choose the X.  That's 9 more ways.

Case 6: 2X2

That's just like Case 5.  That's 9 more ways.

Case 7: 222.  That's 1 more way, simply the number 222.

81 + 72 + 72 + 8 + 9 + 9 + 1 = 252

Answer: 252

Edwin

Answer by richard1234(7193) About Me  (Show Source):
You can put this solution on YOUR website!
There are 901 numbers between 100 and 1000 (inclusive). Instead of counting how many numbers have at least one 2, we can count how many numbers do not have any 2's at all, and subtract from 901 (since this is the complement of what we want).

For each of the three digits, there are 8 choices for the first digit (anything except 0, 2), 9 choices for the second digit (anything except 2) and 9 choices for the third digit. Hence the number of 3-digit numbers with no 2's is 8*9*9 = 648. Including the number "1000" we have 649. Subtract this from 901 to get 901 - 649 = 252.

Note that it does not matter if we include "100" or "1000" in our set since we'll be subtracting them anyway (instead of 901 - 649 we'll get 900 - 648 or 899 - 647 = 252).