I have a set of N-vectors, in d-dimensional space such that, $\vec{r_{i+1}} -\vec{r_i} = l\vec{a_i}$ wherein $a^{(k)}_i = {-1,0,1}$ (i.e the k-th component of the i-th vector takes one of these three values.
And my goal is to compute the n-th moment of the $\langle |\vec{r_N}-\vec{r_i}|^n\rangle$
In general, one can write the ened to end distance $\vec{r_N}-\vec{r_i} \sum_{i=1}^{N} \vec{r_i} = \sum_{i=1}^{N} l \vec{a_i}$
say, for the second moment, the we need $|\vec{r_N}-\vec{r_i}|^2 = l^2 \sum_{i,j=1}^N \vec{a_i} \boldsymbol{\cdot} \vec{a_j} = l^2\sum_{i,j=1}^N \sum_{k=1}^d a^{(k)}_i a…