Q:

Evaluate the sum $\sum\limits_{k=1}^n {\binom{n}{k} f(k)}$.

Evaluate the following sum $:$
$$\sum\limits_{k=1}^n \binom{n}{k} f(k),$$ where $f(k)=0$ if $k$ is even and $f(k)=(-1)^{\frac {k-1} {2}}$ if $k$ is odd.

How do I proceed? Please help me in this regard.
Thank you very much.

A:

One method is to determine that $f(k) = \sin\left(\frac{k \, \pi}{2}\right)$. From this the following can be determined:
\begin{align}
\sum_{k=1}^{n} \binom{n}{k} f(k) &= \frac{1}{2 i} \, \left[\sum_{k=1}^{n} \binom{n}{k} \, e^{i k \pi/2} - \sum_{k=1}^{n} \binom{n}{k} \,  e^{-i k \pi/2} \right] \\
&= \frac{1}{2 i} \, \left[\sum_{k=0}^{n} \binom{n}{k} \, e^{i k \pi/2} - \sum_{k=0}^{n} \binom{n}{k} \,  e^{-i k \pi/2} \right] \\
&=  \frac{1}{2 i} \, \left[(1 + e^{i \pi/2})^{n} - (1 + e^{-i \pi/2})^{n} \right] \\
&= \frac{1}{2 i} \, \left[(1 + i)^{n} - (1 - i)^{n} \right] \\
&= 2^{n/2} \, \frac{1}{2 i} \, \left( e^{i n \pi/4} - e^{- i n \pi/4} \right) \\
&= 2^{n/2} \, \sin\left(\frac{n \pi}{4}\right).
\end{align}
This shows that:
$$ \sum_{k=1}^{n} \binom{n}{k} \, \sin\left(\frac{k \, \pi}{2}\right) = 2^{n/2} \, \sin\left(\frac{n \pi}{4}\right). $$

