The set of numbers whose decimal expansions contain only 4 and 7 Let $S$ be the set of numbers in $X=[0,1]$ that when expanded as a decimal form, the numbers are 4 or 7 only.
The following are the problems.
a), Is S countable ?
b), Is it dense in $X$ ?
c), Is it compact ?
d), Is it perfect ?
For a), I want to say that it is intuitively, but I have no idea how to prove this. I tried to come up with a bijection between $S$ and $\Bbb Z$ but I couldn't find one.
For b), my understanding of a set being "dense" means that all points in $X$ is either a limit point or a point in $S$. Am I right? Even if I were, I am not sure how to show this.
For c), my intuition tells me that it is because it is bounded. So if I could show that it is closed I will be done, I think.  But I am still iffy with the idea of limit points, and I am not sure what kind of limit points there are in $S$.
For d), Because I can't show that it's closed I am completely stuck.  
I am teaching myself analysis, and I only know up to abstract algebra. Since I never took topology, please give me an explanation that helps without knowledge of advanced math.
 A: Hints:  For b, can you get close to $0.2?$
For c, you are correct that it is bounded, so you need to investigate closed.  Let $y \in [0,1]$, but $y \not \in S$.  Then there is some digit of $y$ that is not $4$ or $7$....
For d, you need to show that any point of $S$ is a limit of a sequence of other elements of $S$.  Let $x \in S$.  Can you find a list of other elements in $S$ that get closer and closer to $x$?  For starters, can you describe another point within $\pm 0.1$ of $x$?
A: Your definition of $S$ is a little ambiguous, as stated. I am going to assume that the following is meant:

$S$ is the set of all points $x\in[0,1]$ such that $x=\sum_{n=1}^\infty\frac{d_n}{10^n}$ for some sequence of $d_n$s with each $d_n\in\{4,7\}.$

We can then construct $S$ in a similar fashion to the famous Cantor ternary set. We define a sequence of sets $S_k$ recursively as follows:

Let $S_0=[0,1]$.
Given $S_k$, we define $S_{k+1}$ to be the points $x$ of $S_k$ such that $x=\sum_{n=1}^\infty\frac{d_n}{10^n}$ where each $d_n\in\{0,1,2,...,8,9\}$ and in particular $d_n\in\{4,7\}$ for all $1\le n\le k+1.$

For example:
$$S_1=\left[\frac4{10},\frac5{10}\right]\cup\left[\frac7{10},\frac8{10}\right]$$
$$S_2=\left[\frac{44}{100},\frac{45}{100}\right]\cup\left[\frac{47}{100},\frac{48}{100}\right]\cup\left[\frac{74}{100},\frac{75}{100}\right]\cup\left[\frac{77}{100},\frac{78}{100}\right],$$ and so on. More generally, you should verify that each $S_k$ will be the disjoint union of $2^k$ closed intervals, each of length $10^{-k}$. Hence, each $S_k$ has total length $2^k\cdot 10^{-k}=5^{-k}$.
As a union of finitely-many closed sets, each $S_k$ is closed. You should be able to see that $S$ is precisely the intersection of all the $S_k$s. Why can we then conclude that $S$ is closed?
$S$ is certainly not dense in $[0,1]$, since it is a closed proper subset of $[0,1]$. In fact, it is nowhere dense there, since it is closed, and contains no open set but the empty set. Indeed, if $U$ is a non-empty open set, then it contains an open interval $I$ of positive length, but we can make the total length of the $S_k$ as small as we like by taking $k$ large enough, so $I$ isn't contained in all the $S_k$, whence $I$ can't be contained in $S$, and so $U$ can't be contained in $S$, either.
To see that $S$ is in fact uncountable, let $f:\{4,7\}\to\{0,1\}$ be given by $f(4)=0,f(7)=1$, and define a function $g$ on $S$ by $$g\left(\sum_{n=1}^\infty\frac{d_n}{10^n}\right)=\sum_{n=1}^\infty\frac{f(d_n)}{2^n}.$$ I leave it to you to show that $g$ maps $S$ bijectively to $[0,1]$--you must show that $g$ is one-to-one, and maps $S$ into and onto $[0,1]$--so is uncountable. Some basic knowledge of series will come in handy, here.
To show that $S$ is perfect, you need to show that all points of $S$ are accumulation points. Take any point $x=\sum_{n=1}^\infty\frac{d_n}{10^n}$ in $S$, and let $r>0$. There exists $N$ large enough so that $\frac3{10^N}<r$. (Why?) Let $b_n=d_n$ for all integers $n\ge1$ with $n\ne N$, and let $b_N\in\{4,7\}$ with $b_N\ne d_N$. Putting $$y=\sum_{n=1}^\infty\frac{b_n}{10^n},$$ it should then be clear that $y\in S,$ $y\ne x$, and $|y-x|<r$. Since $r>0$ was arbitrary, then $x$ is an accumulation point of $S$. Since $x\in S$ was arbitrary, all points of $S$ are accumulation points.

Once you've worked through the details of the above, test your understanding by adapting the arguments to show that the following set is uncountable, compact, perfect, and nowhere dense:

Let $T$ be the set of all points $x$ in $[0,1]$ such that $x=\sum_{n=1}^\infty\frac{q_n}{4^n}$ for some sequence of $q_n$s with each $q_n\in\{1,3\}$.

A: S is not countable because any countable subset of S must be a proper subset. To see this, suppose that A is contained in S and A is countable,  then its elements can be displayed  in some sequence x_1,x_2,...,x_n,.... We shall construct a number x of S that not belongs to A. 
If x_n have 4 at the nth decimal position, x have 7 at the nth position. And vice versa.
So x differs from any element of A,hence x does not belongs to A. This completes the proof.
