There are $n$ people in a queue. You randomly select two of them. What is the expected number of people standing in between them?
I noticed that the question can be reformulated in the following way. Let $X$ and $Y$ be discrete random variables that can take values between $1$ and $n$. What is $\mathbb{E}(|X-Y|-1 \text{ given that $X\neq Y$})$?
Unfortunately, this didn't seem to get me anywhere. I also considered what the probability was for small values of $n$. Let $Z$ be the number of people standing in between the two people. For $n=2$, $Z=0$ trivially. For $n=3$, there is a two-thirds chance that the people are standing next to each other, and a one-third chance that they are on either side of the queue. So $E(Z)=\frac{2}{3}\cdot0+\frac{1}{3}\cdot1=\frac{1}{3}$. I also calculated it for $n=4$, but stopped after that point since the calculations were getting unwieldy.
Could anyone hint at what approach I could use instead?