For set A B C, you can enumerate the powerset in binary: 111 ABC 110 AB 101 A C 100 A 011 BC 010 B 001 C 000 For BCD, it would be thus: 111 BCD 110 BC 101 B C 100 B 011 CD 010 C 001 D 000 Instead, we want to offset the values in BCD and leave an empty slot for A. We'll end up with this: 0111 BCD 0110 BC 0101 B C 0100 B 0011 CD 0010 C 0001 D 0000