Let $S$ be the set of all $10$ -digit integers that can be composed from the integers $1,2, ...., 9,$ (repetition is allowed). Let $A$ be the product of the $10$ digits of an element $N$ of $S$ that has been chosen uniformly and at random.

If $P$ is the probability that $A$ is divisible by $10$ , then find $\lfloor 1000P \rfloor$ .

**
Details and Assumptions
**
:

As an explicit example: if $N = 1186734452$ , then the value of $A$ associated with $N$ is $1 \times 1 \times 8 \times 6 \times 7\times 3\times 4\times 4\times 5\times 2 = 161280$

The answer is 689.

**
This section requires Javascript.
**

You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.

For the product $A$ to be divisible by $10$ at least one of the digits must be divisible by $2$ , i.e., must be one of $2, 4, 6, 8$ , and at least one of digits must be $5.$ It will be easier, though, to first count the number of elements that are not divisible by $10.$

There are $4^{10}$ elements of $S$ that have no digits that are either even or $5.$

Next, as there are $8^{10}$ elements that do not have $5$ as a digit, there are $8^{10} - 4^{10}$ elements that have an even digit but no $5.$

Finally, as there are $5^{10}$ elements that do not have an even digit, there are $5^{10} - 4^{10}$ elements that have a $5$ but no even digit.

Thus there are $4^{10} + (8^{10} - 4^{10}) + (5^{10} - 4^{10}) = 8^{10} + 5^{10} - 4^{10}$ elements of $S$ that are not divisible by $10.$ As there are $9^{10}$ elements in $S$ , the probability $P$ that the product $A$ associated with a randomly chosen element $N$ of $S$ is divisible by $10$ is then

$P = \dfrac{9^{10} - 8^{10} - 5^{10} + 4^{10}}{9^{10}} = 0.689553827....$

Thus $\lfloor 1000*P \rfloor = \boxed{689}.$