Let $S_n = \{ 1, 2, \ldots, n \}$. For every non-empty subset $S$ of $S_n$, denote $$\Delta_S = \max S - \min S.$$
What is the expected value of $\Delta_S$ ?
We can compute this as follows. We can form every nonempty subset by first picking a maximum value $k$, then a minimum value $j$ such that $j \le k$. For the calculation, we can ignore the cases where $j = k$ since $\Delta_S = 0$ in that case. Thus, the expected value of $\Delta_S$ is
$$\frac{1}{2^n - 1} \sum_{k = 1}^n \sum_{j = 1}^{k - 1} (k - j) 2^{k - j - 1}. $$
Evaluating this sum, we get
$$\mathbb{E}[\Delta_S] = \frac{(n - 3)2^n + (n + 3)}{2^n - 1}.$$
While trying to understand the behavior of this quantity, I noticed that
$$\lim_{n \rightarrow \infty} n - \mathbb{E}[\Delta_S] = 3.$$
This result is very unintuitive to me. Can anyone provide an insight to why such a beautiful and surprising fact holds?
$\Delta$ only depends on the extremal values. By counting these 'extremal probabilites', we have $P(\Delta=n-1) = P(1\in S, n\in S)=1/4$, $P(\Delta=n-2)=P(1\notin S,2\in S, n\in S) + P(1\in S, n-1\in S, n\notin S)=2 \times 2^{-3}$, etc... so $P(\Delta=n-k)= k \times 2^{-(k+1)}$ for $k<n/2$. The average of $n-\Delta$ converges as $n\rightarrow \infty$ to $$ \sum_{k\geq 1} k^2 2^{-(k+1)} =3 .$$ (Thanks to Did for checking)