# Probability distribution function of the length of an interval taken from a uniform probabilty distribution.

This is a consequence of my suggested solution to this question.

Consider the probability distribution function that is uniform over the interval $[-a,a]$:

$$F(x)=\begin{cases} 0 & x \leq -a\\ \frac{x+a}{2a} & -a < x \leq a\\ 1 & x > a \end{cases}$$

Consider $n$ values taken from this distribution.

1. What is the probability distribution function for $l=x_{max}-x_{min}$?
2. I believe the Central Limit Theorem is applicable. Is it? If so, $\mu=0$ but what is $\sigma$?

Edit

@did has answered the question as posed, however, I don't have the knowledge to translate it into the specific solution I need for the original question. So, I will ask for how this translates to the specific. For

$$F(x)=\begin{cases} 0 & x \leq 0\\ \frac{x}{1-\delta} & 0 < x \leq 1-\delta\\ 1 & x > 1-\delta\end{cases}$$

where $\delta\le{1\over2}$

Consider $n$ values taken from this distribution.

What is the probability that $x_{max}-x_{min}\le\delta$?

If anyone would care to comment on the original question and the proposed approach, that would be appreciated too.

-

## 2 Answers

Re 1., assume for the sake of simplicity that the $n$ points are i.i.d. in $(0,1)$ then their minimum $m$ and their maximum $M$ are such that, for every $x\leqslant y$ in$(0,1)$, $\mathbb P(x\leqslant m, M\leqslant y)=(y-x)^n$. Differentiating twice yields the density of $(m,M)$ as $$f_{m,M}(x,y)=n(n-1)(y-x)^{n-2}\mathbf 1_{0\leqslant x\leqslant y\leqslant1}.$$ Let $L=M-m$, then $L=z$ if $m=x$ and $M=x+z$ for some $x$ in $(0,1-z)$ hence the density of $L$ is $$f_L(z)=n(n-1)z^{n-2}(1-z)\mathbf 1_{0\leqslant z\leqslant1}.$$ In terms of $\ell=x_{\mathrm{max}}-x_{\mathrm{min}}$ which corresponds to points in $(-a,a)$, $$f_\ell(t)=n(n-1)(2a)^{-n}t^{n-2}(2a-t)\mathbf 1_{0\leqslant t\leqslant 2a}.$$ I do not know what 2. means.

Edit: When $n\to\infty$, the asymptotics of $\ell$ is as follows. Define $$R_n=n\left(1-\frac{\ell}{2a}\right),$$ then $R_n$ converges in distribution to the sum of two independent standard exponential random variables (the gamma$(2,1)$ distribution), that is, $$f_{R_n}(r)\to r\mathrm e^{-r}\mathbf 1_{r\geqslant0}.$$ Edit bis: The PDF $f_L$ yields the CDF of $L$ since, for every $0\leqslant z\leqslant1$, $$\mathbb P(L\leqslant z)=\int_0^zf_L(t)\mathrm dt=[nt^{n-1}-(n-1)t^n]_0^z=(n-(n-1)z)z^{n-1}.$$ In particular, in the setting of the Edit to the question, for every $\delta\leqslant\frac12$ and every $n\geqslant2$, $$\mathbb P(x_{\mathrm{max}}-x_{\mathrm{min}}\leqslant\delta)=\mathbb P(L\leqslant\delta/(1-\delta))=(n-(2n-1)\delta)\delta^{n-1}/(1-\delta)^n.$$ Edit ter: The confusion underlying part 2. might be the following. Let $(x_k)_{1\leqslant k\leqslant n}$ denote a i.i.d. sample uniform on $(-a,a)$, then the central limit theorem asserts that $\frac1{\sqrt{n}}\sum\limits_{k=1}^nx_k$ converges in distribution to a normal random variable, centered with variance $\mathbb E(x_1^2)=\frac13a^2$. For example, for every $b\geqslant0$, $$\mathbb P(-b\sqrt{n}\leqslant x_1+\cdots+x_n\leqslant b\sqrt{n})\to\sqrt{\frac2\pi}\int_0^{b\sqrt3/a}\mathrm e^{-x^2/2}\mathrm dx.$$ But this concerns the empirical mean $\frac1n\sum\limits_{k=1}^nx_k$ of the sample, not its range $\ell=x_{\mathrm{max}}-x_{\mathrm{min}}$. The fluctuations of the range, as explained above, are described by an exponential distribution and not by a normal distribution.

-
I have added a link to the CLT - I am not a very good statistician but I am better at that then pure maths these days. – Dale M Jan 15 '13 at 23:07
If you don't mind some naive questions; Why do you say $\mathbb P(x\leqslant m, M\leqslant y)=(y-x)^n$? Why do you differentiate twice? – Dale M Jan 15 '13 at 23:13
The link does not help. CLT for what? – Did Jan 15 '13 at 23:17
The event $[x\leqslant m,M\leqslant y]$ means that $n$ points drawn from $(0,1)$ are all in $(x,y)$. This happens with probability... – Did Jan 15 '13 at 23:17
I was thinking that the n points could be thought of as a sample from the uniformly distributed population. In that case they would be normally distributed by the Central Limit Theorem. I may be well out of my depth! – Dale M Jan 15 '13 at 23:20

Here are my initial thoughts (might not be the right way to approach this problem):

The pdf of $U:=x_{\text{max}}$ is $$f_U(t)=\frac{n(a-t)^{n-1}}{(2a)^n}, \hspace{4mm}t \in(-a,a)$$ and the pdf of $V:=x_{\text{min}}$ is $$f_V(t)=\frac{n(t+a)^{n-1}}{(2a)^n}, \hspace{4mm}t \in(-a,a).$$ We want to know the pdf of $L=U-V$. So, define $M=U+V$. Then, we need the Jacobian of the transformation $$u=\frac{l+m}{2}, v=\frac{m-l}{2} \hspace{4mm} (\text{so}, J=1/2).$$ Then, the joint pdf of $L$ and $M$ is $$f_{L,M}(l,m)=f_{U,V}\bigg(\frac{l+m}{2},\frac{m-l}{2}\bigg)\cdot \bigg|\frac{1}{2}\bigg|.$$ The problem now is that we don't know the joint pdf of $U$ and $V$.

Maybe I'm thinking of this the wrong way...

-
Are $x_{\text{max}}$ and $x_{\text{min}}$ independent? If so, I think the method I typed might work out. – eeeeeeeeee Jan 15 '13 at 22:36