Mental Model
We use numbers in binary form to represent whether each item is included or not in a subset. Each bit is like a switch for an element.
Analogy: Imagine you have a row of light switches, one for each item. Turning a switch ON means including that item in the subset, OFF means excluding it. Counting from 0 to all switches ON gives all possible subsets.
Set: [1, 2, 3] Bitmask: 0 0 0 -> empty subset Bitmask: 0 1 0 -> subset with 2 Bitmask: 1 1 0 -> subset with 1 and 2 Bitmask: 1 1 1 -> subset with 1, 2, and 3
