Let $X\_1, ..., X\_n \quad i.i.d \sim U[a,b]$ Then $Z\_i$ defined as:
$$
Z\_i = \frac{X\_{(i)}- X\_{(1)}}{X\_{(n)} - X\_{(1)}}, \quad i = \overline{2,n-1},
$$
where $X\_{(k)}$ is the $k$-th order statistic.


I wonder if there is a simple way to find its distribution. I am confused because $X\_{(k)}$ are not independent, so one can't use the convolution formula. I've searched in another topics, but there are formulas whether for standard uniform didstribution or fixed $n=2$ without derivation.



How can one calculate distribution of ratio of differences of order statistics of uniform distribution?
As long as $a<b$, the distribution of $Z:=Z\_i$ does not depend on $a,b$. This follows because for $Y\_k:=(X\_k-a)/(b-a)$ we have $Y\_k\overset{iid}\sim U[0,1]$ and
$Z\_i=\dfrac{Y\_{(i)}-Y\_{(1)}}{Y\_{(n)}-Y\_{(1)}}$. So, without loss of generality, $a=0$ and $b=1$.


The pdf of $Z$ can be found using the transformation technique -- that is, the change of variables formula, here for triple integrals. Indeed, letting
$$U:=X\_{(1)},\quad V:=X\_{(i)},\quad W:=X\_{(n)},$$
we have
$$V=S+(T-S)Z,\quad U=S,\quad W=T,$$
where $Z:=Z\_i$ as before, $S:=U$, and $T:=W$. The joint pdf $f$ of the order statistics $U=X\_{(1)},V=X\_{(i)},W=X\_{(n)}$ is given by
$$f(u,v,w)=\frac{n!}{(i-2)!(n-1-i)!}\,(v-u)^{i-2}(w-v)^{n-1-i}1(0<u<v<w<1)$$
for real $u,v,w$. The Jacobian determinant of the transformation $(z,s,t)\mapsto(u,v,w)$ that transforms $(Z,S,T)$ to $(U,V,W)=(S+(T-S)Z,S,T)$ is
$$\frac{\partial(u,v,w)}{\partial(z,s,t)}=s-t.$$
So, the joint pdf $g$ of $Z,S,T$ is given by
$$g(z,s,t)=|s-t| \\
\times\frac{n!}{(i-2)!(n-1-i)!}\,((t-s)z)^{i-2}((t-s)(1-z))^{n-1-i}
\\
\times 1(0<s<s+(t-s)z<t<1)\\
=(t-s)^{n-2} 1(0<s<t<1)\\
\times\frac{n!}{(i-2)!(n-1-i)!}\,z^{i-2}(1-z)^{n-1-i}
\\
\times 1(0<z<1)\\
$$
for real $z,s,t$.


Thus, $Z=Z\_i$ (is independent of $(S,T)=(U,W)=(X\_{(1)},X\_{(n)})$ and) has the beta distribution with parameters $i-1,n-i$.


