How many four-digit numbers can be formed from the digits $0,1,2,3,4,5$ with repetition if it contains exactly $3$ different digits?
My attempt: First let me choose $2$ numbers from the six numbers $6C2$.
Then I arrange it in any $2$ places out of $4$. $4P2$
Then I chose any one of the two numbers to fill other places $2C1$.
I have to subtract the cases where zero comes in first place.
So let me choose any other digit along with zero as two distinct digits. $5$ ways.
Then I arrange them such that $0$ is in first place. Then for remaining $3$ digits, I can have $2$ zeroes or $1$ zeroes or $0$ zeroes or $3$ zeroes. So number of ways of doing this is $3! \times 3!$ ways. Subtracting these two main cases, I get $180$. But ans is given as $175$. Where I am wrong?
If exactly three distinct digits appear in a four-digit number, one digit must appear twice and two other digits each appear once.
Method 1: We consider two cases, depending on whether or the leading digit is repeated.
The leading digit is repeated: Since the leading digit cannot be zero, it can be chosen in five ways. Choose in which of the other three places that digit appears. Choose which of the five remaining numbers (as we can now use zero) appears in the first open position, then which of the four remaining numbers appears in the final open position. There are $5 \cdot 3 \cdot 5 \cdot 4$ such arrangements.
The leading digit is not repeated: Since the leading digit cannot be zero, it can be chosen in five ways. Choose which of the five remaining numbers appears twice. Choose two of the remaining three positions for that digit. Choose which of the remaining four numbers appears in the final open position. There are $5 \cdot 5 \cdot \binom{3}{2} \cdot 4$ such arrangements.
Total: Since the two cases are mutually exclusive and exhaustive, the number of admissible arrangements is found by adding the above numbers, which yields $$5 \cdot 3 \cdot 5 \cdot 4 + 5 \cdot 5 \cdot \binom{3}{2} \cdot 4 = 600$$ As JMoravitz indicated in the comments, the stated answer of $175$ is incorrect for the stated problem.
Method 2: We subtract the number of four-digit strings in which exactly three digits appear and the leading digit is zero from the number of four-digit strings in which exactly three digits appear.
We first count the number of four-digit strings in which exactly three digits appear. Choose the repeated digit. Choose in which two of the four positions it appears. Choose which of the five remaining digits appears in the first open position, then choose which of the four remaining digits appear in the second open position. There are $$6 \cdot \binom{4}{2} \cdot 5 \cdot 4$$ such strings.
From these, we subtract those in which the leading digit is $0$. There are two cases, depending on whether the digit $0$ is repeated.
Four-digit strings with exactly three distinct digits in which the leading digit is $0$ and the leading digit is repeated: Place a $0$ in the leading position. Choose in which of the other three positions $0$ appears. Choose which of the other five numbers fills the first open position, then choose which of the other four numbers fill the final open position. There are $3 \cdot 5 \cdot 4$ such arrangements.
Four-digit strings with exactly three distinct digits in which the leading digit is $0$ and the leading digit is repeated: Place a $0$ in the leading position. choose which of the other five digits is repeated. Choose two of the three remaining positions for that digit. Choose which of the remaining four numbers fill the remaining open position. There are $5 \cdot \binom{3}{2} \cdot 4$ such arrangements.
Therefore, the number of admissible arrangements is $$6 \cdot \binom{4}{2} \cdot 5 \cdot 4 - 3 \cdot 5 \cdot 4 - 5 \cdot \binom{3}{2} \cdot 4 = 600$$
Notice that both methods agree with the answer obtained by JMoravitz in the comments.
To see where you went wrong, compare your steps with those I outlined in my second method.