2

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: [https://books.google.com/books?id=PS8lQQ8AOHYC&printsec=frontcover&dq=sadovsky+discrete+mathematics&hl=en&sa=X&ved=0ahUKEwi8z-_Vv9TTAhUKSiYKHSjgB5UQ6AEIJzAA#v=onepage&q=subsets&f=false]

    – avs May 03 '17 at 19:53

1 Answers1

3

Via binomial theorem:

$$\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.