Given five objects $A, B, C , D , E$. I'd like to calculate all possible sets of these objects such that
- Two pairs of objects, $B$ and $C$, and $D$ and $E$, cannot coexist. For example the set $\{ABD\}$ would be valid but the set $\{CDE\}$ would not.
- Each object appears no more than once in a set, e.g. $\{ACD\}$ is valid but $\{ADD\}$ is not.
- There can be no empty set.
- Apart from the above, there is no other limit on the cardinality of a set, e.g. $\{D\}$, $\{AB\}$, $\{ACE\}$. I know there can be no set of cardinality greater than 3, but it would be nice to show this.
- The objects can be listed in any order, i.e. $\{AB\} = \{BA\}$
Edit My intention is to generalize the process of generating these combinations given any number of elements and restrictions.
From a response to a question, it appears that order does not matter.
It is not clear whether the empty set ("none") is to be considered a valid choice. We will assume that it is allowed. If it is not, subtract $1$ from the answer we will obtain.
With such a small number of objects, a carefully drawn up list may be the best approach.
Another good option is the approach taken by Sp3000. There, permutations were being counted, but the ideas can be readily modified to disregard order. For choices of $0, 1, 2, 3$ objects, the answers become $1$, $5$, $8$, and $4$ for a total of $18$ (or $17$ if we don't allow the empty set).
But you may like the following idea. Line up the $5$ objects in front of us, with $B$ and $C$ close to each other, and also $D$ and $E$, like this: $$A\qquad BC \qquad DE.$$
Stand in front of $A$ and decide whether to include her in the set we are building. There are $2$ choices, yes or no.
Now walk over to the $BC$ group. For every choice we made about $A$, we now have $3$ choices, $B$, $C$, or neither. So far, we have $2\times 3$ distinct possibilities.
Finally, walk over and stand in front of the $DE$ group. For every choice we made earlier, there are again $3$ choices, this time $D$, $E$, or neither.
Thus the total number of possible choices is $2\times 3\times 3$, that is, $18$. Again, if the empty set is not allowed, we have $17$ possibilities only.