# How to compute sum of all combinations

I remember some things from college about computing permutations and combinations, but I don't really recall if we ever learned any alternative to the formula I'm about to describe. In this case, I want to know how many full combinations (the nomenclature is probably not correct) you can generate from a set of n elements. That is, from n elements, you may choose 1, 2, 3, ... all the way up to choosing all n.

I think that this formula does the trick, but is there any simpler alternative? Specifically, I'd rather have a non-iterative one (without the sum loop). Ideas?

• If "combinations" means "subsets", then, as Marcus Stuhr answered, it's $2^n$. Page 30 here: [books.google.com/…
– avs
May 3, 2017 at 19:53

$$\sum_{k=0}^{n} \binom{n}{k} = \sum_{k=0}^{n} \binom{n}{k} (1)^{n-k}(1)^k = (1+1)^n = 2^n$$
If you aren't counting the $k=0$ case then you subtract $1$ from this.