Combinatorics – Number of Nonempty Subsets of a Set with $n$ Elements

combinatorics

Given a set of whole numbers of size $n$, how many unique combinations of these whole numbers are there?

For example, for the set $\{1,2,3\}$ the unique combinations are

$\{1,2,3\}, \{1,2\}, \{1\}, \{2\}, \{3\}, \{2,3\}, \{1,3\}$

The number of combinations for $\{1,2,3\}$ is $7$.

Does this generalize to the number of unique combinations in a set is $2^n-1$ where $n$ is the number of elements in the set?

Best Answer

Let $S$ be a set of $n$ elements, and let $x \in S$. For any subset of $S$, we either have $x \in S$ or $x \not \in S$, giving us $2^n$ total subsets. You're discounting the empty set, so the answer is $2^n - 1$, as you said.