# Almost Sure convergence via a Simple Example/Counterexample

I'm a little confused about the concept of almost sure convergence in measure theory and was hoping to understand it better by discussing the following problem.

Say I have a sequence of random variables $(X_n)_{n \in \mathbb{N}}$ where each $X_n$ can only take the values 0 and 1 and where $\mathbb{P}(X_n = 1) = \frac{1}{n}$.

1) Is there a concrete example where $X_n \rightarrow 0$ almost surely.

2) Is there a concrete example where $X_n \not \rightarrow 0$ (i.e. $X_n$ does not demonstrate almost sure convergence to zero).

-

Assume that the random variable $U$ is uniform on $(0,1)$ and define, for every $n\geqslant1$, the Bernoulli random variable $X_n$ by the identity $$[X_n=1]=[U\leqslant1/n].$$ Then $\mathbb P(X_n=1)=1/n$ for every $n$, and $[X_n\to0]=[U\gt0]=\Omega$. In particular, $\mathbb P(X_n\to0)=1$.

Assume on the other hand that $(X_n)_n$ is independent. Then $\sum\limits_n\mathbb P(X_n=1)=\sum\limits_n1/n$ diverges hence Borel-Cantelli lemma implies that $[X_n=1\ \text{for infinitely many}\ n]$ has full probability. In particular, $\mathbb P(X_n\to0)=0$.

Still another example. Fix any sequence $(x_n)_n$ such that $0\lt x_n\leqslant1$ for every $n$ and the series $\sum\limits_nx_n$ diverges (in the present case, $x_n=1/n$ for $n\geqslant1$), and define recursively a sequence $(I_n)_{n}$ of intervals $I_n=[a_n,a_n+x_n]\subseteq[0,1]$ as follows:

• $a_1=0$.
• If $a_n+x_n\lt1$, then $a_{n+1}=\min\{a_n+x_{n},1-x_{n+1}\}$.
• If $a_n+x_n=1$, then $a_{n+1}=0$.

In words, $I_{n+1}$ starts where $I_n$ ends for every $n$ such that it is possible, otherwise, $I_{n+1}$ ends at $1$ and $I_{n+2}$ starts at $0$. For every $n$, define the Bernoulli random variable $X_n$ by the identity $$[X_n=1]=[U\in I_n].$$ Then $\mathbb P(X_n=1)=x_n$ for every $n$ and $[X_n=1\ \text{for infinitely many}\ n]=\Omega$ because the series $\sum\limits_nx_n$ diverges hence $I_n$ starts again at $0$ for infinitely many $n$ and the whole interval $[0,1]$ is covered infinitely many times by the intervals $I_n$. In particular, $\mathbb P(X_n\to0)=0$.

-