Expected value of absolute value of shifted binomial distribution Recently my research needs to calculate the close form of $\mathsf{E}[|X-\frac{n}{2}|]$ where $X$ follows binomial distribution with parameter $(n,p)$. When $p=\frac{1}{2}$, this is just the mean absolute deviation (MAD) and has close form, see this paper for more details. But when $p\neq\frac{1}{2}$ the close form seems to become tricky. I come up with an idea that we can try to calculate $\lim_{t\rightarrow 2}\mathsf{E}[(X-\frac{n}{2})^\frac{2}{t}]$, but I'm also not familiar with the fractional moment. Any references or ideas would be appreciated.
Thanks in advance.
 A: Mathematica can only produce a useless, tautological expression for $E|X-n/2|$ in terms of the hypergeometric function. Using Lemma 1 (Todhunter's Formula) in the paper you linked and the expression of the binomial distribution function in terms of the incomplete beta function (see e.g. Lemma 1), one can easily get an expression of $E|X-n/2|$ in terms of the incomplete beta function. 
However, an apparently better way to deal with this problem is to provide the following approximation of $E|X-n/2|$, which will be very close to $E|X-n/2|$ if $p$ is not too close to $1/2$. Indeed, for any real $u$ we have $|u|=u-2u\,1_{u<0}$, which implies 
$$E|X-n/2|=E(X-n/2)+R_n=n(p-1/2)+R_n,$$
where 
$$R_n:=E(n/2-X)1_{X<n/2}.$$
Assuming now $p>1/2$ and using Hoeffding's inequality, we have 
$$0\le R_n\le(n/2)P(X<n/2)\le R_n^*:=(n/2)e^{-2n(p-1/2)^2}.$$
The case $p<1/2$ is similar. So, we have 
$$|E|X-n/2|-n|p-1/2||\le R_n^*.$$
In particular, this implies that for $n\to\infty$
$$E|X-n/2|\sim n|p-1/2|$$
if $p\ne1/2$ is fixed or, more generally, if $p=p_n$ varies with $n$ so that 
$$\liminf_{n\to\infty}\frac{|p_n-1/2|}{\sqrt{(\ln n)/n}}>\frac12.$$
