I do not understand the following passage from my lecture notes:
Let $$C_p = \left\{ y\in [0,1): \text{the binary expansion } (x_1,x_2,\cdots) \text{ of } y \text{ satisfies } \frac{1}{n}\sum_{i=1}^n x_i \to p \right\}$$ Let $X_n$ be random variables with $$P(X_n=1)=p, \quad P(X_n=0)=1-p.$$
Then by the strong law of large numbers, the random variable $Y=\sum_{n=1}^{\infty} X_n 2^{-n}$ satisfies $P(Y\in C_p)=1$.
Could someone kindly detail why the SLLN implies that $P(Y\in C_p)=1$?
Your notes (or the lecturer) should have said that the $X_n$ are i.i.d., with $P(X_n=1)=p$ and $P(X_n=0)=1-p$. Write $X$ for the sequence $X=(X_n)$.
Let $D_p$ denote the set of sequences $x=(x_n)$ such that $(x_1+\cdots+x_n)/n\to p$. The SLLN asserts that $P(X\in D_p)=1$.
Now consider, maybe more pedantically than needed, the map $M$ that sends a sequence of binary digits $x=(x_n)$ to the sum $y=\sum_{n\ge1}x_n 2^{-n}.$ This map is almost bijective in the following sense: For each $y\in[0,1)$ the cardinality of the preimage of $y$ is either $1$ or $2$, and is $2$ for only a countable set of $y$. Call the two kinds of $y$ unambiguous and ambiguous. (An example of an ambiguous $y$ is $y=1/2$ which has two binary expansions: the terminating expansion $\mathtt{.1}$ and the nonterminating one $\mathtt{.01111}\ldots.\ $ All of the examples of ambiguous $y$ are of this form: $y=k2^{-n}$, for integer $k$, with a terminating binary expansion and a nonterminating one.) Let $A$ be the preimage under $M$ of the set of ambiguous $y$ and let $U$ be the the preimage of the set of unambiguous $y$. Since each particular sequence has probability $0$, and there are only countably many ambiguous $y$ values, we have $P(A)=0$ and $P(U)=1$. In a one-sentence summary: off of the set $A$ which has probability $0$, $M$ is a bijection.
If $y\in U$, with $y=M(x)$, then $y\in C_p$ if and only if $x\in D_p$. Apply this to your problem, where $Y=M(X)$, where $X=(X_n)$. We have $P(Y\in U)=1$ by the previous paragraph, and $P(D_p)=1$ by the SLLN. So $P(Y\in C_p)=1$, too.