# 6 digit number with digit(0-9) precisely 4 or 5 different digits

I just want to be sure if i'm right so i have:

For 4 digits:

• $C(10,4) = 210$- to get number of combinations of 4 different digits
• 1 digit repeat 2 more times - $C(4,1) = 4$
• number of other combinations -$P*(3,1,1,1) = 120$

• 2 digit repeats 1 more time - $C(4,2) = 6$

• number of other combinations - $P*(2,2,1,1) = 180$

Total number of 4 different digits : $(210+4)*120+(210+6)*180 = 64560$

For 5 dif. digits

• $C(10,5) = 252$ - to get number of combinations of 5 different digits
• 1 digit repeat 1 more times -$C(5,1) = 5$

• number of other combinations -$P*(2,1,1,1,1) = 360$

Total number of 4 different digits : $(252+5)*360=92500$

at the and because of The OR i have to sum up for 4 and for 5 diff digits right ? :)

## 1 Answer

There is the complication that (perhaps) the first digit is not allowed to be $0$. The usual conventional meaning of $6$-digit number does not include $001123$.

Suppose that we count the number of choices where initial digit $0$ is allowed. If the count is $N$, then the count where initial digit $0$ is not allowed is $\frac{9}{10}N$.

Your basic procedure for finding $N$ is good, but there are mistakes at the end. For example, the number for exactly $4$ should be $$\binom{10}{4}\left(\binom{4}{1}(120)+\binom{4}{2}(180) \right).$$

• well 0 is alowed :) and this actualy make sense :) thx you a lot and for 5 should be same but C(10,5) * ( C(5,1)*360) right ? – Kasik Dec 6 '15 at 19:10
• Yes, your expression for exactly $5$ is right, it is simpler than $4$. I left just the correct expression for $4$, without justification, in the expectation that seeing it would be enough for you to figure things out. – André Nicolas Dec 6 '15 at 19:15
• thx you a lot it helped me :) – Kasik Dec 6 '15 at 19:17