Let $r \ge 2$ be an integer, and let $S(r)$ = $\{0, 1, \ldots, 2^r-1\}$. Find the generating series for $S(r)$ with respect to the weight function w. Prove your answer is correct.
I came up with this solution:
$\sum_{k=0}^r \binom{r}{k} x^k$
I feel like this is correct, but I don't know how to go about proving it.
Does the question suggest a combinatorics proof?
EDIT: I forgot to mention the weight function: $w(σ) =$ (the number of ones in the binary representation of $σ$).