While learning about the Borel-Cantelli Lemma, I came across this article and I am having trouble following the Introduction. I cite the relevant text here:
Consider an infinite sequence of games, where in game $n$ one loses $2^n$ dollars with probability $\frac{1}{2^n+1}$ and win a dollar with probability $\frac{2^n}{2^n+1}$. Even though the expected value is 0, for all $n$, if we sum over $n$ the probability that a person will lose in game $n$, we will find the total number of expected losses. For example, if we take the integral from 0 to infinity for $\frac{1}{2^n+1}dn$ , we will find that $\int_{0}^{\infty}\frac{1}{2^n+1}dn=1$. We expect to lose a single time, even though we play into infinity and there always exists a non-zero probability of losing.
My reasoning to find the expected number of losses would be:
Let $X_n$ be the result in a game $n$ where $X_n=1$ if it is a loss and 0 if it is a win. Then define $Y_n$ as the number of losses for $n$ games. If we then want to find the expected number of losses in infinite games: $\lim_{n\to\infty}E[Y_n] = \lim_{n\to\infty}\sum_{1}^{n}E[X_n] = \sum_{n=1}^\infty\frac{1}{2^n+1}$ .
That would have been my reasoning, to apply the linearity of expectations.
So first of all I don't know where my reasoning fails and second, I do not understand the integral in the quoted text nor its meaning. Could you please help me understand?