Probability that the last digit of the product is zero I tried much in this problem but I didn't get my answer correct.
The question is-----
If n positive integers taken at random are multiplied together ,show that the probability that the last digit of the product being zero is $$\frac{10^n-8^n-5^n+4^n}{10^n}$$
My attempt ----
Case 1--when at least one of $x1,x2,\cdots,xn$(let it be n positive integers taken at random) has zero in its unit place.
$$P(\overline{A}) = \frac{9^n}{10^n}$$
$$P(A) = 1- \frac{9^n}{10^n}$$
Case 2----when zero doesnot occur and at least one five occurs in any of the unit place of positive integers taken at random. Also at least one of (2,4,6,8) comes.
Let $\overline{B}$---there is no five.
$P(\overline{B} \mid \overline {A}) =\frac{8^n}{9^n}$
$P(B \mid \overline {A}) =1-\frac{8^n}{9^n}$
Let C----there is no (2,4,6,8)
$P(\overline{C} \mid B \mid \overline {A}) =\frac{5^n}{9^n}$
$P(C \mid B \mid \overline {A}) =1-\frac{5^n}{9^n}$
This gives me $P(\overline{A}\cap B \cap C) =P(\overline{A})P(B \mid \overline{A}) P(C \mid B \mid \overline{A})$.this doesn't give me the desired result.
I don't understand where I have made mistake.please help me in this regard.
Thanks.
 A: you are working too hard.
At least one is even: $(1-(\frac 12)^n)$
At least one divisible by 5: $(1-(\frac 45)^n)$ 
(At least one is even) and (at least one divisible by 5)... and they could be the same number.
$(1-(\frac 12)^n)(1-(\frac 45)^n)) = 1 - (\frac 12)^n - (\frac 45)^n + (\frac 4{10})^n = \frac {10^n - 5^n - 8^n + 4^n}{10^n}$  
A: There is no such thing as "positive integers taken at random", i.e. no uniform distribution on the positive integers.  However, in this case you're really only interested in the values mod $10$, so you may assume your integers are chosen from $\{0,\ldots, 9\}$, independently and with equal probabilities.
The last digit of the product is $0$ in the following cases:


*

*At least one number is $0$.

*At least one number is $5$ and at least one number is even.


Let $A$ be the event that at least one is $0$, $B$ that at least one is $5$ and $C$ that at least one is even.  Note that $A \subset C$.  You want 
$$\mathbb P(A \cup (B \cap C)) = \mathbb P(B \cap C) + \mathbb P(A \cap B^c)$$
$$\eqalign{\mathbb P(B \cap C) &=  \mathbb P(B) + \mathbb P(C) - \mathbb P(B \cup C)\cr
&= 1 - \mathbb P(B^c) - \mathbb P(C^c) + \mathbb P(B^c \cap C^c) \cr
&= 1 - (9/10)^n - (5/10)^n + (4/10)^n}
$$
Similarly,
$$ \eqalign{\mathbb P(A \cap B^c) &= \mathbb P(B^c) - \mathbb P(A^c \cap B^c)\cr
&= (9/10)^n - (8/10)^n}$$
So the answer is 
$$1 - (5/10)^n + (4/10)^n - (8/10)^n $$
A: I am gonna do it in the subtraction way, which is calculating P（last digit not 0）.
Let S={1,2,3,4,5,6,7,8,9,0}. We are picking $n$ numbers in set S, because the only digit that matters is the last digit of a chosen number. 
First of all, there are $10^n$ ways in total.
Case1:
If we choose from S\{0,5}, apparently $8^n$ ways.
Case2:
If we choose from S\{2,4,6,8,0}, $5^n$ ways.
Note while we are doing case2, S\{2,4,6,8,0,5} is a subset of S\{2,4,6,8,0} and S\{0,5}, so we've been calculating this subset twice. Now we need to compensate for that, which is $4^n$ ways.
In conclusion,
P(last digit not zero)=$\frac{8^n+5^n-4^n}{10^n}$ 
Hopefully it could help you.
