We have $n$ houses, $n\geq 2$, that are set in a straight line, such that the distance between any two neighboring houses is $a\in (0, \infty)$. A resident from a randomly chosen house goes on a visit to some other house from the neighborhood (so he can't go to his own house). What is the expected length of the path he takes?
Firstly I defined a random variable X for tracking the probability of a given length and also an event $A_i$: we begin in the "i-th" house. Obviously the probability of $A_i$ is $\frac{1}{n}, \forall i\in\{1, \dots ,n\}$.Then I decided to split the problem into two cases, one where $n$ is even and when $n$ is odd.
Beggining with the option of $n$ being even, I firstly looked at $X\vert A_1$ and $X\vert A_n$. Length of path ranges from $a$ all the way to $(n-1)a$, with every option having a probability of $\frac{1}{n-1}$. The excpected value of these two respectively being $\frac{an}{2}$. Then I went onto $X\vert A_2$ (where length $a$ has a probability of $\frac{2}{n-1}$, others stay the same) and so on, but couldn't find any good patterns for $E(X\vert A_j), j\in\{2,\dots , n-2\}$.
So this is where I am stuck and thats only case where $n$ is even.
As a side note, theres a hint given to use the formula $\sum_{i=1}^n i^2=\frac{n(n+1)(2 n+1)}{6}$, but I don't know where it comes into play. Any help is greatly appriciated!