Let a "pair" be a pair of two boolean values, so $00$, $01$, $10$, or $11$. If I am told to construct an ordered set of these pairs given these constraints (if possible):
I am to use a set of which of the the four possible pairs I can use at each index, so one possible permutation for this constraint would be: "Element one can be $01$ or $11$, two can be $11$ or $01$ or $11$, three can $00$ or $10$, and four must be $11$".
The first element of each pair is the opposite of the last element of the previous pair, so $00, 10, 11, 00, 01, 01, 00$ is valid while $00, 10, 01, 11, 10, 00, 11$ is not.
I can imagine a programmatic solution to this, simply starting with each pair and creating a tree-like structure out of branching off to each valid possibility for the next pair. However this seems "brute-force"-ish, and I'm wondering if there's some useful property of things that follow this pattern that could allow me to generate them rather than "elimate" invalid possibility from the solution set.
I'm honestly not sure what part of mathematics this falls under, so feel free to suggest or edit in a tag.