The measure of the set of numbers in $[0,1]$ whose digits have a mean of $0$

decimal-expansionlebesgue-measurereal numbersreal-analysis

I've been playing around with ways to systematically define a continuum of dense and uncountable subsets of real numbers in a (somewhat) intuitive manner, and tried the following characterization:

For any $x\in[0,1]$, define $(d_n)\in\{0,\ldots,9\}^\mathbb{N}$ its list of digits (we'll take base $10$ here for example), such that we would write $x=0.d_1 d_2 d_3 \ldots$

Define $S$ to be the mean value of $x$'s digits:
$$
S(x) = \lim_{n\to\infty} \frac{1}{n} \sum_{k=1}^n d_k.
$$

A few things to note already: $S$ does not exist for every $x$, but we'll only consider those for which it does. Moreover, the list of digits includes trailing zeros, so for decimal fractions, we'll always have $S(x)=0$.

Now consider the subset $A\subset[0,1]$ of numbers whose digits have a mean of $0$:
$$
A = \{x\in[0,1],\ S(x)=0\}.
$$

Intuitively, those are the numbers whose non-zero digits become more and more sparse.
I know that $A$ is dense in $[0,1]$ (includes decimal fractions) and uncountable (with a slight modification of Cantor's diagonal argument). My question is this:

What is the (Lebesgue) measure of A?

My gut tells me it should be $0$, the reason being that "$S(x)=0$" is kind of an arbitrary choice, and the structure likely wouldn't change too much if we had picked instead "$S(x)=\alpha$" for some $\alpha\in[0,9]$. If the Lebesgue measure is the same no matter what $\alpha$ we choose, then we directly have that it should be $0$, but I'm not sure how to go about showing that either.

I also intentionally put "Lebesgue" in parentheses, as results for other measures (e.g. Hausdorff) would be interesting too, though I'm less familiar with those myself.

To generalize a lot more, it'd also be interesting to consider the subset $\{x\in[0,1],\ S(x) \text{ exists}\}$, or even more generally, $\{x\in[0,1],\ a\leq S(x)\leq b\}$ with $a,b\in[0,9]$.

Best Answer

Every real number $\omega \in [0,1)$ has a unique base-10 expansion that does not contain an infinite tail of 9s: $$ \omega = \sum_{i=1}^{\infty} b_i 10^{-i}$$

For $i \in \{1, 2, 3, ...\}$ and $\omega \in [0,1)$, let $b_i(\omega)$ denote the $i$th component of the unique base-10 expansion of $\omega$. It can be shown that $b_i:[0,1)\rightarrow\{0, 1, ..., 9\}$ is a measurable function for each fixed $i$. Define $$A = \left\{\omega\in [0,1) : \lim_{n\rightarrow\infty} \frac{1}{n}\sum_{i=1}^n b_i(\omega) = 4.5\right\}$$

Let $\mathcal{B}([0,1))$ denote the Borel sigma algebra on $[0,1)$ and let $\mu:\mathcal{B}([0,1))\rightarrow [0,1]$ denote the standard Borel measure.

Claim: $\mu(A) = 1$.

Proof: Fix a probability space $(\Omega, \mathcal{F},P)=([0,1), \mathcal{B}([0,1)), \mu)$. Define the random variable $U:\Omega\rightarrow [0,1)$ by $U(\omega)=\omega$ for all $\omega \in [0,1)$. It is well known that $U$ is uniformly distributed over $[0,1)$ and its unique base-10 expansion creates i.i.d. random variables $\{B_i\}_{i=1}^{\infty}$ that are uniform over the set $\{0, 1, ..., 9\}$:
$$ U = \sum_{i=1}^{\infty} B_i10^{-i}$$ where $B_i=b_i(U)$ for $i \in \{1, 2, 3, ...\}$. The law of large numbers (LLN) implies $$ \lim_{n\rightarrow\infty} \frac{1}{n}\sum_{i=1}^n B_i = 4.5 \quad \mbox{with prob 1} $$ Thus we can define $$ M=\left\{\omega \in [0,1]: \lim_{n\rightarrow\infty} \frac{1}{n}\sum_{i=1}^n B_i(\omega) = 4.5\right\}$$ and the LLN ensures $M$ is an event and $$ P[M] = \mu(M)=1$$ But for each $i$ we have $B_i=b_i(U)$, meaning for each $\omega \in [0,1)$ we have $B_i(\omega) = b_i(U(\omega)) = b_i(\omega)$. It follows that set $M$ is the same as set $A$. So $\mu(A)=\mu(M)=1$. $\Box$

Since $\mu(A)=1$ it follows that $\mu(A^c)=0$. The set $A^c$ includes all $\omega \in [0,1)$ for which the average of the base-10 digits of $\omega$ either has no limit, or has a limit that is different from 4.5.