Typing out all integers from $1$ to $10,000$

100 Views Asked by At

Imagine you used a numeric keypad to type out all the integers from $1$ to $10,000$ (inclusive). What is the result when you subtract the digit on the keypad used least often from the digit on the keypad used most often (most minus least)?

Attempt:

First note that each of the digits $1,2,\ldots,9$ occur the same number of times by symmetry if we count up to $10,000$ exclusive. We note that since $0$ doesn't appear as the first digit it must appear the least number of times. Thus, since $10,000$ contains $1$, the digit $1$ occurs most often and $0$ occurs least often giving an answer of $1-0 = 1$.

1

There are 1 best solutions below

4
On

You have reasoned correctly and your solution is correct.

The one part that needs clarification (as has been pointed out in the comments) is

We note that since $0$ doesn't appear as the first digit it must appear the least number of times.

I think this should be clarified:

In typing out $1$ through $1000$, if we had typed the leading $0$s (like $001, 002, 003,$ etc.) then we would have counted every digit $0$ through $9$ an equal number of times, not counting the one extra $1$ in $1000$. So we are missing a number of zeros equal to the number of leading zeros we left off. There is certainly at least one leading zero we left off, thus there are fewer zeros than there are any of the digits $2$ through $9$.