Answer:
It’s the number of ways N people can be arranged in a straight line without restriction minus the number of arrangements in which the 2 people are together.
The number of ways N people can be arranged in a straight line without restriction = N!
The number of arrangements in which the 2 people are together = the number of possible positions for the left-hand person multiplied by the number of people who can be that person, multiplied by the number of possible arrangements for the other N - 2 people
= (N - 1) * 2 * (N - 2)!
= 2 (N - 1)!
So the number of ways N people can be arranged in a straight line if 2 particular people must be separated = N! - 2(N - 1)!