TITLE: How many numbers of $10$ digits that have at least $5$ different digits are there?
QUESTION [5 upvotes]: In principle I resolved it as if the first number could be zero, to the end eliminate those that start with zero.
The numbers that can use $4$ certain figures (for example, $1$, $2$, $3$ and $4$) are $4^{10}$. The numbers that can use any $4$ digits are ${10\choose 4}\cdot 4^{10}$
I'm saying "they can use," which does not mean that use; however this is very advantageous for this problem, for those who "can use" includes four digits using $4$ digits, which use $3$ to $2$ and using those who only use one.
So answering the question of the problem, the answer is:
"All ten-digit numbers except those who can only use four digits"
\begin{align}
&= 10^{10} - {10\choose 4} \cdot 4^{10}\\
&= 10^{10} - 210 \cdot 4^{10}
\end{align}
There is no reason to believe that the figures have some asymmetric distribution, so it is obvious that for all these numbers, the tenth start with zero. Since starting with zero are not exactly ten-digit numbers, we discard it.
The solution is:
\begin{align}
\tfrac 9{10} (10^{10} - 210 \cdot 4^{10})&= 9(10^9 - 21 \cdot 4^{10})\\
&= 8,801,819,136
\end{align}
But I'm not sure this reasoning is correct.

REPLY [3 votes]: This answer is a slightly different variation of the theme which affirms the result of @MarkoRiedel.
Here we use exponential generating functions to count the number of configurations of labelled objects and apply the coefficient of operator $[x^n]$ to denote the coefficient of $x^n$ in a generating series.

If we are looking for the number of strings of length $10$ consisting of $4$ different objects, whereby

each object may occur zero or more times, we calculate
\begin{align*}
10![x^{10}]e^{4x}
\end{align*}
each object occurs at least once, we remove $x^0$ from the generating function $e^x$ and calculate
\begin{align*}
10![x^{10}](e^{x}-1)^4
\end{align*}
each object occurs at most three times, we take the initial four summands from the series representation of $e^x$ and calculate
\begin{align*}
10![x^{10}]\left(1+x+\frac{x^2}{2!}+\frac{x^3}{3!}\right)^4
\end{align*}


We calculate the wanted number of $10$-digit numbers containing at least $5$ different digits by calculating the complement. We start with calculating the number of all $10$-digit numbers. From this number we subtract the $10$-digit numbers which contain exactly $j$ different digits, $j=1,\ldots,4$.
The number of all $10$-digit numbers are those starting with $1,\ldots,9$ followed by $9$ digits from $\{0,\ldots,9\}$. We obtain
  \begin{align*}
9\cdot 10^9
\end{align*}
  different numbers.
  Now we calculate the $10$-digit numbers which contain exactly four different digits. If we consider four different digits, the number is
  \begin{align*}
10![x^{10}](e^x-1)^4
\end{align*}
  Since we have to choose four digits out of $\{0,\ldots,9\}$, there are $\binom{10}{4}$ different possibilities giving a total of
  \begin{align*}
\binom{10}{4}10![x^{10}](e^x-1)^4
\end{align*}
  From this number we have to subtract the number of strings which start with $0$. We can describe these strings as those which start with $0$ followed by zero or more occurrences of $0$ and one or more occurrences of the other three digits. Precisely nine digits have to follow the leading zero. We obtain so
  \begin{align*}
9![x^9]e^x(e^x-1)^3
\end{align*} 
  Note the factor $e^x$ reflects the fact that $0$ may occur zero or more times after the leading $0$ while the other three digits have to occur at least once. Since there are $\binom{9}{3}$ different possibilities for choosing the three digits different from $0$ we conclude the number containing precisely four different digits are
  \begin{align*}
\binom{10}{4}10![x^{10}](e^x-1)^4-\binom{9}{3}9![x^9]e^x(e^x-1)^3
\end{align*}

$$ $$

Since we have to subtract from $9\cdot 10^{9}$ all numbers containing precisely four, three, two and one different digits, we finally obtain
\begin{align*}
&9\cdot10^9-\binom{10}{4}10![x^{10}](e^x-1)^4+\binom{9}{3}9![x^9]e^x(e^x-1)^3\\
&\quad\qquad-\binom{10}{3}10![x^{10}](e^x-1)^3+\binom{9}{2}9![x^9]e^x(e^x-1)^2\\
&\quad\qquad-\binom{10}{2}10![x^{10}](e^x-1)^2+\binom{9}{1}9![x^9]e^x(e^x-1)^1\\
&\quad\qquad-\binom{10}{1}10![x^{10}](e^x-1)^1+\binom{9}{0}9![x^9]e^x\\
&=9\cdot10^9-210\cdot818520+84\cdot204630\\
&\qquad\qquad-120\cdot55980+36\cdot18660\\
&\qquad\qquad-45\cdot1022+9\cdot511\\
&\qquad\qquad-10\cdot1+1\cdot1\\
&=8839212480
\end{align*}