5

Question:
When numbers of $1$ to $1000$ are written out in decimal notation. How many digits are $1$?

Attempt:
$$1XX\\ X1X\\ XX1$$

The count of $1$ for the types above are, $${{3}\choose{1}}*9*9$$

$$1000$$

Which is just one $1$.

$$1X\\11\\X1$$

Which is $9+1+9 = 20$.

$$11X\\1X1\\X11$$

Which contains,

$${{3}\choose{1}}*9$$

And finally,

$$1$$

Which is just 1.

Adding them all together,

$${3\choose 1}*81 + 1 + 9 + 1 + 9 + {3\choose 2}*9 + 1 = 291$$

The problem is the answer key demands $301$, if someone could point out what cases am I missing?

JoeyAndres
  • 1,269
  • 5
    There are $100$ $1$'s in each position for the numbers $0$ to $999$, plus an extra for $1000$. – André Nicolas Jul 26 '14 at 15:54
  • 2
    You counted number with two or more ones as a single one. – T.J. Gaffney Jul 26 '14 at 15:56
  • 1
    If on your first calculation you allow $X$ to be $0$ then you also account for one-digit numbers and two-digit numbers. Your formula becomes $3·10·10=300$ and then you have to add one for the $1000$ – Darth Geek Jul 26 '14 at 15:59

4 Answers4

3

You are missing certain numbers, for example $111$. Instead of using $9$ possibilities for the other digits, use $10$. The calculation will then be:

$$\binom{3}{1} \cdot 10 \cdot 10 = 300$$

This also covers $2$-digit numbers, since $0$ as the hundreth-digit is a possibility.

Add one to account for the number $1000$, and you are done. $300 + 1 = 301$.

naslundx
  • 9,720
2

Consider the numbers $0$ to $999$. For numbers less than $100$, pad their representation on the left with $1$ or $2$ zeros, so that all numbers are $3$-digit numbers.

There are $1000$ numbers. Each digit appears equally often in each position, so $100$ times. That gives a total of $300$ $1$'s. Add an extra $1$ because of the $1000$.

Note that there are $4000$ $1$'s used in writing all the numbers from $0$ to $9999$, and $50000$ in writing all the numbers from $0$ to $99999$.

André Nicolas
  • 507,029
1

Better method: Don't count the numbers. Just count the occurrences.

xx1 has 100 1's in the ones place. (DON'T worry about the 1s in the tens or hundreds place. We will count those later.)

x1x has 100 1's the the tens place. (DON'T worry about the 1s in the ones place; we already counted those. DON'T worry about the 1s in the hundreds place we will count those later.)

1xx has 100 1's in the hundreds place. (DON'T worry abo....)

then there is 1000 which has just the one 1.

That's 301 1's total.

Your mistake was two-fold. a) When you had a number like 11X you only counted it once even though it has two 1's. and b) When you counted numbers like 1X and X1X you didn't realize X1X could be 01X which is the same as 1X so you counted all those numbers twice.

fleablood
  • 124,253
1

As an example of your error, $111$ has three $1$s and so needs to be counted three times rather than once, and $112$ has two $1$s so needs to be counted twice.

You have counted $12$ in $X1X$ so do not need to count it again in $1X$.

You also need to count one for $1000$.

So try $$1 \times {3 \choose 1}\times 81 + 2 \times {3 \choose 1}\times 9 +3 \times 1 +1 = 301$$ or even (if you start with $0$) $$0 \times {3 \choose 0}\times 9^3 +1 \times {3 \choose 1}\times 9^2 + 2 \times {3 \choose 2}\times 9^1+ 3 \times {3 \choose 3}\times 9^0 +1 = 301.$$

Henry
  • 157,058