# Rudin exercise 2.17 - question on approach

Is the below general approach to exercise 2.17 in Rudin’s PMA valid? It seems a bit different from other answers posted so not sure if completely off base or on the right track. Excuse typos. Thank you.

2.17. Let $$E \subset [0,1]$$ denote the set of all $$x$$ with only 4s and 7s in their decimal expansion. Is $$E$$ countable? Is $$E$$ dense in $$[0,1]$$? Is $$E$$ compact? Perfect?

Suppose $$E \subset [0,1]$$ is the set of all real numbers with only 4 and 7 in the decimal expansion. To construct E, consider the following. The endpoints of the interval $$E_1=[\frac{4}{9},\frac{7}{9}]$$ are the members of E with either all 4s and 7s (i.e. 0.444... and 0.777...) in the decimal expansions, respectively. Removing the middle $$\frac{4}{15}$$ of this interval, or retaining the outer $$\frac{1}{30}$$ closed interval on each side yields $$E_2=[\frac{4}{9},\frac{43}{90}]\bigcup[\frac{67}{90},\frac{7}{9}]$$. The endpoints of these two intervals consist of $$0.444..., 0.477..., 0.744...,$$ and $$0.777...$$. This process can be carried forward by retaining the outer $$\frac{10^{-(n-1)}}{3}$$, or removing the open middle interval of length $$\frac{10^{-(n-2)}*4}{15}$$, from the closed intervals in $$E_{n-1}$$, so that $$E_n$$ consists of the union of $$2^{n-1}$$ closed intervals of length $$\frac{10^{-(n-1)}}{3}$$ with the endpoints of these intervals consisting of all possible combinations of 4 and 7 of the decimal expansion up to the nth place and the remainder of the expansion consisting of either all 4s or all 7s. This construction implies $$E=\bigcap E_n$$. Then proof of the above properties in the question is then similar to the proof of the same for the Cantor set.