Throwing darts probability Assume a sequence from $1$ to $n$, with $e_i$ denoting the $i$-th element. We throw a dart
at random into the array: if we hit $e_i$ or $e_j$ then $X_{i,j}$ becomes $1$, if we hit between $e_i$ and $e_j$ then
$X_{i,j}$ becomes 0, and otherwise we throw another dart. Once $X_{i,j}$ is assigned a value, the game is over.  Assume $j>i$.
In other words, we keep throwing the darts until we hit one of the elements $e_i,e_{i+1},...,e_j$. If we hit either $e_i$ either $e_j$, $X_{i,j}$  is assigned a $1$ and the game is over. If we hit any of the elements $e_{i+1},...,e_{j-1}$, $X_{i,j}$  is assigned a $0$ and the game is over. If we hit any of the elements $e1,...e_{i-1},e_{j+1},...,e_n$, the game continues and we throw the dart again.
What is the probability of 
$$P(X_{i,j}=1)=\phantom{} ?$$
Let $E$ be the event of a hit between $e_i$ and $e_j$ (including these two elements), meaning that the $X_{i,j}$ has become either $0$ either $1$ and the game has finished. In th event of $\bar{E}$, the dart is thrown again.
Than
$$P(X_{i,j}=1 | E)=\frac{2}{j-i+1}$$
Thus, we know what the probability of $X_{i,j}=1 $, given that the game has ended. How to deduce the overall probability that $X_{i,j}=1 $?
If we turn to Bayes, we have
$$P(X_{i,j}=1)=\frac{P(X_{i,j}=1\cap E)}{P(E|X_{i,j}=1)}$$
But we know
$$P(E|X_{i,j}=1)=1$$
Thus
$$P(X_{i,j}=1)=P(X_{i,j}=1|E)P(E)$$
But the text I am reading states

At each step, the probability that $X_{i,j}= 1$
  conditioned on the event that the game ends in that step is exactly $\frac{2}{j-i+1}$. Therefore, overall,
  the probability that $X_{i,j}=1$ is $\frac{2}{j-i+1}$.

Where am I making the mistake?

The game is a sequence of trials, each one of three states, $A_t,B_t,C_t$.   State $A_t$ is that $\{X_{i,j}=1\}$ , state $B_t$ that $\{X_{i,j}=0\}$ and state $C_t$ that the value is undefined, for a given trial of the game, $t$.
Assuming each section of the array is equally likely to be hit, and the space "between" $e_i, e_j$ are the sections $e_{i+1},\ldots,e_{j-1}$ then 
$$\mathsf P(A_t)= 2/n, \mathsf P(B_t)=(j-i-1)/n, \text{ and }\mathsf P(A_t\cup B_t)=(j-i+1)/n$$
So $$\mathsf P(A_t\mid A_t\cup B_t)= 2/(j-i+1)$$
This is the probability that the game will be in the favoured state, given that the game is in the end state.   Since the game will end on the first independent trial where the end state happens, which will eventually happen, then: $$\begin{align}\mathsf P(A_N)&=\mathsf P(A_N\cap(A_N\cup B_N))\\&=\mathsf P(A_N\mid(A_N\cup B_N))\cdot\mathsf P(A_N\cup B_N) \\ &= \frac 2{j-i+1}\cdot 1\end{align}$$
(Although the argument that $\mathsf P(A_N\mid(A_N\cup B_N))=\mathsf P(A_t\mid(A_t\cup B_t))$ irrespective of $N$ being the end trial is a mite circular.)

More formally we might say that the probability the game ends in state $A$ is, by the law of probability, the series of probabilities that it is in state $A$ on a trial after being in state $C$ for all previous trials, for all possible trials.
$$\begin{align}\mathsf P(A_N) & = \sum_{t=1}^\infty \mathsf P(A_t\cap\bigcap_{s=1}^{t-1} C_s) \\  &= \sum_{t=1}^\infty \mathsf P(A_t)\prod_{s=1}^{t-1}\mathsf P(C_s) \\&= \frac{2}{n}\sum_{t=1}^\infty\left(1-\frac{j-i+1}{n}\right)^{t-1} \\&= \frac 2n\cdotp\frac{n}{j-i+1}\end{align}$$
Thanks to the Geometric series (which you apparently figured out while I was typing this up while distracted... $\ddot\frown$)
