# An example of a sequence of random variables in Wikipedia, that converges in probability but not almost surely

This Wikipedia page says that the sequence of random variables $X_n$ that assume $1$ with probability $1/n$ and assume $0$ with probability $1 - 1/n$ converges to $0$ in probability but not almost surely. I can't understand why it does not converge to $0$ almost surely. $$P(\lim_{n\to\infty}X_n = 0) = \lim_{n\to\infty}(1-1/n)=1.$$ What is wrong with the above equations? To be more concrete, with uniform probability on $[0,1]$, define $X_n(x)=1$ when $0\leqslant x \leqslant 1/n$ and $X_n(x)=0$ when $1/n < x \leqslant 1$. Then $(\lim_{n\to\infty}X_n)(0)=1$ and $(\lim_{n\to\infty}X_n)(x)=0$ for $0<x\leqslant 1$. So, $P\{x:(\lim_{n\to\infty}X_n)(x)=0\} = 1$ and $X_n$ converges to 0 almost surely.

-

You left out the very important word "independent". Your random variables are not independent.

-
Thank you. Good point! I didn't think about dependencies. But I can't imagine a concrete example of independent random variables with the properties described by the Wikipedia article. I would appreciate if you provide one. –  Diav Dec 24 '12 at 7:07
At step $n$, you choose a random point $Y_n$ (independent of previous choices) in the interval $[0,1]$. If $Y_n \le 1/n$ then $X_n = 1$, otherwise $X_n = 0$. –  Robert Israel Dec 24 '12 at 7:57
Or if you want your probability space to be the interval $J = [0,1]$, define a tree of subintervals $A_s$ of $J$ indexed by finite strings of $0$'s and $1$'s, so that $A_1 = J$, $A_0 = \emptyset$; for $s$ of length $n$, $A_s$ is the disjoint union of $A_{s0}$ and $A_{s1}$ where $m(A_{s0}) = (1-1/(n+1)) m(A_s)$ and $m(A_{s1}) = 1/(n+1) m(A_s)$. Then $X_n(\omega) = 1$ iff $\omega \in A_{s1}$ for some $s$ of length $n-1$. –  Robert Israel Dec 24 '12 at 8:09