Re:Generating all permutations, combinations, and power set ...
by daenz on Friday May 05, 2017 @03:08PM
(#14276015)
I came at this from the perspective of the Binomial theorem:
(x + y)^n = sum{k=0,n} (n choose k) x^(n-k) y^k
And since a powerset is:
sum{k=0,n} (n choose k)
The way we can turn the first equation into a powerset is by setting x=1 and y=1, hence:
2^n = sum{k=0,n} (n choose k)
N choose K = (N-1 choose K-1) + (N-1 choose K).
Also, if you sum (N choose K) for all values of K you get 2^N.