# Closed form for binomial sum with absolute value

Do you know whether the following expression has a (nice) closed form or a close enough approximation?

$$\frac{1}{2^n}\sum_{k=0}^{n} \binom{n}{k}|n-2k|$$

Thanks a lot :)

Cheers,

M.

If we assume that $n$ is even, $n=2m$, our sum times $2^n$ equals:
$$\sum_{j=0}^{m-1}\binom{2m}{j}(2m-2j)+\sum_{j=m+1}^{2m}\binom{2m}{j}(2j-2m) =\sum_{j=0}^{m-1}\binom{2m}{j}(4m-4j)$$ where: $$\sum_{j=0}^{m-1}\binom{2m}{j} = \frac{4^m-\binom{2m}{m}}{2}$$ and: $$\sum_{j=0}^{m-1}\binom{2m}{j}j = 2m\sum_{j=0}^{m-2}\binom{2m-1}{j}=2m\cdot\frac{2^{2m-1}-\binom{2m-1}{m-1}}{2}.$$ The case $n=2m+1$ can be managed in a similar way.