<s>[INST] A type of Combinatorial equality：$\sum_{k=0}^{n}\binom{n}{k} \cos\frac{k}{2}\pi=2^{\frac{n}{2}}\cos\frac{n}{4}\pi.$ When computing the Taylor series of the function $f(z)=e^z\cos z,$
I use two methods:
On the one hand, using Cauchy product, 
\begin{align*}
e^z\cos z
&=\left(\sum_{n=0}^{\infty}\frac{z^n}{n!}\right)
\left(\sum_{n=0}^{\infty}\frac{\cos\frac{n}{2}\pi}{n!}z^n\right)\\
&=\sum_{n=0}^{\infty}\left(\sum_{k=0}^{n}\frac{1}{(n-k)!}
\frac{\cos\frac{k}{2}\pi}{k!}\right)z^n\ (\text{Cauchy Product})\\[3pt]
&=\sum_{n=0}^{\infty}\frac{1}{n!}\left(\sum_{k=0}^{n}\binom{n}{k}\cos\frac{k}{2}\pi
\right)z^n,\ z\in\mathbb{C};
\end{align*}
On the other hand, 
\begin{align*}
e^z\cos z
&=e^z\cdot\frac{e^{i z}+e^{-i z}}{2}\\
&=\frac{e^{(1+i)z}+e^{(1-i)z}}{2}\\[3pt]
&=\frac{1}{2}\left(\sum_{n=0}^{\infty}\frac{(1+i)^n}{n!}z^n
+\sum_{n=0}^{\infty}\frac{(1-i)^n}{n!}z^n\right)\\
&=\frac{1}{2}\sum_{n=0}^{\infty}\frac{(1+i)^n+(1-i)^n}{n!}z^n\\
&=\frac{1}{2}\sum_{n=0}^{\infty}
\frac{2^{\frac{n}{2}}\left(e^{\frac{n}{4}\pi i}+e^{-\frac{n}{4}\pi i}\right)}{n!}z^n\\
&=\sum_{n=0}^{\infty}\left(\frac{2^{\frac{n}{2}}}{n!}\cos\frac{n}{4}\pi\right)z^n,\ z\in\mathbb{C}.
\end{align*}
So Compare the corresponding coefficients, we get the following Combinatorial equality:
$$\sum_{k=0}^{n}\binom{n}{k} \cos\frac{k}{2}\pi=2^{\frac{n}{2}}\cos\frac{n}{4}\pi.$$
What I want to konw: is there an elementary method or constructive method ( which is suitable for high school student!) to prove this Combinatorial equality?
Any help and hint will welcome!
 [/INST] There is a fundamental way to prove this.
I used a simple binomial expansion and Euler's identity to solve this...
Here's the solution:
$$
\begin{aligned}
&\sum_{k=0}^{n}\left(\begin{array}{l}
n \\
k
\end{array}\right) \cos \frac{k \pi}{2}=?\\
&\text { Let } T_{k}=\left(\begin{array}{l}
n \\
k
\end{array}\right)\left\{\cos \left(\frac{k \pi}{2}\right)+i \sin \left(\frac{k \pi}{2}\right)\right\}\\
&=\left(\begin{array}{l}
n \\
k
\end{array}\right) e^{\frac{i k \pi}{2}} \quad[\text { Euler's identity }]
\end{aligned}
$$
$$
\begin{aligned}
\sum_{k=0}^{n} T_{k} &=\sum_{k=0}^{n}\left(\begin{array}{l}
n \\
k
\end{array}\right) e^{\frac{i k \pi}{2}} \\
&=\left(e^{i \pi / 2}+1\right)^{n} \quad[\text { Binomial expansion }] \\
&=(1+i)^{n} \\
&=2^{n / 2}\left(\frac{1}{\sqrt{2}}+\frac{i}{\sqrt{2}}\right)^{n} \\
&=2^{n / 2}\left(\cos \frac{\pi}{4}+i \sin \frac{\pi}{4}\right)^{n} \\
S_{k} &=2^{n / 2} e^{\frac{i n \pi}{4}}
\end{aligned}
$$
$$
\text { But, } \operatorname{Im}\left(T_{k}\right)=\left(\begin{array}{l}
n \\
k
\end{array}\right) \cos \frac{k \pi}{2}
$$
$$
\operatorname{Im}\left(S_{k}\right)=\sum_{k=0}^{n}\left(\begin{array}{l}
n \\
k
\end{array}\right) \cos \frac{k \pi}{2}=2^{n / 2} \cos \frac{n \pi}{4}
$$
</s>