Stochastic variable exercise: People between me and my friend. This is the exercise:
$n$ people are arraged randomly in a line (not a circle), among which are yourself and a friend.
Call $Y$ the number of people that are between you and your friend.
Show: $E[Y] = \frac{n-2}{8}$.
This is how I started:
There are $P_n = n!$ ways to arrange $n$ people in a line.


*

*The amount of ways to arrange them so that there are $0$ people between me and my friend is $n-1$ (the indexes of our positions) times $P_{n-2}$ (the amount of ways to put the rest in the remaining places: $n-1 \cdot P_{n-2}$.

*The amount of ways to arrange them so that there is $1$ person between us is $n-2\cdot P_{n-3}$

*... $2$ people in between: $n-3 \cdot P_{n-4}$ times the amount of ways to arrange those two people: $P_{2}$: $n-3 \cdot P_{n-4} \cdot P_{2}$.

*... $i$ people in between: $(n-1-i) \cdot P_{n-2-i} \cdot P_{i}$.


$E[Y]$ is then calculated as follows:
$$
E[Y] = \sum_{i=0}^{n-2}i \cdot \frac{(n-1-i) \cdot P_{n-2-i} \cdot P_{i}}{n!}
$$
This is where I'm stuck. First of all: is this correct up until this point? Second: How do I proceed to show that this equals $\frac{n-2}{8}$?
EDIT: It should indeed be $\frac{n-2}{3}$.
 A: Call the rest of the people $P_1$ to $P_{n-2}$.
For $i=1$ to $n-2$, define the indicator random variable $X_i$ by $X_i=1$ if person $P_i$ is betwee me and my friend. Let $X_i=0$ otherwise. Then the number $Y$ of people between me and my friend is given by $Y=X_1+\cdots +X_{n-2}$.
By the linearity of expectation we have $E(Y)=E(X_1)+\cdots+E(X_{n-2})$.
But by symmetry $\Pr(X_i=1)=\frac{2}{3!}=\frac{1}{3}$, so $E(Y)=\frac{n-2}{3}$.
A: A different method to those already given... 
In any arrangement of $n$ people, the positions of you and your friend split the remaining $n-2$ people into three groups:
\begin{eqnarray*}
G_1 &:& \text{those between you and your friend} \\
G_2 &:& \text{those to the left of you both} \\
G_3 &:& \text{those to the right of you both}.
\end{eqnarray*}
Let random variable $X_i$ be the number of people in $G_i$. Each of the $n-2$ people is equally likely to be in any of these three groups. So $X_i$ are identically distributed. So we have $E(X_1)=E(X_2)=E(X_3)$.
Also, $X_1+X_2+X_3 = n-2$ (a constant). Therefore,
\begin{eqnarray*}
n-2 &=& E(X_1+X_2+X_3) \\
&=& E(X_1)+E(X_2)+E(X_3) \\
&=& 3E(X_1) \\
\therefore\quad E(X_1) &=& \dfrac{n-2}{3}\qquad \text{which is what we require.}
\end{eqnarray*}
A: Your argument doesn't work, when you say for $i$ people between you and your friend there are $2.(n-1-i)$ (there is a $2$ because you then your friend or your friend then you) and then you can permute all the remaining people (you were just permutting those between you and your friend on hand and the other people on the other hand) so :
$$P(Y=i)=\frac{1}{n!}2\times (n-1-i)\times (n-2)!$$
Finally :
$$E[Y]=\sum_{i=0}^{n-2}i P(Y=i)=\frac{(n-2)!}{n!}\times 2\sum_{i=0}^{n-2}i(n-1-i) $$ 
$$E[Y]=\frac{(n-2)!}{n!}\times 2((n-1)\sum_{i=0}^{n-2}i-\sum_{i=0}^{n-2}i^2) $$ 
$$E[Y]=\frac{1}{(n-1)n}\times 2((n-1)\frac{(n-2)(n-1)}{2}-\frac{(n-2)(n-1)(2n-3)}{6}) $$ 
$$E[Y]=\frac{1}{n}((n-2)(n-1)-\frac{(n-2)(2n-3)}{3}) $$
$$E[Y]=\frac{n-2}{n}((n-1)-\frac{(2n-3)}{3})=\frac{n-2}{n}\frac{n}{3}=\frac{n-2}{3} $$  
Well it is not the result you are asked to find but to back up my result I suggest that you look at the cases $n=3$ and $n=4$. You get :
For $n=3$ two configurations with one people between and four with no people between.
For $n=4$ twelve configurations with no people between, eight with one people between and four with two people between. 
This gives the formula $E(Y)=\frac{n-2}{3}$ in both cases.
