Subinterval of an interval that has exponential distributed length Let $AB$ be an interval such that its length |AB| is an exponential random variable. Let choose independently two uniformly random points $C,D$ in $AB$. Which is the distribution of the length $|CD|$?    
 A: Let's denote the length $|AB|$ by $L$. $L$ is exponentially distributed, and without loss of generality, we can take the parameter of that exponential distribution to be 1. (If it's something other than 1, we can always rescale the final result to take that into account.) Thus the probability density function (pdf) of $L$ is
\begin{equation}
f(L) = 
\begin{cases}
\mathrm{e}^{-L} & L \ge 0 \\
0 & \text{else}
\end{cases}\, .
\end{equation}
For any fixed $L$ which has been selected from this distribution, we imagine selecting the positions of points $C$ and $D$ uniformly and independently from $[0,L]$. Let's denote the length $|CD|$ by $x$. $x$ is the absolute value of the difference between two independent, uniform random variables. Such a quantity has a half-triangular distribution. In particular, the pdf of $x$ given $L$ (which we'll call $g(x|L)$) is
\begin{equation}
g(x | L) = 
\begin{cases}
\frac{2}{L}\left(1 - \frac{x}{L}\right) & 0 \le x \le L \\
0 & \text{else}
\end{cases}\, .
\end{equation}
The joint pdf of $x$ and $L$ together is $f(L)\, g(x|L)$. The pdf that the original question is asking for is the marginal pdf of $x$ alone, which we'll (arbitrarily) call $h(x)$. This is given by
$$
h(x) = \int_0^{\infty} dL\, f(L)\, g(x|L)\, .
$$
Note that since $g(x|L) = 0$ for $L \le x$, the actual limits of the integration are $x$ to $\infty$. Using this fact, and inserting the two expressions above for $f(L)$ and $g(x|L)$, we obtain the following integral:
$$
h(x) = 2 \int_x^{\infty} dL\, \left(\frac{1}{L} - \frac{x}{L^2}\right) \mathrm{e}^{-L}\, .
$$
This integral admits no elementary solution. However, note the definition of the incomplete gamma function given here. Armed with this, we find as the final answer:
$$
h(x) = 2\Bigl[\Gamma(0,x) - x\, \Gamma(-1, x)\Bigr]\, .
$$
This is a very odd distribution. It has a logarithmic divergence at $x = 0$. After that, it is monotonically decreasing in x, and for large $x$ it looks like $2\mathrm{e}^{-x} / x^2$. Other things to note about this pdf are that 1) It is not a Gamma distribution, and 2) That it is by no means obvious.
I performed my own simulation with ${10}^6$ samples to check this result. For each sample, I randomly selected a length $L$ from the exponential distribution, then randomly selected two points uniformly from $[0,L]$, and took the distance between these two points. I don't know how to post an image here, so you'll have to take my word that the resulting histogram agrees perfectly with the above expression for $h(x)$.
Furthermore, one can show that the mean of this pdf is $1/3$, in agreement with Bruce Trumbo's simulation, and that the standard deviation associated with this pdf is $\sqrt{2}/3 \sim 0.471405$, also in agreement with Bruce Trumbo's simulation.
A: A simulation for the case where the exponential distribution has unit rate (and mean).
Without loss of generality, it seems the interval can extend from the origin to
a random point $X$ from EXP(1). (So $A = 0$ and $B = X$). 
After simulating $X$, one simulates two independent points randomly within $(0, X)$, and then
finds the distance $D$ between these points.
In R, one simulation of this experiment can be done as follows:
 lam = 1;  x = rexp(1, lam);  u = runif(2, 0, x);  d = abs(diff(u))

Results from one run are:
 x = 2.048869, $\mathbf{u}$ = (0.3766043, 1.6886756), d = 1.312071

On average $X$ will be one unit long, and on average the two points
will cut the interval into thirds, so intuitively one might anticipate $E(D) = 1/3$.
The following program does this experiment 100,000 times, summarizes
numerical results, and makes a histogram.
  set.seed(1234); m = 10^5;  d =  numeric(m); lam = 1
  for (i in 1:m) { x = rexp(1, lam);  d[i] = abs(diff(runif(2, 0, x)))  }
  mean(d);  sd(d);  hist(d, prob=T)

For the seed shown, the mean of the simulated D's is 0.3337367 (consistent with 1/3 within
simulation error, as anticipated) and the standard deviation is 0.4694592. The histogram (not reproduced here) shows
a strongly right-skewed distribution, but I have been unable to verify whether
a member of the gamma family is a good fit. I tried several possibilities, and some came "close" to fitting, but all were overwhelmingly rejected by a Kolmogorov-Smirnov goodness-of-fit test.
Addendum 1: For what it may be worth to simplify the math, it seems to me that the distance from the origin to the smallest $U_i$ may have the same distribution as the
distance between the two uniformly generated points. In a program modified to capture both, a K-S test finds no difference between these two simulated distributions.
Addendum 2: If $X_1, X_2, X_3$ IID GAMMA(1/3, 1), then $Y = X_1 + X_2 + X_3$ ~ EXP(1). However, the problem described here is not a trivial reverse of that. On further simulation, I confirmed that the three distances $D_1$ before the smallest uniform,
$D_2$ between the two uniforms, and $D_3$ after the largest, are significantly correlated: $Cor(D_i, D_j) \approx .25$, for $i \ne j$.
