I'm having a tough time on this problem, suppose we have $v\_i$ for $i=1\cdots n$ unit vectors sampled from a $d$-dimensional hypersfere. How can we evaluate this average over these vectors?
$$
\mathbb{E}\_v\frac{1}{n^4}\left(\sum\_{i,j=1}^{n,n}(v\_i\cdot v\_j)^2\right)^2=?
$$
I was able to determine that
$$
\mathbb{E}\_v\frac{1}{n^2}\sum\_{i,j=1}^{n,n}(v\_i\cdot v\_j)^2 = \frac{(n-1)/d+1}{n}
$$
now I also need the fourth moment but I am unable to perform the calculations...
does anyone have an idea on how to proceed?



Average of cosine similarity between $n$-vectors sampled from $d$-dim hypersphere
**Hint**: Note that the sum under the expectation can be written as $$\sum\_{i,j,k,l}\frac{(z\_i.z\_j)^2(z\_k.z\_l)^2}{\|z\_i\|^2\|z\_j\|^2\|z\_k\|^2\|z\_l\|^2},$$ where $z\_i$ are standard normal random vectors in $R^d$. You have to now consider the cases where $2,3$ or $4$ of these indices are same, and the corresponding terms will be of the form:
$$\frac{(z\_i.z\_j)^2}{\|z\_k\|^2\|z\_l\|^2}, or \frac{(z\_i.z\_j)^2(z\_i.z\_l)^2}{\|z\_i\|^4\|z\_j\|^2\|z\_l\|^2}, or 1.$$ Now, you can use the rotational invariance of the Gaussians along with their spherical coordinate representation to simplify these expectations and obtain the final result.


