How do you get a list of tuples in Mathematica that do not include certain pairs of elements? For example, I'm trying to list sequences of matrices of a certain length, and I do not want two adjacent elements in the sequence to be inverses of each other.
I suspect the code will end up looking like:
DropCases[Tuples[{a, b, Inverse[a], Inverse[a]}, 6], ???]
How do I do this in Mathematica?
Thanks!