TITLE: Let $b_{n}$ denote the number of compositions of $n$ into $k$ parts, where each part is one or two. Find the generating series for $b_{n}$
QUESTION [5 upvotes]: I am stuck with this combinatorics problems -
Let $n$ be a positive integer and let $b_{n}$ denote the number of compositions of $n$ into $k$ parts, where each part is one or two. For example, $(1, 2, 1, 2, 1)$ and $(2, 2, 1, 1, 1)$ are two compositions of $n = 7$ into $k = 5$ parts.
Firstly, we need to find the generating series for $b_{n}$
Secondly, Prove that $b_{n} = {k \choose n-k}$ for $k\le n \le2k$ and $b_{n} = 0$ otherwise.

REPLY [2 votes]: There's a nice combinatorial proof for the second question:
The number of compositions of $n$ into $k$ parts each equal to $1$ or $2$ is equal to the number of compositions of $n-k$ into $k$ parts each equal to $0$ or $1$. Clearly there must be $n-k$ $1$s in such a composition, and there are $\binom k{n-k}$ ways of arranging those $1$s among the $k$ parts.