Let $X\sim B(n,p)$. How to calculate the the expected value $E[\bar{X}]$,where $\bar{X}=|X-E[X]|$?
Recently I want to prove that \begin{equation} \begin{aligned} f(n)&=\frac1nE[\bar{X}] = \frac1nE[|X-np|]=\frac1n\sum_{i=0}^{n}[C_n^i p^i (1-p)^{n-i}|i - np|] \end{aligned} \end{equation} is decreasing over $\mathbb{Z}^+$, so need to know how to calculate the expected value $E[\bar{X}]$. Of course, I would also really appreciate it if you know how to prove it.
Edited on July 16, 2022
The previous $f(n)$ missed a coefficient of $\frac1n$. After correction, I can already prove that $f(n)$ is decreasing over $\mathbb{Z}^+$.
The left side of the following figure is the image of $E[\bar{X}]$, and the right side is the image of the current $f(n)$.

See https://www.jstor.org/stable/2245429 for a reference, or this stats.stackexchange answer for a proof.