[Math] How many 5 digit numbers can be formed using digits 1,2,3 with exactly one digit repeating 3 times.

combinatorics

Q: How many 5 digit numbers can be formed using digits 1,2,3 with exactly one digit repeating 3 times.

Ans: We can choose the digit that repeats in 3c1 ways. The remaining two digits in the 5 digits number can either be same or different. If they are same, there are 2 ways of choosing the digit. In total there would be:

3c1 * ( 2* 5!/(2!*3!) + 5!/(3!)) = 120.

But the answer is 90. Can some one please explain how.

Best Answer

Let´s assume that we don´t have to use all digits 1,2 and 3 to form the number. We define $X,Y,Z\in \{1,2,3 \}$

Case 1: Two different groups of digits, where each group consists of one kind of number.: $XXXYY$

These sequence can be arranged in $\frac{5!}{3!\cdot 2!}=\frac{120}{12}=10$ ways.

$X$ and $Y$ can have the following combinations: $(1,2);(2;1);(1,3);(3,1);(2,3);(3,2)$

Thus for case 1 we have $6\cdot 10=60$ ways.


Case 2: Three different groups of digits where each group consists of one kind number and one group has 3 digits: $XXXYZ$. This sequence can be arranged in $\frac{5!}{3!\cdot 1!\cdot 1!}=\frac{120}{6}=20$ ways.

$X,Y,Z$ can have $3$ combinations and for case 2 there exists $60$ ways.

Finally we can say that $120$ five digit numbers can be formed using digits 1,2,3 with exactly one digit repeating 3 times.