In how many ways can $6$ students be seated in a row of $9$ seats if a certain $3$ students refuse to sit next to each other? In how many different ways can $6$ students be seated in a row of $9$ seats if a certain $3$ students* Alvin, John and Albert refuse to sit next to each other?
*No two of them are adjacent.
My attempt,
$(9P6 - 9P4)*3!=344736$ 
Is it correct?
 A: First, you have to choose seats for the three quarrelling students, e.g. $$101010000$$
One way of doing that is to think of each unfriendly student as $\boxed{10}$ and other empty seats as $\boxed{0}$: $$\boxed{10}\boxed{10}\boxed{10}\boxed{0}\boxed{0}\boxed{0}(0)$$
I've added an extra fake seat at the end so that the ninth seat can be occupied.
Because this is a rearrangement in a line of three objects of one kind and four of a different kind, the number of seating arrangements for the three students is $$\binom73=35$$
Now, multiply that by:


*

*the number of ways that Alvin, John and Albert can be assigned to those seats

*the number of ways that the other three students can sit down in the empty places (one at a time).



An alternative solution using inclusion-exclusion. Without the restrictions, there are $\frac{9!}{3!}$ seating arrangements.
Let $X$ be the set of arrangements in which Alvin sits next to John, $Y$ the set of those in which John sits next to Albert, and $Z$ the set of those in which Alvin sits next to Albert.
Consider $X$. There are $2\cdot8=16$ ways that Alvin can sit next to John, and then $7\cdot6\cdot5\cdot4$ ways for everyone else to sit down. Multiplying, we find $|X|=8!/3$ and similarly $|Y|=|Z|=8!/3$.
Now consider $X\cap Y$. There are $2\cdot7=14$ ways that Alvin, John and Albert can sit in line, and then $6\cdot5\cdot4$ ways for everyone else to sit down. Thus $|X\cap Y|=|Y\cap Z|=|X\cap Z|=7!/3$.
Finally, $X\cap Y\cap Z=\emptyset$ so $|X\cap Y\cap Z|=0$.
Putting it all together, the answer is $\frac{9!}{3!}-8!+7!$
A: For simplicity say you have 6 different students and 3 identical moreporks, there's a total of 
$$
\binom{9}{3}6! =S_1
$$
ways to seat them together. Now you need to subtract the number of ways at least 2 conflicting students can sit together, that's 
$$
8 \times 2! \binom{3}{2} \binom {7}{3} 4! = S_2
$$
but here you have overcounted the number of ways all three bad students sit together:
$$
7 \times 3! \binom{6}{3} 3! =S_3
$$
So the final solution is $S_1 -S_2 +S_3$
A: Method 1:  We begin by arranging three blue balls and three red balls in a row.  There are $\binom{6}{3}$ such arrangements since we must choose which three of the six spaces will be occupied by the blue balls.  This creates seven spaces in which we can place three green balls, five spaces between successive balls and two at the ends of the row.  For instance, 
$$\square \color{red}{\bullet} \square \color{blue}{\bullet} \square \color{blue}{\bullet} \square \color{red}{\bullet} \square \color{blue}{\bullet} \square \color{red}{\bullet} \square$$
We now wish to insert three green balls so that no two of them are adjacent. To do so, we must choose three of these seven spaces, which can be done in $\binom{7}{3}$ ways.  One such arrangement is 
balls and two at the ends of the row.  For instance, 
$$\color{green}{\bullet} \color{red}{\bullet} \color{green}{\bullet} \color{blue}{\bullet} \color{blue}{\bullet} \color{green}{\bullet} \color{red}{\bullet} \color{blue}{\bullet} \color{red}{\bullet}$$
The green balls represent the positions that can be occupied by Alvin, John, and Albert; the blue balls represent the positions of the other three people; the red balls represent the positions of the three unoccupied seats.  We can arrange Alvin, John, and Albert in the places occupied by green balls in $3!$ ways.  We can arrange the remaining three people in the positions occupied by the blue balls in $3!$ ways.  
Consequently, the number of permissible seating arrangements is 
$$\binom{6}{3}\binom{7}{3}3!3!$$
Method 2:  We use the Inclusion-Exclusion Principle.  
There are $\binom{9}{3}$ ways of choosing the locations of the empty seats and $6!$ ways of arranging the six people in the remaining seats.  From these seating arrangements, we must exclude those arrangements in which the three students who do not wish to sit in adjacent seats sit in adjacent seats.
If two of Alvin, John, and Albert sit together, we have eight objects to arrange, the pair of seats in which we will place those students, the three empty seats, and the other four students.  There are $\binom{8}{3}$ ways to choose three of the eight positions for the empty seats, $\binom{3}{2}$ ways to choose two of the three students to sit together, $5!$ ways to arrange the remaining objects, and $2!$ ways to arrange the pair of chosen students in the designated pair of seats.
$$\binom{8}{3}\binom{3}{2}5!2!$$
Subtracting this from the total removes those cases in which all three students sit together twice, once when we designate the leftmost two students as the pair and once when we designate the rightmost two students as the pair.  Since we only wish to exclude these arrangements once, we must add them back.
If all three students sit together, we have seven objects to arrange, the three empty seats, the trio of seats occupied by Alvin, John, and Albert, and the other three people.  We can select three of these seven positions for the empty seats in $\binom{7}{3}$ ways.  We can arrange the remaining four objects in $4!$ ways.  We can arrange Alvin, John, and Albert within the designated trio of seats in $3!$ ways.  Hence, the number of seating arrangements in which Alvin, John, and Albert sit together is 
$$\binom{7}{3}4!3!$$
By the Inclusion-Exclusion Principle, the number of permissible seating arrangements is 
$$\binom{9}{3}6! - \binom{8}{3}\binom{3}{2}5!2! + \binom{7}{3}4!3!$$   
A: Assume WLOG that  


*

*the other $3$ students are girls $G_1, G_2, G_3$  (distinguishable)

*the $3$ named boys are $B_1, B_2, B_3$ (distinguishable)

*there are $3$ chairs (indistinguishable) for boys, each labelled $b$.

*there are $6$ chairs (indistinguishable ) for girls, each labelled $g$, of which only $3$ will be occupied


First arrange the chairs.
First separate the $3$ $b$'s by inserting one $g$ in between each pair, i.e. 
$$b\;g\;b\;g\;b\\$$ 


*

*Number of ways: $1$ 


Next insert the remaining $4$ $g$ on either side of the $b$'s. This is equivalent to the stars-and-bars problem.  


*

*Number of ways:$\binom {4+3}3=\binom 73$


Now pick $3$ $g$'s out of the $6$ to be seated by $3$ girls.  


*

*Number of ways: $\binom 63$


Then place the students. 
First place the $3$ $B_i$'s $ (i=1,2,3)$ in the $3$ $b$'s. 


*

*Number of ways: $3!$  


Next place the $3$ $G_j$'s $ (j=1,2,3)$ in the $3$ chosen $g$ seats:  


*

*Number of ways: $3!$


Finally, calculate total number of ways
Total number of ways of seating all students without the three boys next to each other is
$$1\cdot \binom 73\binom 63 \cdot 3!\cdot 3!=25200$$
