How many $n$-digit decimal sequences (using the digits $0 = 9$) are there in which the digits $1$, $2$ and $3$ all appear?

$\begingroup$

I feel the answer should be $nC3 \times 3! \times 10^{n-3}$.

$\endgroup$ 4

1 Answer

$\begingroup$

The number of $n$ digit sequences is $10^n$. The number missing $1$ is $9^n$, so we would subtract $3\cdot 9^n$ to remove the ones missing $1, 2, \text { or }3$, but now we have removed the ones missing $1$ and $2$ (or any other pair) twice so we have to add back in $3 \cdot 8^n$. Now the ones missing all of $1,2,3$ have been removed three times and added back three times, so we subtract them once more. Finally we have $10^n-3\cdot 9^n + 3 \cdot 8^n-7^n$. This is known as the inclusion-exclusion principle

$\endgroup$

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like