I have 12 attributes I care about for a project (for simplicity, let's call them 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 and 12). I want to find every possible combination of 1 to 12 items in this list, where order does not matter (e.g. 1 and 12 is identical to 12 and 1). I know there's a formula for this, but I'm having trouble with it.
Manually, my rough math is:
1 item: 12 possible combinations
2 items: 66 possible combinations
3 items: 220 possible combinations
4 items: 495 possible combinations
5 items: 792 possible combinations
6 items: 924 possible combinations
7 items: 792 possible combinations
8 items: 495 possible combinations
9 items: 220 possible combinations
10 items: 66 possible combinations
11 items: 12 combinations
12 items: 1 combination
total: 4095 possible distinct combinations
Is that accurate? What was the correct formula to use to calculate this as a set instead of each subset manually and add them together?
What you're trying to calculate is $\sum_{i=1}^n \binom{n}{r} = 2^n - 1$.
Here, $\binom{n}{r}$ represents the number of ways to choose $r$ objects from $n$ objects, without caring about ordering. It is usually called "combinations".
What is being calculated is all possible ways to choose to $r$ objects from $n$ objects, where $r = 1, 2, 3, \dots 12$ and $n = 12$.