The number of different 7 digit numbers that can be written using only three digits $1,2,3$ under the condition that the digit 2 occurs exactly twice in each number is?
Total number of digits possible = $3^7$
Then, I would subtract all the digits with no or single 2 occurrences.
No. digits in which no 2 occur is $2^7$
No. digits in which 2 occur once is $\binom712^6$
So total unfavorable numbers are $2^7+\binom712^6$
So total favorable numbers are $3^7 - 2^7-\binom712^6$
However, when solved, this turns out to be a wrong answer.
Can anyone help?