Model 1
Consider the permutation list of 4-bit-strings:
list = Permutations[{0, 0, 1, 1}, {4}]
which outputs:
{{0, 0, 1, 1}, {0, 1, 0, 1}, {0, 1, 1, 0}, {1, 0, 0, 1}, {1, 0, 1, 0}, {1, 1, 0, 0}}.
We like to select a subset among these six 4-bit-strings such that any of the two among the subset, will have an even number of bit 1 overlaps.
One way to proceed is to define
overlap[x_, y_] = x.y;
So when there is an even number of 1s overlap among x and y from the list, then
EvenQ[overlap[x, y]] outputs True.
What missing now is the last step, we need to ensure the enumeration, from the first {0, 0, 1, 1} to the last {1, 1, 0, 0} in the list, picking up any two, say x and y, they further satisfy the constraint EvenQ[overlap[x, y]] outputs True.
We expect the answer is {{0, 0, 1, 1}, {1, 1, 0, 0}}.
But a possible form to achieve this last step is something like using
Select, EvenQ, overlap[#, #]] &
But something like this fail:
subset = Select[list, EvenQ[overlap[#, #]] &]
What will be the correct way to select the subset (each with even 1s overlapped in the same position in the bit-string)?
I have some laborious way to do it by enumeration, but I like to hear experts shortcut to do it. Thank you!
Model 2
I like to elaborate another toy model to test the wonderful answer @lericr. lericr's answer got it right for 4-bit string; but not more general example.
Consider the permutation list of 8-bit-strings:
list = Permutations[{ 1, 1, 1, 1, 0, 0, 0, 0}, {8}]
which outputs:
{{1, 1, 1, 1, 0, 0, 0, 0}, {1, 1, 1, 0, 1, 0, 0, 0}, {1, 1, 1, 0, 0, 1, 0, 0}, {1, 1, 1, 0, 0, 0, 1, 0}, {1, 1, 1, 0, 0, 0, 0, 1}, {1, 1, 0, 1, 1, 0, 0, 0}, {1, 1, 0, 1, 0, 1, 0, 0}, {1, 1, 0, 1, 0, 0, 1, 0}, {1, 1, 0, 1, 0, 0, 0, 1}, {1, 1, 0, 0, 1, 1, 0, 0}, {1, 1, 0, 0, 1, 0, 1, 0}, {1, 1, 0, 0, 1, 0, 0, 1}, {1, 1, 0, 0, 0, 1, 1, 0}, {1, 1, 0, 0, 0, 1, 0, 1}, {1, 1, 0, 0, 0, 0, 1, 1}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}, {0, 0, 1, 1, 1, 0, 1, 0}, {0, 0, 1, 1, 1, 0, 0, 1}, {0, 0, 1, 1, 0, 1, 1, 0}, {0, 0, 1, 1, 0, 1, 0, 1}, {0, 0, 1, 1, 0, 0, 1, 1}, {0, 0, 1, 0, 1, 1, 1, 0}, {0, 0, 1, 0, 1, 1, 0, 1}, {0, 0, 1, 0, 1, 0, 1, 1}, {0, 0, 1, 0, 0, 1, 1, 1}, {0, 0, 0, 1, 1, 1, 1, 0}, {0, 0, 0, 1, 1, 1, 0, 1}, {0, 0, 0, 1, 1, 0, 1, 1}, {0, 0, 0, 1, 0, 1, 1, 1}, {0, 0, 0, 0, 1, 1, 1, 1}}
Then we expect to Select a subset so the subset contains at least only 14 out of the original 70 of 8-bit-strings. I expect a Correct Answer like this:
Correct Answer:: {{1, 1, 1, 1, 0, 0, 0, 0}, {0, 0, 0, 0, 1, 1, 1, 1}, {1, 1, 0, 0, 1, 1, 0, 0}, {1, 1, 0, 0, 0, 0, 1, 1}, {0, 0, 1, 1, 1, 1, 0, 0}, {0, 0, 1, 1, 0, 0, 1, 1}, {1, 0, 1, 0, 1, 0, 1, 0}, {1, 0, 1, 0, 0, 1, 0, 1}, {0, 1, 0, 1, 1, 0, 1, 0}, {0, 1, 0, 1, 0, 1, 0, 1}, {1, 0, 0, 1, 1, 0, 0, 1}, {1, 0, 0, 1, 0, 1, 1, 0}, {0, 1, 1, 0, 1, 0, 0, 1}, {0, 1, 1, 0, 0, 1, 1, 0}}.
Note that the lericr's EvenNeighbors[list[[1]], list] somehow fails but produces a subset of 38 such 8-bit-strings --- among many of them have an odd number of 1s overlapped. For your eys, we find
EvenNeighbors[target_, list_] := Select[list, EvenQ[overlap[target, #]] &]
EvenNeighbors[list[[1]], list]
Wrong Answer: {{1,1,1,1,0,0,0,0},{1,1,0,0,1,1,0,0},{1,1,0,0,1,0,1,0},{1,1,0,0,1,0,0,1},{1,1,0,0,0,1,1,0},{1,1,0,0,0,1,0,1},{1,1,0,0,0,0,1,1},{1,0,1,0,1,1,0,0},{1,0,1,0,1,0,1,0},{1,0,1,0,1,0,0,1},{1,0,1,0,0,1,1,0},{1,0,1,0,0,1,0,1},{1,0,1,0,0,0,1,1},{1,0,0,1,1,1,0,0},{1,0,0,1,1,0,1,0},{1,0,0,1,1,0,0,1},{1,0,0,1,0,1,1,0},{1,0,0,1,0,1,0,1},{1,0,0,1,0,0,1,1},{0,1,1,0,1,1,0,0},{0,1,1,0,1,0,1,0},{0,1,1,0,1,0,0,1},{0,1,1,0,0,1,1,0},{0,1,1,0,0,1,0,1},{0,1,1,0,0,0,1,1},{0,1,0,1,1,1,0,0},{0,1,0,1,1,0,1,0},{0,1,0,1,1,0,0,1},{0,1,0,1,0,1,1,0},{0,1,0,1,0,1,0,1},{0,1,0,1,0,0,1,1},{0,0,1,1,1,1,0,0},{0,0,1,1,1,0,1,0},{0,0,1,1,1,0,0,1},{0,0,1,1,0,1,1,0},{0,0,1,1,0,1,0,1},{0,0,1,1,0,0,1,1},{0,0,0,0,1,1,1,1}}