<s>[INST] Finding the mean of all 9-digit numbers formed from four $4$s and five $5$s 
I need to find the mean of the numbers ($9$-digit) formed of four $4$s and five $5$s .

MY WORK:
In order to find the sum I do the following and find sum of digits :
$$25\times5!=3000$$
$$16\times4!=384$$
So,  sum of all possible numbers :
$$3384(1+10+10^2+ ... + 10^8)$$
$$=3384\times10^7$$
For finding the amount of numbers formed,  I do :
$$\frac{9!}{4!5!}$$
$$=126$$
This,  the mean is :$$\frac{3384\times10^7}{126}$$ 
I don't know if I'm correct or not... 
 [/INST] For the reader with an interest in generating functions we have
from first principles the closed form
$${9\choose 4}^{-1}
\left. \frac{\partial}{\partial w} [z^4]
\prod_{q=0}^8 (z \times w^{4 \times 10^q} +
w^{5 \times 10^q}) \right|_{w=1.}$$
We may treat the derivative first and obtain
$${9\choose 4}^{-1}
\left. [z^4]
\prod_{q=0}^8 (z \times w^{4 \times 10^q} +
w^{5 \times 10^q}) \\ \times
\sum_{q=0}^8 \frac{4\times 10^q z \times w^{4 \times 10^q - 1} +
5 \times 10^q \times w^{5 \times 10^q-1}}{z \times w^{4 \times 10^q} +
w^{5 \times 10^q}}
 \right|_{w=1.}$$
Evaluating at $w=1$ yields
$${9\choose 4}^{-1}
[z^4]
\prod_{q=0}^8 (z + 1) \times
\sum_{q=0}^8 \frac{4\times 10^q z +
5 \times 10^q}{z + 1}
\\ = {9\choose 4}^{-1}
[z^4] (1+z)^8
\sum_{q=0}^8 (4\times 10^q z + 5 \times 10^q)
\\ = {9\choose 4}^{-1}
[z^4] (1+z)^8
(444.444.444 z + 555.555.555)
\\ = {9\choose 4}^{-1} 111.111.111
[z^4] (1+z)^8 (4z + 5)
\\ = {9\choose 4}^{-1} 111.111.111
\left(4{8\choose 3} + 5 {8\choose 4}\right).$$
We have confirmed the result by the replies that were
first to appear, namely
$$\bbox[5px,border:2px solid #00A000]{506172839.}$$
</s>