Finding out probability that the last digit of a product is 5 
If $n$ positive integers taken at random are multiplied together, show that the probability that the last digit of their product is 5 is $$\frac{5^n-4^n}{{10}^n}$$

My attempt:
Let $n$ positive integers be $x_1,x_2, \cdots ,x_n$. Let $a=x_1 \cdot x_2 \cdots x_n$. Let $S$ be the sample set. Then $n(S)=10^n$ since there are 10 possibilities for unit digit of each integer. I couldn't proceed from there. Please help me in this regard. Thanks.

For the last digit to be a 5:


*

*all numbers must end in an odd digit $(A)$

*at least one of the ending digits must be a 5 $(B)$


$$\mathsf P(A)=\left(\frac5{10}\right)^n$$
$$\mathsf P(B^\complement\mid A)=\left(\frac45\right)^n$$
Therefore 
$$\mathsf P(B\mid A)=1-\left(\frac45\right)^n$$
$$\mathsf P(A\cap B)=\left(1-\left(\frac45\right)^n\right)\left(\frac5{10}\right)^n=\left(\frac5{10}\right)^n-\left(\frac4{10}\right)^n=\frac{5^n-4^n}{10^n}$$
