Number of 10-digit integers that have at least 3 different digits

482 Views Asked by At

I want to know how many 10-digit integers have at least 3 different digits, if leading 0 is not allowed.

Ideally this question would help me learn the inclusion-exclusion principle. So I started with all the possible 10-digit integers, then tried to subtract those 10-digit numbers with the same digit, and also subtract those 10-digit numbers that have only 2 distinct digits.

$ (9 * 10^9) - 9 - (9 * \binom{9}{1} 1^9) $

But I am not sure about my representation of the third term, or if there is any overlap between the sets of "only 1 distinct" and "only 2 distinct" that would make it necessary to add something back.

1

There are 1 best solutions below

0
On

There are $9$ options for the first digit. Then there are $10^9$ options for the remaining digits, of which $1$ consists only of the first digit and $\binom91(2^9-1)$ contain exactly one other digit, so the total is

$$ 9\left(10^9-1-9\left(2^9-1\right)\right)=8999958600\;. $$