# Probability that a random k-digit number contains at least one 0, 1, and 2

• Sep 23rd 2010, 06:51 AM
Runty
Probability that a random k-digit number contains at least one 0, 1, and 2
Let $k\geq 3$ be any given integer. What is the probability that a random k-digit number will have at least one 0, at least one 1, and at least one 2?

I'm thinking that this could be answered via the principle of inclusion-exclusion, but I could use some clarification (or possible correction). Here's what I've got so far.

Assuming that leading zeroes are not allowed,
# of k-digits containing no 0’s: $9^k$
# of k-digits containing no 1’s: $8×9^{k-1}$
# of k-digits containing no 2’s: $8×9^{k-1}$
# of k-digits containing no 0’s and no 1’s: $8^k$
# of k-digits containing no 0’s and no 2’s: $8^k$
# of k-digits containing no 1’s and no 2’s: $7×8^{k-1}$
# of k-digits containing no 0’s, 1’s or 2’s: $7^k$

I then applied the following:
$|A\cup B\cup C|=|A|+|B|+|C|-|A\cap B|-|A\cap C|-|B\cap C|+|A\cap B\cap C|$
This would obtain the complement set of what I'm looking for, so this would be subtracted from $9×10^{k-1}$.

Am I on the right track?
• Sep 23rd 2010, 07:10 AM
Traveller
You are.
• Sep 27th 2010, 12:37 PM
Runty
Thanks for confirming that.

I currently have the answer written out as follows:
$P=(9×10^{k-1} )-[9^k+2(8×9^{k-1})-2(8^k)-(7×8^{k-1})+7^k]$
This probably isn't the cleanest way to show the answer. Is there a more condensed version I could use?
• Sep 29th 2010, 11:21 AM
Traveller
There is probably no shorter formula for this case.