Computing the variance of $X \wedge (n-X)$ where $X\sim \text{Binomial}(n,p)$

39 Views Asked by At

I want to calculate variance of $Y=X \wedge (n-X)$ where $X\sim \text{Binomial}(n,p)$ and $n$ is even. I have managed to determine the distribution of $X \wedge (n-X)$. We have

$$\mathbb{P}(Y=k) = 2\mathbb{P}(X=k), k<n/2, \quad \mathbb{P}(Y=n/2)=\mathbb{P}(X=n/2)$$ and $0$ otherwise. Calculating e.g. the second moment then involes calculating the sum

$$\sum_{k=0}^{n/2-1}k^2 \mathbb{P}(X=k)$$

which I'm not sure how to calculate.