Please help me write the formula for all possible combinations given below. I am not expert in Maths, so please understand.
Elements: a,b,c,d,e
Example of possible combinations:
{a},{b},{c},{d},{e},
{a,b},{a,c},{a,d},{a,e},{b,c},{b,d},{b,e},{c,d},{c,e},{d,e},
{a,b,c},{a,b,d},{a,b,e},{a,c,d},{a,c,e},{a,d,e},
{a,b,c,d},{a,b,c,e},
{a,b,c,d,e}
As you see, no elements are repeating and number of selection is growing from 1 to 5. I read about Permutations and Combinations basics but couldn't find the right formula.
You have $\binom{5}{1}$ ways to choose one element, $\binom{5}{2}$ ways to choose two elements, $\binom{5}{3}$ ways to choose three elements, $\binom{5}{4}$ ways to choose four elements, and, $\binom{5}{5}$ ways to choose five elements.
So, using the binomial expansion, we get
$$\binom{5}{1}+\binom{5}{2}+\binom{5}{3}+\binom{5}{4}+\binom{5}{5}=(1+1)^5-1=31.$$