# In how many ways you can form $6$-digit numbers using the digits $0, 1, 2, 3,$ and $4$ with exactly two digit $4$ in each number?

In how many ways you can form $$6$$-digit numbers using the digits $$0, 1, 2, 3,$$ and $$4$$ with exactly two digit $$4$$ in each number?

I am trying to solve this problem using combination.

I think (but not that sure) we can calculate the total number of 6-digit numbers as follows

$$_6C_2 × 4 × 4 × 4 × 4$$ = $$8,256$$

I am confused on how I can consider in the calculation that the digit 0 is not allowed to be in the hundred thousands digit.

Any comment and suggestion will be much appreciated. Thank you in advance.

• Place the two $4's$. Break into two cases according to whether the first digit is $4$ or not.
– lulu
Nov 1, 2020 at 11:51
• You can allow $0$ everywhere to get $_6 C_2 \cdot 4^4 = 3840$, then subtract from it all such numbers that have $0$ at the front digit $_5 C_2 \cdot 4^3 = 640$, to get the final result of $3200$. Nov 1, 2020 at 12:06
• Must all digits be used? Nov 1, 2020 at 12:55

First, forget about zero. You have to pick two of the six places for two digits 4. You can do that in $$\binom62$$ different ways. The rest can be filled with 0, 1, 2, 3 in $$4^4$$ different ways so the total number of possiblities is:

$$\binom 62 4^4$$

However we have to eliminate all numbers starting with zero. If you fix 0 in the first place, it's like asking how many 5-digit numbers we can create with two digits 4, plus digits 0,1,2,3. By using similar reasoning, you can pick $$\binom52$$ positions for $$4$$ and you can fill the rest in $$4^3$$ different ways:

$$\binom52 4^3$$

So the result is:

$$\binom 62 4^4-\binom52 4^3$$

• Why $4^4$ ways for the rest? Don't you use all digits? Nov 1, 2020 at 12:57
• @Bernard Number of fours must be exactly two. The remaining places can be filled with digits 0,1,2,3 only. You cannot use additional fours.
– Saša
Nov 1, 2020 at 13:25
• I meant – don't you have to use all digits 0,1,2,3 in the remaining places? Nov 1, 2020 at 13:28
• I have a sneaking suspicion that each specified digit except 4 is to be used only once. Else why should 0,1,2,3 and two 4's add up to six digits ? Nov 1, 2020 at 14:03