# Distribution of differences between adjacent sorted uniform random variables on $[0,1]$

I saw this question on Mathematica.stackexchange, and I wonder what distribution the answer gives.

### Asymmetric definition

Let $(X_1,X_2,\ldots,X_{n-1})\sim$ i.i.d. $U[0,1]$, and $(Y_1,Y_2,\ldots,Y_{n-1})$ be those values sorted in ascending order.

What is the distribution of $(Y_1,Y_2-Y_1,\ldots,Y_{n-1}-Y_{n-2},1-Y_{n-1})$?

This seems to depend on the symmetric version below. So, from the observation of the symmetry, all the components from the second to the second last will have the same distribution, with expected value $\frac{1}{n-1}$, and by symmetry the first and last has the same distribution, with expected value $\frac{1}{2(n-1)}$. I doubt this was what the original poster of the linked question was after.

### Symmetric definition

Let $(X_1,X_2,\ldots,X_n)\sim$ i.i.d. $U[0,1]$, and $(Y_1,Y_2,\ldots,Y_n)$ be those values sorted in ascending order.

What is the distribution of $(1+Y_1-Y_n,Y_2-Y_1,\ldots,Y_n-Y_{n-1})$?

At least we know the expected value of each component by symmetry: $\frac{1}{n}$.

• The difference of successive order statistics are called "spacings". You can look at David's Order Statistics or something for more details on it, especially in the uniform case. – Batman Dec 27 '14 at 13:58

I am afraid the conclusion is wrong in both cases...

(Asymmetric definition)
What is the distribution of $(Y_1,Y_2-Y_1,\ldots,Y_{n-1}-Y_{n-2},1-Y_{n-1})$?

Let $Z^{(n)}=(Y_1,Y_2-Y_1,\ldots,Y_{n-1}-Y_{n-2},1-Y_{n-1})$, then $Z^{(n)}$ is almost surely in $D_n=H_n\cap(\mathbb R_+)^n$ where $H_n$ is the affine hyperplane of $\mathbb R^n$ of equation $z_1+\cdots+z_n=1$, and uniformly distributed on $D_n$. In particular, $E(Z^{(n)}_k)=1/n$ for every $1\leqslant k\leqslant n$, hence $E(Y_k)=k/n$ for every $1\leqslant k\leqslant n-1$.

(Symmetric definition)
What is the distribution of $(1+Y_1-Y_n,Y_2-Y_1,\ldots,Y_{n-1}-Y_{n-2},Y_n-Y_{n-1})$?

Let $T^{(n)}=(1+Y_1-Y_n,Y_2-Y_1,\ldots,Y_{n-1}-Y_{n-2},Y_n-Y_{n-1})$, then $T^{(n)}=G(Z^{(n+1)})$ where $G:\mathbb R^{n+1}\to\mathbb R^n$ is the affine function defined by $G(z_1,\ldots,z_{n+1})=(z_1+z_{n+1},z_2,\ldots,z_n)$. This yields the distribution of $T^{(n)}$, whose support is $D_n$, and whose density is proportional to $(t_k)_{1\leqslant k\leqslant n}\mapsto t_1$ on $D_n$. In particular $E(T^{(n)}_1)=2/(n+1)$ and $E(T^{(n)}_k)=1/(n+1)$ for every $2\leqslant k\leqslant n$.

• I'm claiming that the first one is not uniformly distributed on $D_n$ but the second one is "more uniformly distributed" in that all the components are symmetric. Is there any proof of your result? – user1537366 Dec 29 '14 at 3:13
• I think of the second one as the differences of consecutive points on a circle, which is why I think it is symmetric. – user1537366 Dec 29 '14 at 3:16
• "Is there any proof of your result?" Yes, start from the density of $(Y_1,\ldots,Y_{n-1})$, which is $(n-1)!\mathbf 1_{\Delta_n}$ with $\Delta_n$ defined by $0\lt y_1\lt\cdots\lt y_{n-1}\lt1$ and apply the change of variable $(y_k)\mapsto(z_k)$. – Did Dec 29 '14 at 9:28
• About symmetry, let me suggest to compute $m=E(Y_2-Y_1)$ when $n=2$ (the full computation is not difficult). The symmetry you are advocating would yield $m=\frac12$ but actually, $m=\frac13$. The reason why the arcs of the circle from $Y_1$ to $Y_2$ and from $Y_2$ to $Y_1$ are not equivalent is that the latter must contain $0$. This destroys the invariance by rotation and yields a size-bias similar to the one observed in renewal theory, which makes the latter interval larger stochastically. – Did Dec 29 '14 at 9:33
• OK, thanks for the explanation about the incorrect symmetry! Indeed I calculated $E(Y_1)=\frac{1}{3}$ and so $E(Y_2)=\frac{2}{3}$ (by symmetry :)) and so you are right. – user1537366 Dec 29 '14 at 11:37