One of the algorithm I learnt involve these steps:
$1$. define a set $S$ of $n$ elements
$2$. form a subset $S'$ of $k$ choice from $n$ elements of the set $S$ ($k$ starts with $1$), which is effectively the combination of $n$ choose $k$: $\frac{n!}{k!(n-k)!}$
$3$. repeat until $k = n$
So for example: $n=5, s = \{A,B,C,D,E\}$
1st round:
{A},{B},{C},{D},{E} (k=1 => n!/k!(n-k)! = 5 outcomes)2nd round:
{A,B}, {A,C}, {A,D}, {A,E}, {B,C}, {B,D}, {B,E} {C,D}, {C,E} {D,E} (k = 2 => n!/k!(n-k)! = 10 outcomes)3rd round:
{A,B,C}, {A,B,D}, {A,B,E} {B,C,D}, {B,C,E} {C,D,E}, {C,D,A} {D,E,A}, {D,E,B} (k = 3 => n!/k!(n-k)! = 10 outcomes)4th round:
{A,B,C,D}, {A,B,C,E} {B,C,D,E} {C,D,B,E} {D,C,A,E} (k = 4 => n!/k!(n-k)! = 5 outcomes)5th round:
{A,B,C,D,E} (k = 5 => n!/k!(n-k)! = 1 outcomes)
The total outcome $t = 5 + 10 + 10 + 5 + 1 = 31$
Which correspond to the formula $2^n - 1$ (predicted by the algorithm)
So I was trying to prove that the sum of this series will result in $2^n - 1$ but did not succeed
series s
s = n!/1!(n-1)! + n!/2!(n-2)! + ... + n!/(n-2)(n-(n-2))! + n!/(n-1)(n-(n-1))! + n!/n!(n-n)!
s = n!/1!(n-1)! + n!/2!(n-2)! + ... + n!/(n-2)2! + n!/(n-1)1! + n!/n!
s = n!/1!(n-1)! + n!/2!(n-2)! + ... + n!/(n-2)2! + n!/(n-1)1! + 1
could we prove the series above = $2^n - 1$? Or am I on the wrong side of the road?
The binomial theorem states that $$\sum_{k=0}^n \binom{n}{k} x^k=(1+x)^n$$ Putting $x=1$ gives $$\sum_{k=0}^n \binom nk=2^n\\ \sum_{k=1}^n\binom nk=2^n-1$$