Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

How many positive integers less than 1000 have at least one decimal digit equal to 9?

Please correct me:

Answer = (1) + {(1*10) + (9*1)}+ {(1*10*10) + (9*10*1) + (9*1*10)}

==> 9 + 9x + x9 + 9xx + xx9 + x9x

I think I counted 99 twice and 999 three times, are there more cases I over counted?

share|improve this question
    
The question would be easier to answer if you explained how you counted. –  joriki Dec 3 '12 at 3:53
1  
Yes, you're also double-counting three-digit numbers like $919$, $299$, etc. –  mjqxxxx Dec 3 '12 at 4:01

2 Answers 2

up vote 1 down vote accepted

It looks as if you counted numbers like $399$, or $919$, or $991$ more than once.

It is easier to count the numbers that don't have a $9$. There are $8$ from $1$ to $9$. For $10$ to $99$, the first digit can be any of $8$, and for each choice the second digit can be any of $9$, for a total of $8\cdot 9$. Similarly, for $100$ to $999$, the first digit can be any of $8$, and for any first digit, there are $9\cdot 9$ ways to choose the rest, for a total of $8\cdot 9\cdot 9$.

Add up, subtract from $999$.

Another way: It is slightly easier to insert if necessary lead $0$'s to make every number from $0$ to $999$ a three-digit number. Then there are $9^3 -1$ "nine-free" numbers (we do not allow $000$). Subtract from $999$.

share|improve this answer

The numbers you are interested in are of the form $$\times \times \times$$ where $\times \in \{0,1,2,\ldots,9\}$. $$\text{Number of numbers that have at-least one digit as $9$ =}$$ $$\text{(Number of numbers of the form $\times \times \times$)}$$ $$ - \text{(Number of numbers of the form $\times \times \times$ with none of the digits as $9$)}$$ $$\text{Number of numbers of the form $\times \times \times$} = 10 \times 10 \times 10 = 1000$$ $$\text{Number of numbers of the form $\times \times \times$ with none of the digits as $9$} = 9 \times 9 \times 9$$ Hence, $$\text{Number of numbers that have at-least one digit as $9$} = 10^3 - 9^3 = 271$$

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.