In how many different ways can four students stand in a straight line if two of the students refuse to stand next to each other?
I will assume the students are distinguishable and 'a' and 'b' will not stand next to each other...
a - - b
b - - a
a - b -
b - a -
- a - b
- b - a are six ways for a and b NOT to be next to each other.
There are tow ways EACH for c and d to fill in the blanks for each of these six ways
6 x 2 = 12 ways