A husband and wife and their two children line up for a phot
Solution
we need to find how many ways are there for 4 people ti line up such that husband and wife are not next to each other.
consider the letter as below:
Husband = A
 Wife = B
Child 1 = C
Child 2 = D
so we need to find the number of ways we can arrange letter A,B,C,D in a line such that A and B are not next to each other.
we know that we have total 4 letter so all we can arrange them in a line in 4! way.
so we can arrange them in a line in 4! = 4*3*2*1 = 24 ways.
first find the number of ways we can arrange them such that A and B are always next to each other.
so we can say that we have 2 child and 1 pair of husband and wife to line up.
means we have (AB), C ,D means we need to consider AB as one letter.
so we have total 3 letter.
so we can arrange them in a line in 3! = 3*2*1 = 6 ways.
but we know that pair AB can also be in reverse order like BA
means we have (BA), C ,D means we need to consider BA as one letter.
so we can arrange them in a line in 3! = 3*2*1 = 6 ways.
so we can arrange A,B,C,D in 6+6 = 12 ways in a line such that A and B are next to each other.
we have total number of ways we can arrange A,B,C,D in a line = 4! = 24
we have total number of ways we can arrange A,B,C,D such that A nd B are next to each other in a line = 6+6 =12
now if we subtract the number of ways such that A and B are next to each other from total number of ways we can arrange A,B,C,D we will get number of ways such that A and B are not next to each other.
so the number of ways A,B,C,D are line up such that A and B are not next to each other is = 24 - 12 = 12
so we can say that husband and wife with two children can line up in 12 ways such that husband and wife are not next to each other.

