Expected number of different digits of random $5$-digit number

combinatoricsexpected valueprobability

A random $5$-digit number is chosen. What is the expected number of different digits? (For this question, numbers with leading zeros like $00585$ are considered $5$-digit
numbers.)

We want to calculate:$${{{5(10)(9)(8)(7)(6)} + 4\binom{5}{2}(10)(9)(8)(7) + 3\binom{5}{3}(10)(9)(8) + 2\binom{5}{4}(10)(9) + 10}\over{10^5}}$$I ended up getting ${{37531}\over{10000}} = 3.7531$. Is this correct? If not, then what did I do wrong?

Best Answer

Just use linearity. Assign an indicator function to each digit (according to whether or not it appears).

Given that $0$ is allowed to come first, the probability that any specified digit appears is $1-\left(\frac 9{10}\right)^5$

Thus the answer is $$10\times \left(1-\left(\frac 9{10}\right)^5\right)=\frac {10^5-9^5}{10^4}=\frac {40951}{10000}$$