Variance of the number of balls between two specified balls Question:
Assume we have 100 different balls numbered from 1 to 100, distributed in 100 different bins, each bin has 1 ball in it.
What is the variance of the number of balls in between ball #1 and ball #2?
What I did:
I defined $X_i$ as an indicator for ball $i$ - "Is it in between balls 1 and 2?" Also I thought of the question as this problem: "We have actually just 3 places to put the 98 remaining balls: before, after and between balls #1,2, so for each ball there is a probability of 1/3 to be in between. So by this we have $E[X_i]= $$1 \over 3$ . Now $X=\sum _{i=1} ^{98} X_i$. Since $X_i$ is a Bernoulli RV then: $V(X_i)=p(1-p)=$$2 \over 9$.
But I know that the correct answer is 549 $8 \over 9$. I know that I should somehow use the formula to the sum of variances, but somehow I don't get to the correct answer.

If $X$ is the number of balls between the two labelled $0$ and $1$, clearly $X$ takes values between 0 and 98. The last value comes from the fact that if 0 is in bin 1 and 1 in bin 100 you have exactly 98 balls/bins between them, and this is the only way to get $X=98$. The other extreme case is $X=0$, so both 0 and 1 have to follow each other, and you have 99 ways to put them this way, so there are 99 ways to get $X=0$. 
Now for the probability: to get $X=98$ you need to get 1 at bin 1 and 0 and bin 100 and anything inbetween. Also, you have two ways of doing this:(0,1), (1,0). So the probability of $X=98$ is $2 \cdot\frac{1}{100} \cdot \frac{98}{99} \cdot \frac{97}{98} \cdots 1 =2 \cdot \frac{1}{100 \cdot 99} \cdot 1$ or replace $0$ with $1$). To get $X=97$ you either have $1x \cdots 0y$ or $x1 \cdots y0$, where $x,y$ are any number. The probability of this is $2 \cdot \bigg( \frac{1}{100 \cdot 99} +\frac{1}{99} + \frac{1}{98} \bigg)$. Ando so on. At hte end of the day the probability to have $k$ balls inbetween should be something like
$$
P(X=98)=2 \cdot \frac{1}{100 \cdot 99}\\
P(X=k)=2 \bigg(\frac{1}{100 \cdot 99} + \sum_{j=1}^{100-(k+2)}\frac{1}{100-j}\bigg), \ 0 \leq k \leq 97
$$
From this you should be able to find MGF, mean and variance.
