Background: I am trying to design a scientific trial (computer science dissertation) in which participants will answer 8 questions. There are in fact only 4 questions but each is asked in two different ways, so there are 4 unique correct answers, let's call them a, b, c and d. So the set of correct answers will be {a, a, b, b, c, c, d, d}.
The 8 trial questions must appear in a random order however no question with the same correct answer must appear immediately after the other. So e.g. asking a question with answer a means the next question must not also have answer a.
I would like to produce a list of the permutations of {a, a, b, b, c, c, d, d} that do not repeat in this way. I am trying to write an algorithm for this but I'm having a little trouble with the mathematics. Any help would be greatly appreciated.
Could anyone give me some hints on how to either produce this list or how to reduce the list of 2520 permutations of {a, a, b, b, c, c, d, d} to only contain permutations with my condition?
Thanks.