TITLE: Joint distribution of order statistics $X_{(n)}-X_{(1)}$
QUESTION [1 upvotes]: Let $X_i \sim U(0,1)$ and $X_{(k)}$ be a k-th order statistic. Then we know that $X_{(k)} \sim Beta(k,n-k+1)$, which has a pdf $$f_{X_{(k)}}(x)=\frac{x^{k-1}(1-x)^{n-k}}{\int_0^1 x^k (1-x)^{n-k}dx}$$
We'll denote the denominator as $B(k,n-k+1)$
We'll try to find the joint density of $X_{(n)}-X_{(1)}$ by the convolution method:
\begin{align}
P[X_{(n)}-X_{(1)} \le z] &= \int_0^1 \int_0^{z+y} f_{X_{(1)}}(y)f_{X_{(n)}}(x) \,dx \,dy \\
&= \int_0^1 \int_0^{z+y} \frac{y^{1-1} (1-y)^{n-1}}{B(1,n-1)} \frac{x^{n-1}(1-x)^{n-n}}{B(n,1)}\,dx\, dy \\
&=\int_0^1 \frac{(1-y)^{n-1}(z+y)^n}{n B(1,n-1)B(n,1)}\,dy
\end{align}
What now? Integration by parts

REPLY [1 votes]: As noted in comments, your solution is wrong because it treats as independent two random variables that are not independent.
Let $I$ be the index among $1,\ldots,n$ such that $X_{(1)}=X_I$.  Then
\begin{align}
& \phantom{{}=}\Pr(X_{(n)}-X_{(1)}\le z \mid X_{(1)}=x\text{ and }I=i) \\[10pt] 
& = \Pr(\forall j\ne i,~X_j\le x+z\mid \forall j\ne i,~x=X_i\le X_j) \\[10pt]
& = \frac{z^{n-1}}{(1-x)^{n-1}}.
\end{align}
Therefore
\begin{align}
& \phantom{{}=} \Pr(X_{(n)}-X_{(1)}\le z) = \mathbb E(\Pr(X_{(n)}-X_{(1)}\le z\mid X_{(1)}, I)) \\[10pt]
& = \mathbb E\left( \frac{z^{n-1}}{(1-X_{(1)})^{n-1}}\right) = \int_0^1 \frac{z^{n-1}}{(1-x)^{n-1}} f_{X_{(1)}}(x) \,dx.
\end{align}
Can you take it from there?
{"set_name": "stack_exchange", "score": 1, "question_id": 421730}