[Math] Combination of 4 digits 1 digit is repeated

combinationsprobability

Im trying to get how many 4 digit integers can we get if we have exactly 2 similar integers.

My attempt till now is that we can have 6 combinations for the repeated digits:
d1d2, d1d3, d1d4, d2d3, d2d4, and d3d4.

so we can have 6.(10.9.8) numbers
I still need to subtract the numbers that have zero as the 1st digit inorder not to be a 3-digit number.
so if zero is the first digit we have 1.10.9 possibilities. Shall I multiply this number by 6 or not.

I can feel that im missing something.

Best Answer

What you want to subtract instead are the counts of three-digit strings with one $0$ and two other distinct digits and those with a repeated digit but no $0$. The final answer is

$$(6\cdot10\cdot9\cdot8)-(3\cdot9\cdot8)-(3\cdot9\cdot8)$$