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.
 A: 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}$$
A: As Arthur said in his comment, the following conditions are necessary -
1) The unit's digit cannot be even. It has to be 1,3,5,7 or 9.
2)Atleast one of the numbers should have 5 in it's unit place.
$10^n$ gives the total cases. (Note that we are only counting the possibilities of the unit digit).
Now $5^n$ gives the total cases satisfying condition 1. From these cases, subtracting those cases which contain only 1,3,7,9 as unit digit will give the total no. of ways. (Because there has to be atleast one number with 5 in it's unit digit. All cannot be 1,3,7 or 9)
So this gives $5^n - 4^n$ as the total cases and hence the probability is $\frac{5^n - 4^n}{10^n}$
A: using Bayes theorem, we can find P(A) then P(B|A) in order to get P(B and A)
A = all numbers odd
B = greater than 0 of the numbers end in 5
$P(A) = (1/2)^n$
if we are given A, then the probability the last digit is 5 for any number is 1/5
$P(B|A) = 1 - (4/5)^n $
$P(B|A) = P(A \cap B) / P(A)$
$P(A \cap B) = P(B|A) P(A)$
$ =  (1/2)^n(1−(4/5)^n)$
$ = (1/2)^n - (4/10)^n$
$ = (5/10)^n - (4/10)^n$
$ = (5^n - 4^n)/10^n$
A: The probability that we throw from $\{1,3,5,7,9\}$ is $\left(\frac{5}{10}\right)^n$.
The probability that we throw from $\{1,3,7,9\}$ is $\left(\frac{4}{10}\right)^n$.
The probability that we throw from $\{1,3,5,7,9\}$ and not  $\{1,3,7,9\}$ is $\left(\frac{5}{10}\right)^n-\left(\frac{4}{10}\right)^n$.
