Explanation:
normally, for the possibilities of 6 people lining up we would have the permutations of 6 elements.
for the first we have 6 choices, for the second then only 5, for the third 4, for the fourth 3, for the fifth 2 and for the sixth then only one remaining choice.
that is
6! = 6×5×4×3×2×1 = 720
now in our special case, 2 people do not want to stand next to each other in the line.
there are many ways to model this.
my favorite would be to first take one of these two enemies out, and we line up the 5 remaining people without any problems.
that is 5! = 5×4×3×2×1 = 120
and now, for each of these 120 possibilities I mix in the 6th waiting person. I can't put him in front or behind his enemy. that leaves me with 4 choices for each of the 120 possibilities.
so, we have exactly
120×4 = 480 possible ways to line them up.
4 decimal places : 480.0 or 4.800 × 10²