I am reading this paper "Continuous Diffusion Analysis" and in page 7 there are a next formula
$\mathbb{E}_{x,y}[d_S(x,y)]=\dfrac{1}{4}\sum_{i=0}^{n-1}\int^{1}_{-1}\int^{1}_{-1}|sgn(x_i)-sgn(y_i)|dx_idy_i$.
I am trying to obtain this formula using the formula $\mathbb{E}[z]=\int_{\mathbb{R}}zf(z)dz$ presented in "Absolutely continuous case" of wikipedia, but I do not understand how the authors of "Continuous Diffusion Analysis" reach that formula. For now, considering $z=d_S{(x,y)}$ follows the uniform distribution, I think that the probability density function of $d_S{(x,y)}$ is $\dfrac{1}{2n}$. Then according to wikipedia
$\mathbb{E}[z]=\int_{\mathbb{R}}zf(z)dz=\mathbb{E}[z]=\int_{\mathbb{R}}\dfrac{1}{2n}d_S(x,y)dz$.
Could you help to obtain that formula with an explanation, please? For example, how they go from $\mathbb{R}$ to $-1, 1$ limits?