What is the measure of the set of numbers in $[0,1]$ whose decimal expansions do not contain $5$? I just came across an exercise that asks to show that set of numbers in $[0,1]$ which possess decimal expansion not containing the digit $5$ has measure zero.
How do I approach this?
I tried thinking of relating this to Cantor set but, I see that numbers whose decimal expansion contains the digit $5$ are both contained in the Cantor set as well in its complement too, I thought if it was in the Cantor set and since measure of Cantor set is zero, so it's measure will be zero but this does not happen.
In fact how is this set measurable?
Any idea?
 A: Denote $E_2^c =$ the set of real numbers $x$ on the interval $[0, 1]$ such that in the decimal form of $x = 0.i_1 i_2 i_3 \dots$ there is no digits $2$.
Write $x \in E_2^c$ in decimal form
$$
x = 0. i_1 i_2 i_3 \dots, \ \ 
i_k = 0, 1, 3, 4, 5, 6, 7, 8, 9, \ \ 
x = \sum_{k=1}^{\infty} \frac{i_k}{10^k}, 
$$
and assume that the first digit $2$ appeals at $k$th decimal of $x$.
Denote $E_{2,1}$ as the set of real numbers $x$ on the interval $[0, 1]$ such that the first digit $2$ appeals at $1$th decimal of $x$: $E_{2,1}= \{x | x = 0. 2 \dots\} = [0.2, 0.3)$,  then $m(E_{2,1}) = 10^{-1}$.
Denote $E_{2,2}$ as the set of real numbers $x$ on the interval $[0, 1]$ such that the first digit $2$ appeals at $2$th decimal of $x$: $E_{2,2} = \{x | x = 0. i_1 2 \dots\}= \cup_{i_1} [0.i_1 2, 0.i_1 3)$, $i_1 \in \{0, 1, 3, 4, 5, 6, 7, 8, 9\}$, then $m(E_{2,2}) = 9 \times 10^{-2}$;
Inductively,
\begin{align*}
E_{2,k} 
&= \{x | x = 0. i_1 \dots i_{k-1} 2 \dots\} \\ 
&= \cup_{i_1, \dots, i_{k-1}} [0. i_1 \dots i_{k-1} 2, 0. i_1 \dots i_{k-1} 3),
\end{align*}
where $i_1, \dots, i_{k-1} \in \{0, 1, 3, 4, 5, 6, 7, 8, 9\}$, then $m(E_{2,k}) = 9^{k-1} \times 10^{-k}$;
Define $E_2 =$ the set of real numbers $x$ on the interval $[0, 1]$ such that in the decimal form of $x = 0.i_1 i_2 i_3 \dots$ there is digits $2$.
Then the measure of $E_2$ is
$$
m(E_2)= m(\cup_{k=1}^{\infty} E_{2,k})= \sum_{k=1}^{\infty} m(E_{2,k})=\sum_{k=1}^{\infty}  9^{k-1} \times 10^{-k}= 1.
$$
Thus, the measure of $E_2^c$ is
$$
m(E_2^c) = m([0, 1] \setminus E_2) = m([0, 1]) - m(E_2)= 1 - 1 = 0. 
$$
A: See, study the complement of the set. That is, look at integers which contain $5$ in their decimal expansion. Caveat : note that $0.6 = 0.5\overline{9}$ also counts as a decimal which is expressed with a $5$ as one of the digits, so belongs in the set. In particular, any terminating decimal which terminates with $6$ can be considered to belong to the set.
The first such category we can think of is: Those that have $5$ as the first digit following the decimal point. This is the set of numbers $[0.5,0.6]$. This has measure $0.1$, so the left over measure is $0.9$.
Now, from the remaining set, remove the set of all numbers with second digit $5$. This consists of $[0.05,0.06[, [0.15,0.16] \ldots [0.95,0.96]$ without $[0.55,0.56]$, since that was already removed earlier. Now, each of these has measure $0.01$, so we have removed $0.09$ more from the system. Hence, the left over is $0.81$.
By induction, prove the following : at the $n$th step, the set left over has measure $\frac{9^n}{10^n}$. Now, as $n \to \infty$, we see that the given set has measure zero (I leave you to rigorously show this, you can use the Borel-Cantelli lemma). This also incorporates the fact that the given set is measurable, since it's measure is computable(and is $0$).
A: Describing the set
There are actually a couple of little subtleties here which are worth mentioning, though they end up not really causing problems at the end of the day.  To fix notation, let $A$ denote the set of numbers in $[0,1]$ possessing a decimal expansion which does not contain a $5$.

*

*Part of the question, which is not addressed by the other answers, is "Is $A$ measurable?"  There is also the question of showing that $A$ is of measure zero.  What is missing here is a description of the measure with respect to which we should answer the questions.  The "obvious" answer is that the Lebesgue measure is the measure in question, but it doesn't hurt to specify this.


*Decimal expansions are not necessarily unique.  For example,
$$ \frac{1}{2} = 0.5 = 0.4\overline{9}. $$
The first decimal representation of one half contains a $5$, while the second does not.  Similarly, $3/5 = 0.6 = 0.5\overline{9}$.  Because both $1/2$ and $3/5$ possess decimal expansions which do not contain a $5$, both numbers are in $A$.  The number of such "ambiguous points" is small (countable, therefore measure zero), but recognizing that there is a little wrinkle here ensures that the set can be described accurately, and may have implications with respect to other questions (e.g. about the topology of the set being considered).


*It is correct to note that this set is similar to "the" Cantor set.  One common description of the Cantor set is that it consists of all of the numbers in $[0,1]$ possessing a ternary expansion which does not contain a $1$.  In fact, the set being considered in this question is a Cantor set, if not the usual middle-thirds or ternary Cantor set.  If one already knows how to show that the Cantor set has measure zero, then adjusting that argument to the current context should be doable.
With that in mind, we can give a more precise statement of the problem, as well as a description of the set which is a little easier to work with:

Define the functions $\varphi_{j} : [0,1] \to [0,1]$ by
$$ \varphi_j(x) = \frac{1}{10} x + \frac{j}{10}, $$
where $j \in \{0, 1, 2, 3, 4, 6, 7, 8, 9 \}$.  Let $A_0 = [0,1]$, and for each natural number $n$ define
$$ A_{n+1} = \bigcup_{j=0}^{4} \varphi_j(A_n) \cup \bigcup_{j=6}^{9} \varphi(A_n). $$
Then
$$ A = \bigcap_{n=0}^{\infty} A_n. $$

*

*Is $A$ Lebesgue measurable?

*What is the Lebesgue measure of $A$?


This looks gross, but watching what happens in the first iteration may help make clear what is going on:  the initial set $A_0$ is mapped by the functions $\varphi_j$ into nine closed intervals, which are then unioned up:
\begin{align}
A_1
&= \bigcup_{j=0}^{4} \varphi_j(A_0) \cup \bigcup_{j=6}^{9} \varphi_j(A_0) \\
&= \bigcup_{j=0}^{4} \left[ \frac{j}{10}, \frac{j+1}{10} \right] \cup \bigcup_{j=6}^{9} \left[ \frac{j}{10}, \frac{j+1}{10} \right] \\
&= [0.0, 0.1] \cup [0.1,0.2] \cup [0.2,0.3] \cup [0.3,0.4] \\
&\qquad\cup [0.6,0.7] \cup [0.7,0.8] \cup [0.8,0.9] \cup [0.9, 1.0] \\
&= [0,1] \setminus (0.5,0.6).
\end{align}
Hence $A_1$ consists precisely of those numbers in $[0,1]$ which possess a decimal expansion non containing a $5$ in the tenths place (again, note that $0.5 = 0.4\overline{9}$, which does not contain a $5$ in the tenths place).
Following a similar, though much more tedious, argument, it is possible to show that $A_2$ consists of all of those points in $[0,1]$ which possess a decimal expansion that does not contain a $5$ in either the tenths or hundredths place.  Indeed, $A_n$ is precisely the set of numbers in $[0,1]$ which possess a decimal expansion which does not contain a $5$ at or before the $n$-th place of the decimal expansion.  Intersecting all of these sets gives the set of points possessing a decimal expansion with no $5$s at all.
Is $A$ Lebesgue measurable?
Constructing a workable description of the set is the hard part.  With this description in hand, answering the question of measurability should be reasonably straight forward:
Note that each $A_n$ is the union of $9^n$ closed intervals ($A_0$ is one closed interval, $A_1$ is the union of nine closed intervals, $A_2$ is the union of 81 closed intervals, and so on).  Closed intervals are measurable sets, and the $\sigma$-algebra of Lebesgue measurable sets is closed under countable unions, so each $A_n$ is Lebesgue measurable.
Each $A_n$ is measurable and $A$ is the intersection of the $A_n$.  The $\sigma$-algebra of Lebesgue measurable sets is closed under countable intersections, hence $A$ is Lebesgue measurable, which gives an affirmative answer to the first question.
What is the measure of $A$?
As noted above, $A_n$ consists of $9^n$ closed intervals.  Each one of these intervals has Lebesgue measure $10^{-n}$ ($A_0$ consists of the closed interval $[0,1]$, which has measure $1$; $A_1$ consists of the $9$ intervals listed above, each of which has measure $1/10$; and so on).  The intervals overlap a little, so we can't directly use the additivity of the measure with respect to disjoint unions, we can use subadditivity:
\begin{align}
m(A_n)
&= m( \text{$9^n$ closed intervals of measure $10^{-n}$} ) \\
&\le m( \text{$9^n$ disjoint closed intervals of measure $10^{-n}$} ) \\
&=  9^n \cdot 10^{-n} \\
&= \left( \frac{9}{10} \right)^n.
\end{align}
Recall that if $m(A_0) < \infty$ and $A_n \supseteq A_{n+1}$ for all $n$, then $$m\left( \bigcap_{n=0}^{\infty} A_n \right) = \lim_{n\to\infty} m(A_n)$$
(this is continuity from above).  It is not too difficult to show that the $A_n$ are nested in this way, and so
$$ m(A)
= m\left( \bigcap_{n=0}^{\infty} A_n \right)
= \lim_{n\to \infty} m(A_n)
\le \lim_{n\to \infty} \left( \frac{9}{10} \right)^n
= 0.
$$
