How many numbers of 4 digits have at least three specific digits

combinatoricspermutationsprobability

The question I tried to solve goes like this:

How many 4-digit numbers have at least one digit $2$, one digit $3$ and one digit $4$?

I saw it as simple as this (because it's exactly 4 digits):
The number will have a $2$, a $3$, a $4$ and $X$.

So the solution I thought would be is:

$$3 \cdot 2 \cdot 1 \cdot 10 = 60 $$

$X$ could be any digit of the $10$ digits.

However, this also includes numbers that start with $0$. This can't count so I remove $6$ because of

$$0234,0324,0342,0432,0243,0423$$

so the solution would be $54$.

However, this isn't at all the solution. What am I missing?

Best Answer

Here is an other way to evaluate the number of possibilities. We will condition on the fourth number we have

Case: $0$

If the fourth number is $0$, it can't ne in the first position. It has three places where it can go. Next we put the $4$ (three remaining places), etc. This gives us $$3\times3\times2\times1=18\tag1$$

Case: $1,5,6,7,8,9$

There are six choice for the number and four places to put it. Then, we put the $4, 3$ and $2$ as before. This gives us $$6\times4\times3\times2\times1=144\tag2$$

Case: $2,3,4$

We now have a repeated number. First we chose which one is repeated (three choices) and where to put them, $4\choose2$. Finally, we put the remaining numbers. This gives us $$3\times{4\choose2}\times2\times1=36\tag3$$ There are $18+144+36=198$ such numbers.

Hope it helps


You could also find the same result starting with you reasoning. Starting with $$3\times2\times1\times10$$ You counted nombre of the form $3245$ but not $5324$. The fourth digit you chose was always the last digit of the number. You need to add a $\times4$ to choose where you put the last digit. $$3\times2\times1\times10\times4=240$$ Now we counted numbers starting with $0$, we need to remove them ($6$ cases). Also, if the fourth number was a $2$, it was counted twice. $234(2)$ is the same as $(2)342$ where $(2)$ represents the fourth digit. So we need to remove the number where the fourth digit is $2,3$ or $4$. ($36$ cases).

This bring us back to $240-6-36=198$ possibilities.

Related Question