-2

I came upon this reading that talks about hypothesis testing and how to select features of the model, and in the reading, it was mentioned that to select a subset(of any size) of n predictors, we would have $2^n$ choices. How is this the case? I would think that we would have the number of cases equal to $\binom{n}{1}+\binom{n}{2}+...+\binom{n}{n}$, where each term represents the number of combinations for each subset of different size.

Yuuki
  • 85
  • 4
    It is quite confusing what $p$ means. Anyway, if you mean picking predictors any numbers from 0 to $n$, then there are indeed $2^n$ ways to pick, since for each predictor, there are two choices, take it or not. Moreover, it is true that $2^n$ = $\binom{n}{0} + \binom{n}{1} + \cdots + \binom{n}{n}$. You are missing the case $\binom{n}{0}$, which means we do not pick any variable and likely the model contains only an intercept. – ムータンーオ Jul 07 '22 at 09:23

1 Answers1

1

One way to see this is by applying the binomial theorem: $$2^n=(1+1)^n=\sum_{k=0}^n{n\choose k}$$.

This makes perfect sense if you happen to know that $n\choose k$ is the number of $k$-element subsets of an $n$ element set.

Also if you define the power set $P(x)$ of a set $x$ to be the set of all subsets of $x$, it is well-known that $|P(x)|=2^n$. The reason is essentially that there are two choices for each element $x$: $$to \ be \ or \ not\ to \ be$$ in the subset that is being selected.

calc ll
  • 8,427