How many 6-digit numbers can be formed using {1, 2, . . . , 9} with no repetitions such that 1 and 2 do not occur in consecutive positions?

671 Views Asked by At

I tried to solve it as $2\cdot8\cdot6!$ but I don't think its correct how can satisfy the condition

1 and 2 do not occur in consecutive positions?

3

There are 3 best solutions below

2
On

Well have you ever heard of the stars and bars problem.

So first take two cases:

Case 1:- When both 1 & 2 are not included. $7\choose{6}$$\cdot6!$

Case 2:- When both 1 & 2 are included

https://en.wikipedia.org/wiki/Stars_and_bars_(combinatorics)

Case 3:- When either 1 or 2 is included $8\choose6$$\cdot6!$

2
On

Assuming it's just $1,2$ that is not allowed in consecutive positions in that order, I get:

$$^9P_6 - 5(^7P_4) = 56280$$

This is the number of permutations of $6$ from $9$, minus the number of positions of $1,2$ which is $5$, times the permutations of $4$ from $7$, which is the number of ways the other 4 locations can be filled by the other $7$ numbers.

3
On

I'd just calculate the number of numbers that have either $12$ or $21$ in them, and subtract from the total number of six-digit numbers.

There are five two-digit slots where the $12$ or $21$ can go, and $_7P_4 = 840$ ways to populate the remaining four places with something besides $1$ and $2$. So, $2 \cdot 5 \cdot 840 = 8400$ such numbers.

Subtract these from the $_9P_6$ total ways and you're done.