The letters A,B,C,D can be arranged in ways.
Total possible ways of arranging the letters are
In order to calculate neither a and b nor c and d come together,first we have to see the cases when they do come togther
So we take a and b as a single element,due to which the total elements are now 3
3 letters can be arranged in
ways and a and b itself can be arranged in
.
Cases when a and be are together can be arranged in ways
ways
Similarly for the case when c and d are together i.e, 12 ways.
Now the case when a and b and c and d are together,the case becomes
ways
So the total number of ways when neither of them are together are
Hence there are 8 number of ways when letters a b c and d can be arrange in which neither of them are together.