Finding combinations given constraints

39 Views Asked by At

I have a list of variables [a,b,c,d...] where each variable is either 0 or 1. The number of permutations here is $2^n$ and so I believe the complexity of getting all possibilities would be $O(2^n)$.

If I have certain exclusions from the list, is there a way of getting all possible combinations which is less than $O(2^n)$. For example, if I knew that [b,c,d] cannot be [0,0,1], I think this would remove $\frac{1}{8}$ of all solutions (a fairly significant amount when $n$ is large). So is there a way of generating all possibilites without just generating all permutations of [a,b,c,d...] and only keeping the ones which work. Many thanks!