Probability that the difference of the max and min of three random numbers between 0 and 2 is less than 1/4? Three numbers are chosen at random between 0 and 2. What is the probability that the difference between the largest number and the least number is less than 1/4?
This is a problem from JHMT Calculus 2011. I'm trying to see if there are any better solutions than the one provided.
Here is the solution provided:


 A: Basically along the same lines as provided answer. 
First note that the answer won't change if we assume $X_1,X_2,X_3$ are IID $\mbox{U}[0,1]$, and we're asking what is the probability that the difference between the maximum and the minimum is at most $\frac 18$. 
More generally, suppose that $X_1,\dots,X_n$ are IID $\mbox{U}[0,1]$, and we're asked for the probability that the difference between the maximum and minimum is at most $\alpha$.  The answer then is 
$$ n  \times \int_0^1 P( \bigcap_{j=2}^n  \{t<X_j < t+\alpha\}|X_1=t) dt =  n \times \int_0^1 \min (\alpha,1-t)^{n-1} dt.$$ 
The expression on the right is 
$$ n \times \left (  \alpha^{n-1}\times (1-\alpha) +  \int_0^\alpha u^{n-1} du\right)=n \alpha^{n-1} (1-\alpha) + \alpha^n = n \alpha^{n-1} -(n-1) \alpha^n. $$ 
In the case $n=3$ and $\alpha=\frac 18$, this formula gives $\frac{11}{256}$. 
A: Given:  parent random variable $X \sim \text{Uniform}(0,2)$ with pdf $f(x)$:

Order Statistics
A more general framework for solving such problems is to use order statistics. In particular, given a random sample of size $n$ drawn on parent $X$, the joint pdf of the sample minimum (the $1^{\text{st}}$ order statistic) and sample maximum (the $n^{\text{th}}$ order statistic), say $g(x_1, x_n)$ is:

where I am using the OrderStat function from the mathStatica package for Mathematica to automate the mechanics. We could just as easily find the joint pdf of the $2^{\text{nd}}$ and $n^{\text{th}}$ order statistics in the same way, or indeed any combination of 3 or more such ordered variables.
In this instance, we seek $P(X_n - X_1 < \frac14)$: 

When the sample size $n = 3$, this is equal to $\frac{11}{256}$.
Notes


*

*The Prob function used above is also from mathStatica. As disclosure, I should add that I am one of the authors.

