Find a sequence of random variables $(X_n)$ with $\lim E(X_n^2) = 0$ but not obeying SLLN I am looking for some sequence of random variables $(X_n)$ such that 
$$ \lim_{n \rightarrow \infty} E(X_n^2) = 0  $$
but such that the following almost sure convergence does NOT hold:
$$ \frac{S_n - E(S_n)}{n} \rightarrow 0$$
where the $S_n$ are the partial sums of the $X_n$.
Note: for any such sequence the convergence in probability will always hold; if the random variables are not correlated, so will the convergence almost surely. In particular, any counterexample must consist of correlated random variables.
Many thanks for your help.
 A: Here is an algorithm which gives you such a sequence. Let us work on the probabilised space $[0,1)$ with the Lebesgue measure.
For all $0 \leq k < n$, let $I_{k,n} := [k/n, (k+1)/n)$. Fix $\varepsilon \in (0,1)$
Start from $n = 1$, $k=0$, time $N=0$.
If $S_N < \varepsilon N$ on $I_{k,n}$, take $X_N = 1_{I_{k,n}}$. 
Else : 


*

*if $k < n-1$ : increment $k$ by $1$.

*if $k = n-1$ : increment $n$ by $1$, put $k=0$.
Rince and repeat, incrementing $N$ by $1$.
Now, for all $k,n$, we only need a finite time before $S_N \geq \varepsilon N$ on $I_{k,n}$ (the times at which these conditions are satisfied successively grow exponentially, though). Hence we will eventually increment $k$, and then $n$. Since any point in $[0,1)$ is in infinitely many $I_{k,n}$, that means that almost surely, $S_N \geq \varepsilon N$ for infinitely many $N$.
On the other hand, $\mathbb{E} (X_N) = \mathbb{E} (X_N^2)$ will converge to $0$. Hence, $\mathbb{E} (S_N)$ grows sub-linearly, so that almost surely, $S_N - \mathbb{E} (S_N) \geq \varepsilon N/2$ for infinitely many $N$s.
A: Let $\left(Y_N\right)_{N\geqslant 1}$ be an i.i.d. sequence such that $\Pr\left(Y_N=1\right)=\Pr\left(Y_N=-1\right)=1/(2N)$ and $\Pr\left(Y_N=0\right)=1-1/N$. Let $\left(n_k\right)_{k\geqslant 1}$ be a strictly increasing sequence of integers that will be specified later. For $n_N\leqslant i\leqslant n_{N+1}-1$, define $X_i:=Y_N$. Since each random variable $X_i$ is centered, it suffices to prove that $S_n/n$ does not converge to $0$ almost surely. Observe that 
$$
S_{n_l}=\sum_{N=1}^{l-1}\sum_{i=n_N}^{n_{N+1}-1}X_i=\sum_{N=1}^{l-1} \left(n_{N+1}-n_N\right)Y_N,
$$
hence $$
\frac{S_{n_l}}{n_l}=\left(1-\frac{n_l}{n_{l+1}}\right)Y_l+n_{l}^{-1}\sum_{N=1}^{l-2} \left(n_{N+1}-n_N\right)Y_N
$$
and thus (accounting that $\left\lvert Y_i\right\rvert\leqslant 1$), 
$$
\left\lvert \frac{S_{n_l}}{n_l}\right\rvert \geqslant \left\lvert Y_l\right\rvert-2\frac{n_l}{n_{l+1}}.
$$
If we choose the sequence $\left(n_l\right)_{l\geqslant 1}$ such that $n_l/n_{l+1}\to 0$, then 
$$
\liminf_{l\to +\infty}\left\lvert \frac{S_{n_l}}{n_l}\right\rvert \geqslant \liminf_{l\to +\infty}\left\lvert Y_l\right\rvert
$$
Using the so-called second Borel-Cantelli lemma, one can show that $\liminf_{l\to +\infty}\left\lvert Y_l\right\rvert=1$ almost surely.
Remark that  $\left(Y_l\right)_{l\geqslant 1}$ could be replaced by any sequence of centered random variables with converges to $0$ in $\mathbb L^p$ but not almost surely. This shows in particular that having $\left\lVert X_n\right\rVert_p\to 0$ for all $p$ is not sufficient for the strong law of large numbers.
