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?