How many 4 digit number can be formed by using 1,2,3,4,5,6,7 if at least one digit is repeated My approach for this was selecting 4 numbers from which one is being repeated


$$\boxed{A}\boxed{B}\boxed{C}\boxed{A} $$
$$\boxed{A}\boxed{B}\boxed{A}\boxed{A} $$
$$\boxed{A}\boxed{A}\boxed{A}\boxed{A} $$
and permitting them which gives 7$C_4$×4!/2! +7$C_4$×4!/3!+7$C_4$×4!/4! Since 2,3,4 no. Are being repeated numbers are being repeated


What they have done is
$7^4$-7$P_4$ subtracting cases where all 4 no. Are different from total cases. I agree but what is the flaw in my method

The quick way
$$7^4 - \left[\binom{7}{4} \times 4!\right].$$
The hard way:
$$S_1 + S_2 + S_3 + S_4.$$
$S_1 = 7 =$ # ways all 4 numbers the same.
$S_2 = 7 \times 6 \times 4 =$ # ways 3 numbers the same.
$S_3 = \binom{7}{2}\times\binom{4}{2} =$ # ways of having two pairs of numbers.
$S_4 = 7 \times \binom{6}{2} \times 4 \times 3 =$ # of ways of having 2 of one number and two other numbers.
