Math Problem : H.4 No pair of two persons

Five people of A,B,C,D,E stand in one line of side.
How many ways of forming line in case A and B should not be side-by-side are there?










Answer
72 ways

Solution
The way of forming line in case A and B should be side-by-side was 4 × 3 × 2 × 1 × 2 = 48 ways as you remember. 
The answer of ways of this problem is calculated by (All ways of forming line) minus (ways of forming line of A and B is side-by-side). 
The number of ways of forming line that A and B should not be side-by-side is 5 × 4 × 3 × 2 × 1 - 48 = 72 ways.