<s>[INST] Convergence of the Arithmetic mean of a sequence taking values in $\{0, 1\}$ Let $(a_i)_{i \in \mathbb{N}}$ be a sequence taking values in $\{0, 1\}$. Now define $x_n$ as the Arithmetic mean of the first $n$ elements of $(a_i)_{i \in \mathbb{N}}$. So let
$$x_n = \frac{1}{n}\sum_{i = 1}^{n}a_i.$$
Can we find such a sequence for which $x_n$ diverges (when $n \to \infty$)? I know that $0 \leq x_n \leq 1$ for all $n \in \mathbb{N}$, but can we be certain that the limit actually exists?
 [/INST] This is not the case. Take for example $a_n=1$ for certain consecutive $n$ and otherwise $a_n=0$ such that the mean of the sequence wiggles around between a third and two third. To let this happen, the sequence needs to contain longer and longer sequences of consecutive $1$s and $0$s.
To be precise one could take the following sequence
$$ a_n = \begin{cases} 1, & \text{if there exists an }\ m:\ 2^{2m-1}\leq n \leq 2^{2m} \\ 0 ,& \text{otherwise}. \end{cases} $$
In this case,
$$ \frac{1}{2^{2m}}\sum_{n=1}^{2^{2m}}a_n = \frac{1}{2^{2m}}\sum_{j=1}^{m}\sum_{n=2^{2j-1}}^{2^{2j}} 1 = \frac{1}{2^{2m}} \sum_{j=1}^{m} 2^{2j-1}= \frac{1}{2^{2m+1}} \sum_{j=1}^{m} 4^j = \frac{1}{2^{2m+1}}\cdot\frac{4^{m+1}-1}{4-1} = \frac{2^{2m+2} - 1}{2^{2m+1}\cdot3} \to \frac{2}{3}  $$
but
$$ \frac{1}{2^{2m-1}}\sum_{n=1}^{2^{2m-1}}a_n = \frac{1}{2^{2m-1}}\sum_{j=1}^{m-1}\sum_{n=2^{2j-1}}^{2^{2j}} 1 = \frac{1}{2^{2m-1}} \sum_{j=1}^{m-1} 2^{2j-1}= \frac{1}{2^{2m}} \sum_{j=1}^{m-1} 4^j = \frac{1}{2^{2m}}\cdot\frac{4^m - 1}{4-1} = \frac{2^{2m} - 1}{2^{2m}\cdot 3} \to \frac{1}{3}  $$
And thus the limit $\lim_{N\to\infty}\frac{1}{N}\sum_{n=1}^{N} a_n$ is undefined.
</s>