# Finding the distribution of sample range for a Beta population

Let $$X_1,X_2,\ldots,X_n$$ be i.i.d random variables having density

$$f(x)=2(1-x)\mathbf1_{0

I am trying to derive the distribution of the sample range $$R=X_{(n)}-X_{(1)}$$.

The usual way I do these problems is to first find the joint density of $$(R,S)$$ taking $$S=X_{(1)}$$, and then find the distribution of $$R$$ as a marginal density. This is quite straightforward in general because we know the joint distribution of $$(X_{(1)},X_{(n)})$$. For this particular problem however, the integration to find the marginal pdf is pretty cumbersome to evaluate by hand.

For absolutely continuous distributions, it is easily shown via a change of variables that the joint density of $$(R,S)$$ is given by

$$f_{R,S}(r,s)=n(n-1)(F(r+s)-F(s))^{n-2}f(s)f(r+s)\mathbf1_{s

, where $$F$$ is the population distribution function.

So here I have after simplification

$$f_{R,S}(r,s)=4n(n-1)(r(2-2s-r))^{n-2}(1-s)(1-r-s)\mathbf1_{0

That means the pdf of $$R$$ for $$0 should be

\begin{align} f_R(r)&=\int_0^{1-r}f_{R,S}(r,s)\,ds \\&=4n(n-1)r^{n-2}\int_0^{1-r}(2-2s-r)^{n-2}(1-s)(1-r-s)\,ds \end{align}

Now I integrate by parts $$I=\int_0^{1-r}(2-2s-r)^{n-2}(1-s)(1-r-s)\,ds$$

noting that $$d\,[(1-s)(1-r-s)]=(2s+r-2)\,ds$$

Skipping some details, I get

\begin{align} I&=\left[(1-s)(1-r-s)\frac{(2-2s-r)^{n-1}}{2(1-n)}\right]_0^{1-r}+\int_0^{1-r}\frac{(2-2s-r)^n}{2(1-n)}\,ds \\\\&=\frac{(r-1)(2-r)^{n-1}}{2(1-n)}-\frac{1}{4(1-n)}\int_{2-r}^{r}t^n\,dt \\\\&=\frac{(r-1)(2-r)^{n-1}}{2(1-n)}+\frac{1}{4(n^2-1)}\left[r^{n+1}-(2-r)^{n+1}\right] \end{align}

It might not seem so, but doing this by hand and writing down every step took a fair amount of time.

Finally, I get the pdf of $$R$$ as

$$f_R(r)=4n(n-1)r^{n-2}\left[\frac{(r-1)(2-r)^{n-1}}{2(1-n)}+\frac{1}{4(n^2-1)}\left\{r^{n+1}-(2-r)^{n+1}\right\}\right]\mathbf1_{0

Honestly, after the tedious computation, I don't know if I want to check that this integrates to $$1$$ or not (without using software that is). So I don't know if this answer even makes sense.

I would like to know of any alternative procedure to solve the problem, and perhaps a more efficient way. I think the CDF method results in almost the same complexity.

• I can confirm the same result using mathStatica (so am confident your working is correct). – wolfies Nov 6 '18 at 16:00
• About the only simplification I can suggest--and it's truly a tiny one--is to recognize that the operation $X\to 1-X$ preserves the range while converting the density into $2x\mathcal{I}(0\lt x\lt 1).$ This makes the integrations ever so slightly easier. Asymptotic expressions are readily available, though. – whuber Nov 7 '18 at 14:52

• here's the wikipedia page for the beta distribution... "The beta distribution has an important application in the theory of order statistics. A basic result is that the distribution of the kth smallest of a sample of size n from a continuous uniform distribution has a beta distribution.[51] This result is summarized as: $U_{(k)}$~$\beta$(k, n+1-k) From this, and application of the probability integral transform, the distribution of any individual order statistic from any continuous distribution can be derived." en.wikipedia.org/wiki/Beta_distribution – Rosalie Nov 7 '18 at 19:31