<s>[INST] 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.
 [/INST] As already shown, complex numbers will come very handy. Here's one trick:
$$(1+i)^{n} = \binom{n}{0} + i\binom{n}{1} -\binom{n}{2} - i \binom{n}{3}... + i^{n} \binom{n}{n}$$
$$(1-i)^{n} = \binom{n}{0} - i\binom{n}{1} -\binom{n}{2} + i \binom{n}{3}... + (-i)^{n} \binom{n}{n}$$
It is easy to check now, (by multiplying both series by $i$ and subtracting the second from the first):
$$\frac{1}{2}i\left ((1-i)^{n} - (1+i)^{n}  \right ) = \binom{n}{1} - \binom{n}{3} +\binom{n}{5} - \binom{n}{7}... + ((-1)^n(i)^{n+1}-i^{n+1}) \binom{n}{n}$$
In terms of exponentials:
$$\frac{1}{2}i\left ((1-i)^{n} - (1+i)^{n}  \right )=\frac{1}{2}i2^{\frac{n}{2}}(e^{-\frac{i n \pi }{4}}-e^{\frac{i n \pi }{4}})= 2^{\frac{n}{2}}\frac{e^{\frac{i n \pi }{4}}-e^{-\frac{i n \pi }{4}}}{2i}=2^{\frac{n}{2}}sin\left ( \frac{n\pi }{4} \right )$$
As given in the other answer.
</s>