Assume I have $n$ points sampled independently from the uniform distribution on the unit interval. After ordering the sample I get the points $X_1, X_2, \dots X_n$ such that $X_1 \leq X_2 \leq \dots \leq X_n$. According to the order statistics the distances are beta-distributed:

$$Y_{jk} = X_k - X_j \sim \text{Beta}(k-j,n-(k-j)+1), \quad k >j.$$

Now, I have some constant threshold value $d$ and need to calculate the following probability:

$$p = \mathbb{P}[(Y_{12} \leq d)\,\,\text{and}\,\, (Y_{13} > d)]$$

Using the rules of probability calculus I get

$$p = 1 - \mathbb{P}[Y_{12} > d] - \mathbb{P}[Y_{13} \leq d] + \mathbb{P}[(Y_{12} > d)\,\,\text{and}\,\, (Y_{13} \leq d)] = 1 - \mathbb{P}[Y_{12} > d] - \mathbb{P}[Y_{13} \leq d]$$

Here I have used the fact that $(Y_{12} > d)$ and $(Y_{13} \leq d)$ are mutually exclusive events in order statistics. The final probability $p$ can be calculated using the CDF of the beta distribution.

Now, I'm stuck in calculating a more complex probability:

$$\mathbb{P}[(Y_{12} > d)\,\,\text{and}\,\, (Y_{23} \leq d)\,\,\text{and}\,\, (Y_{24} > d)].$$

Could someone help me in solving the problem.

  • 1
    $\begingroup$ You need to compute the joint distribution of $(Y_{12},Y_{23},Y_{34})$ since $Y_{24}=Y_{23}+Y_{34}$. $\endgroup$
    – Xi'an
    May 16, 2022 at 14:41
  • $\begingroup$ @Xi'an Do I really need that? I believe there could be an other way since I was able to calculate my $p$ without computing the joint distribution of $(Y_{12}, Y_{23})$. $\endgroup$
    – Krivoi
    May 16, 2022 at 14:46

1 Answer 1


Because the density function of the joint distribution of the first four order statistics $(Y_{(1)}, Y_{(2)}, Y_{(3)}, Y_{(4)})$ is

$$f_(y_1,y_2,y_3,y_4) = \frac{n!}{(n-4)!} (1-y_4)^{n-4}\, \mathcal{I}(0 \le y_1 \le y_2 \le y_3 \le y_4 \le 1)$$

and $Y_{ij} = Y_{(j)} - Y_{(i)},$ the probability in question is

$$\begin{aligned} &\Pr(Y_{12}\ge d, Y_{23} \le d, Y_{24} \gt d) \\ &= \int_{\mathbb R} \cdots \int_{\mathbb R} f(y_1,y_2,y_3,y_4)\,\mathrm{d}y_1 \cdots \mathrm{d}y_4 \\ &= \frac{n!}{(n-4)!}\int_{\max(y_3, \min(1,y_2+d))}^1\int_{y_2}^{\min(1, y_2+d)}\int_{\min(1,y_1+d)}^1\int_0^1(1-y_4)^{n-4}\,\mathrm{d}y_1 \cdots \mathrm{d}y_4\\ &= n d (1-2d)^{n-1} \end{aligned}$$

for $0 \le d \le 1/2$ and $n\ge 4.$

This is supported by simulations, as in this example based on $10^5$ independent samples of size $n=5:$


The points show the simulation results, in comparison with the red graph of the computed probability.

You can work out the answers to comparable questions the same way, although evidently the calculations will become more complicated as more order statistics are involved in the description of the event.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.