# Variance of sum of $2n$ random variables.

Let $X_1,X_2....X_{2n}$ be random variables such that $V(X_i)=4;(i=1,2...2n)$ and $Cov(X_i,X_j) =3, (1 \leq i\ne j\leq2n)$ . Then

$V(X_1-X_2+X_3-X4......+X_{2n-1}-X_{2n})$

I am not able to figure out the covariance terms. According to formula sum of dependent positive random variables we have \begin{align}\operatorname{Var}\left(\sum_{i=1}^nX_i\right) &= \sum_{i=1}^n\operatorname{Var}(X_i)+{2\sum_{i<j }} \operatorname{Cov(X_i,X_j)}\end{align} \\

In my case if we take odd terms and even terms together they will give us positive co variance consecutive terms gives negative covariance. I am confused how to merge my result or is there standard result for alternating signs ?

$V(X_1-X_2+X_3-X4......+X_{2n-1}-X_{2n})=8n-()$?

Edit. Avoiding a large amount of comments. One has $$\sum_{i<j}\Cov((-1)^{i-1}X_i,(-1)^{j-1}X_j)=3\sum_{j=1}^{2n}(-1)^j\sum_{i=1}^{j-1}(-1)^i$$ Moreover $\sum_{i=1}^N(-1)^i=\frac{1}{2}((-1)^N-1)$ so: $$\sum_{j=1}^{2n}(-1)^j\sum_{i=1}^{j-1}(-1)^i=\frac{1}{2}\sum_{j=1}^{2n}((-1)^{2j-1}-(-1)^j)=-n-\frac{1}{4}((-1)^{2n}-1)=-n$$ putting everything together: \begin{align} \Var\left(\sum_{k=1}^{2n}(-1)^{k-1}X_k\right)=8n+2\cdot 3\cdot (-n)=2n \end{align}
• $2\sum_{i<j}(-1)^{i+j}$Cov$(X_i,X_j)$? $(i+j=2n)$ it wll be overall positive? – Daman deep Jan 30 '18 at 8:41
• So that will give me $8n-6n=2n$. Thanks you ve been very helpful. I am learning these things. – Daman deep Jan 30 '18 at 8:44
• @Damn1o1 I'm not sure about the positivity. Be careful with $\sum_{i<j}$ it means: $$\sum_{i<j}=\sum_{i<j\leq 2n} = \sum_{j=1}^{2n}\sum_{i=1}^{j-1}$$ hence $$\sum_{j=1}^{2n} (-1)^{j}\sum_{i=1}^{j-1}(-1)^i\Cov(X_i,X_j)=3\sum_{j=1}^{2n}(-1)^j\sum_{i=1}^{j-1}(-1)^i$$ now figure out what $\sum_{i=1}^{j-1}(-1)^i$ is. – Shashi Jan 30 '18 at 8:58
• Moreover let $b_j:=\sum_{i=1}^{j-1}(-1)^i$. Then we have $b_1=0$ , $b_2=-1$ , $b_3=0$, $b_4=-1$ etc etc. So you can easily find a closed form for $b_j$. – Shashi Jan 30 '18 at 9:00