In order to find the expected value of a random variable I need to simplify this sum:
$ \bigg(\sum_{i = 1}^{m-1}\sum_{i+1}^{m} a_{i,j}\bigg)^{2}$
I'm familiar with the well known formula for squaring a single summation, but I'm not sure how to expand this.
Edit - added information
$a_{i,j}$ can take values of 1 with probability $p_{1}$, and -1 with probability $p_{2}$. The random variable I'm trying to find the expected value depends on the reciprocal of the above summation.
Your sum is just the sum of all the $a_{i,j}$ with $j \gt i$. There are $\frac 12m(m-1)$ terms in the sum. As all the terms are $\pm 1$ the sum only depends on how many are positive. If there are $k$ positive terms and $\frac 12m(m-1)-k$ negative terms the sum is $2k-\frac 12m(m-1)$. The square is then $$4k^2-2km(m-1)+\frac 14m^2(m-1)^4$$ You can compute the probability of values of $k$ and use that to get the expected value.