In how many difference ways can six players be arranged in a line such that two of them, Abhinav and Manjesh are never together? here is my attempt
since we have six persons so the total number of way of arranging six persons in a line is $6!$ 
now since 'Abhinav' and 'Manjesh' is saying never together so we can subtract the total number of way of arranging 'Abhinav' and 'Manjesh' together.
 so the total number of ways we can do this is $6! - 5!2! = 480.$
but the actual answer is $\frac{ 6!}{2!}= 360.$
can anybody advise on this question where I am wrong?
any effort is appreciatable.
 A: Alternatively:
$$A \ \ \_ \ \ \_\ \ \_\ \ \_\ \ \_ \Rightarrow 4\cdot 4!\\
\_ \ \ A \ \ \_\ \ \_\ \ \_\ \ \_ \Rightarrow 3\cdot 4!\\
\_ \ \ \_ \ \ A \ \ \_\ \ \_\ \ \_ \Rightarrow 3\cdot 4!\\
\_ \ \ \_ \ \ \_ \ \ A \ \ \_\ \ \_ \Rightarrow 3\cdot 4!\\
\_ \ \ \_ \ \ \_ \ \ \_ \ \ A \ \ \_ \Rightarrow 3\cdot 4!\\
\_ \ \ \_ \ \ \_ \ \ \_ \ \ \_ \ \ A \Rightarrow 4\cdot 4!\\$$
Hence:
$$2\cdot (4\cdot 4!+3\cdot 4!+3\cdot 4!)=20\cdot 24=480.$$
A: I agree with your solution, indeed let consider


*

*the overall permutations $6!$

*the configurations to be excluded $2\cdot 5 \cdot 4!$
that is
$$6!-2\cdot 5 \cdot 4!=720-240=480$$
We can also derive the result as follow


*

*we can arrange A&M such that they never are together in $2\cdot (4+3+2+1)=20$ ways

*for each configuration we can arrange the others in $4!=24$ ways
therefore 
$$20\cdot 24 =480$$
A: I got one more way to answer this question
we have to arrange six people in a line where A&M are never together so what we will do is we will separate A&M alone so we will rest with 4 people 
              - - - -

assume these are the 4 places where 4 people have to be arranged so this could be done in 4!. 
now we will use the gap method since we have 4 people so there would be 5 gaps in between 4 people now we can select 2 gaps out of 5 gaps at a time to allocate to A&M respectively and this could be done in 5C2 2!
so the total number of ways would become 
         4! 5C2 2! = 480
A: If you know how to program, you could brute-force it as a sanity check. A Python example:
from itertools import permutations

players = ['A','B','C','D','E','F']

valid_perms = [p for p in permutations(players) if abs(p.index('A') - p.index('B')) > 1]
print(len(valid_perms)) #prints 480

