Spacing Between the Two Largest Exponentials

Expectation · Medium · Free problem

Let $X_1, X_2, \ldots, X_n$ be i.i.d. $\text{Exp}(\lambda)$ random variables. Denote the order statistics $X_{(1)} \le X_{(2)} \le \cdots \le X_{(n)}$, so $X_{(n)}$ is the maximum and $X_{(n-1)}$ is the second largest.

  1. Find the distribution of the spacing $D = X_{(n)} - X_{(n-1)}$.
  1. Compute $E[D]$.

Use the memoryless property and the classical representation of exponential spacings.

Hints

  1. Think about Renyi's representation: the normalized spacings of exponential order statistics are independent exponentials.
  2. The $k$-th normalized spacing is $(n - k + 1)(X_{(k)} - X_{(k-1)}) \sim \text{Exp}(\lambda)$. What does this give for $k = n$?
  3. For the top gap, only one variable competes beyond $X_{(n-1)}$, so the raw spacing has rate $\lambda \cdot 1 = \lambda$.

Worked Solution

How to Think About It: The exponential distribution has a beautiful structure for order statistics: the normalized spacings are independent exponentials. Specifically, if you define the gaps between consecutive order statistics and scale them by the number of "surviving" variables, you get independent exponential variables. The top spacing $X_{(n)} - X_{(n-1)}$ is the gap between the champion and the runner-up, and the key insight is that the champion's lead over the pack has a simple distribution thanks to the memoryless property.

Quick Estimate: For $n = 10$ and $\lambda = 1$: the maximum of 10 i.i.d. $\text{Exp}(1)$ variables has mean roughly $H_{10} \approx 2.93$ (the harmonic number), and the second largest is about $H_{10} - 1/10 \approx 2.83$. The expected gap should be around

/10$... but the spacing representation says $E[D] = 1/\lambda = 1$. That seems too large. Let's check: the spacing representation says the gaps $\lambda(X_{(k)} - X_{(k-1)})$ scaled by $(n - k + 1)$ are independent $\text{Exp}(1)$, so the raw gap $X_{(n)} - X_{(n-1)}$ has rate $\lambda \cdot 1 = \lambda$ (since only 1 variable competes for the top position). So $E[D] = 1/\lambda$, independent of $n$. This is a classic and surprising result.

Approach: Use Renyi's representation of exponential spacings.

Formal Solution:

Renyi's Representation: Define the normalized spacings: $D_k = (n - k + 1)(X_{(k)} - X_{(k-1)}), \quad k = 1, \ldots, n$ where $X_{(0)} = 0$. Then $D_1, D_2, \ldots, D_n$ are i.i.d. $\text{Exp}(\lambda)$.

The top spacing is: $X_{(n)} - X_{(n-1)} = \frac{D_n}{n - n + 1} = D_n$

Since $D_n \sim \text{Exp}(\lambda)$, we immediately get: $X_{(n)} - X_{(n-1)} \sim \text{Exp}(\lambda)$

Alternative derivation via memoryless property: Given $X_{(n-1)} = s$, the maximum $X_{(n)}$ is the largest of $n$ values, and exactly one of them exceeds $s$. By the memoryless property of the exponential, the overshoot of this one value beyond $s$ is again $\text{Exp}(\lambda)$, independent of $s$.

Expected value: $E[X_{(n)} - X_{(n-1)}] = \frac{1}{\lambda}$

This is remarkable: the expected gap between the two largest values does not depend on $n$ at all.

More generally, the spacing $X_{(k)} - X_{(k-1)}$ has distribution $\text{Exp}((n-k+1)\lambda)$, so: $E[X_{(k)} - X_{(k-1)}] = \frac{1}{(n-k+1)\lambda}$

The top gap ($k = n$) has the largest expected value

/\lambda$, while the bottom gap ($k = 1$) has the smallest expected value
/(n\lambda)$. This makes sense: near the bottom, values are densely packed (many competitors), while at the top, the leader can run away.

Answer: $X_{(n)} - X_{(n-1)} \sim \text{Exp}(\lambda)$ with $E[X_{(n)} - X_{(n-1)}] = 1/\lambda$. The gap between the two largest exponentials is itself exponential with the same rate, independent of $n$. This follows directly from Renyi's spacing representation or from the memoryless property.

Intuition

The result that the top spacing is $\text{Exp}(\lambda)$ regardless of $n$ is a direct consequence of the memoryless property. Once you condition on all $n$ values being at least as large as $X_{(n-1)}$, only one value actually exceeds that threshold. Since the exponential distribution forgets where it started, the overshoot of that one value is a fresh $\text{Exp}(\lambda)$. The number of other values crammed below is irrelevant.

This shows up in practice when modeling inter-arrival times, extreme values, or record-breaking events. For example, in a Poisson process framework, the gap between the last two arrivals in a window has the same distribution as a single inter-arrival time. It also explains why the maximum of $n$ exponentials grows like $\ln(n)/\lambda$ (from the harmonic series of spacing expectations) but the gap at the top stays order

/\lambda$ -- the leader's advantage does not shrink with more competitors.

Open the full interactive solver →