Formation of a 7 digit number using 3 digits with given condition

3.3k Views Asked by At

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?

My Attempt:
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?

2

There are 2 best solutions below

3
On

You forgot to subtract the numbers in which 2 appears three or more times. Here is a correct approach:

  • Select the locations of the 2s: $\binom72=21$ ways
  • Fill the remaining five slots with 1s and 3s: $2^5=32$ ways

Hence there are $21\cdot32=672$ admissible numbers.

0
On

The 7-digit number has exactly two digits $2$.

Let's say the number is $\overline{22cdefg}$; $\overline{2b2defg}$; $\overline{2bc2efg}$;...

The number of cases we can put exactly two digits (out of $7$ digits) are $2$ is: $6+5+4+3+2+1=21$ cases.

For each case, the remaining $5$ digits can be either $1$ or $3$, so the number of ways for each case is: $2^5=32$ ways.

The number of favorable numbers is: $21 \times 32 =672$ numbers.