[Math] Permutation of 6-digit numbers without repetition

combinationsdiscrete mathematicspermutations

How many 6-digit numbers without repetition of digits are there such that
a ) the digits are all non-zero
b ) 1 and 2 do not appear consecutively in either order ?

Calculated the answer as below
I : number of 6-digit numbers such that all digits are non-zero is
p(9,6)
II : number of 6-digit numbers in which 1 and 2 do not appear consecutively in either order is
7 * p(4,2)
Final answer would be p(9,6)7 * p(4,2) = 60936

But the answer is 52080.How come?

Best Answer

The digits are all non-zero:

  • Choose $6$ symbols from $\{1,2,3,4,5,6,7,8,9\}$ and permute them: $\binom{9}{6}\cdot6!=60480$

$1$ and $2$ do not appear consecutively in either order:

  • Choose $4$ symbols from $\{3,4,5,6,7,8,9\}$, add $12$ and permute them: $\binom{7}{4}\cdot5!=4200$
  • Choose $4$ symbols from $\{3,4,5,6,7,8,9\}$, add $21$ and permute them: $\binom{7}{4}\cdot5!=4200$

Finally, subtract the sum of the latter from the former: $60480-(4200+4200)=52080$