The example 1.2.2 of the book Statistical Inference by Casella and Berger states: if S has n elements, there are 2^n sets...(please see attached).
Could you please explain how the authors derived that formula? Thank you.
Cross Validated is a question and answer site for people interested in statistics, machine learning, data analysis, data mining, and data visualization. It only takes a minute to sign up.
Sign up to join this communityThe example 1.2.2 of the book Statistical Inference by Casella and Berger states: if S has n elements, there are 2^n sets...(please see attached).
Could you please explain how the authors derived that formula? Thank you.
It is the number of subsets of a given set. While constructing a subset, we have two choices for each element in the set, i.e. take it or leave it. For $n$ elements, we have $2\times2...2=2^n$ choices, so there are $2^n$ different subsets of a given set.
Although I am personally a fan of the answer laid out by @gunes (+1) for its simplicity, it is worth mentioning an alternative method of proof.
The number of subsets of $S$ consisting of exactly $k$ elements is "n choose k", i.e.
$$\binom{n}{k} = \frac{n!}{k!(n-k)!}.$$
Thus the total number of subsets is given by
$$\begin{align*} |\mathcal B| &= \sum_{k=0}^n\binom{n}{k} \\[1.2ex] &= \sum_{k=0}^n\binom{n}{k}\times 1^k \times 1^{n-k} \\[1.2ex] &= (1+1)^n \\[1.2ex] &= 2^n \end{align*}$$ where the second to last equality is due to the binomial theorem.
This is called power set.
The other answers have information contained in the linked wikipedia page, though none of them surprisingly contain the term 'power set'. I think this answers a question that didn't ask but needs to know the answer to: 'What's the $\mathcal B$ called?' If Nemo knew what it was called, then Nemo wouldn't even be asking this question since Nemo would instead search google or wikipedia for 'number of elements in power set'.