[Math] the probability that a random 6-digit number will have at least one 0, at least one 1, and at least one 2

combinatoricsprobability

Hi this a question from my textbook: A first course in probability, It doesn't have the solution so I'm curious as to what the answer is. This is the question:

What is the probability that a random 6-digit number will have at least one 0, at
least one 1, and at least one 2? (the number can't start with a 0).

$My Answer$

Well is know that all the possible combinations of a 6 – digit number that doesn't start with $0$ is: $9(10^5)$

Next I considered the all the possible combinations of a $6$ – digit number not having at least one 0, at least one 1, and at least one 2 which is $7^6$

so: $1 – 7^6/9(10^5) = 0.87 $

is this correct?

Best Answer

The probability that a number has at least one $1$, at least one $2$, and at least one $0$ is $1$ minus the probability of having no $0$'s, or no $1$'s, or no $2$'s. So, label $A$ as the event "no zeros", $B$ as the event "no ones", $C$ as the event "no twos". You want: $$ 1-P(A\cup B\cup C) =1-\left(P(A) + P(B) + P(C)\right) +\left(P(A\cap B) + P(A\cap C) + P(B\cap C)\right) - P(A\cap B \cap C) = 1-\frac{ 9^6+2\cdot 8\cdot 9^5 }{9\cdot 10^5}+\frac{2\cdot 8^6+7\cdot 8^5}{9\cdot 10^5} -\frac{7^6}{9\cdot 10^5}= \frac{1993}{30000} $$