Let $a,b \in R$ where $ a < b$. Prove that there exist a rational number $c$ and an irrational number $d$ such that $ a Question : Let $a,b \in R$ where $ a < b$. Prove that there exist a rational number $c$ and an irrational number $d$ such that $ a <c<b$ and $ a<d<b$. Hint: consider decimal expansions of $a$ and $b$
Attempt: Theorem 2.7.5 states that a real number is rational if and only if its decimal expansion terminates or has an infinitely repeating sequence of digits. 
Set $I$ is irrational numbers 
$I =[x \in R: x \notin Q]$
Set $Q$ is rational numbers
$Q = [ \frac{a}{b}:a,b, \in Z$ and $b \neq 0]$
If the division process terminates, then we are done. Otherwise, since each digit of the quotient 
determines in turn its successor, and since there are at most $b-1$ possible remainders when dividing 
by $b$ (by the division algorithm), some digit of the remainder must show up again, forcing a sequence 
of digits to repeat forever. The length of the repeating cycle is at most $b-1$
Suppose the decimal expansion of r will terminate. Therefore, for $r=0$, we have $a_1,a_2,...a_k$ where 
each $a_i \in [0,1,2,3,4,5,6,7,8,9]$ and $a_k \neq 0$. Then 
$ r = \frac{a_110^{k-1}+a_210^{k-2}+...+a_k}{10^k}$
satisfies the definition of a rational number. Now, suppose the decimal expansion of r has an 
infinitely repeating sequence of digits that begins immediately after the decimal point:
$r=0.b_1b_2...b_k$
The sequence of digits are repeated forever. Therefore,
$10^kr=b_1b_2...b_k.b_1b_2...b_kb_1b_2...b_k$
so,
$$10^kr-r=b_1b_2...b_k$ 
giving
$r = \frac{b_1b_2...b_k}{10^k-1} \in Q$
Suppose $r$ has an initial sequence of digits before the repeating sequence: $r = 0.a_1a_2...a_lb_1b_2...b_k$. Then we let $r' = 0.b_1b_2...b_k$. By the previous case $r' \in Q$. It is 
easy to verify that 
$r=\frac{r'+a_1a_2...a_l}{10^l}$
As a result, $ r \in Q$
So my question is do I apply the decimal expansion to $c$ and $d$. Assuming I can, then the decimal 
expansion of $c$ will terminate since it's rational by theorem 2.7.5.
Then,  for $r=0.c_1c_2...c_k$ where each $ c_i \in [0,1,2,3,4,5,6,7,8,9]$ and $c_k \neq 0$. Then 
$ r = \frac{c_110^{k-1}+c_210^{k-2}+...+c_k}{10^k}$
Suppose $d$ is an irriational number, then the decimal expansion won't terminate. 
$10^kr=d_1d_2...d_k.d_1d_2...d_kd_1d_2...d_k$
so,
$10^kr-r=d_1d_2...d_k$ 
giving
$r = \frac{d_1d_2...d_k}{10^k-1} \in Q$.
If we let $r = 0.c_1,c_2...c_ld_1d_2...d_k$ and $r' =0.d_1d_2...d_k$, then $r' \in Q$ and $r=\frac{r'+c_1c_2...c_l}{10^l}$
I could've sworn that this is going to work for $c$ only, but not for $d$ because as I mentioned earlier $c$'s decimal expansion will stop and $d$ will go on forever. 
 A: Using the decimal expansion for this purpose is at least cumbersome, and while we can do it by observing that $a$ and $b$ must differ at some decimal for the first time, one has to be careful with lots of $9$s and $0$s causing trouble.
Anyway you have a lot of freedon with "late" decimals, so you can make things periodic or aperiodic at will.
It is much simpler to let $\epsilon=b-a>0$ and then note that there is at least one onteger $n$ with $n>\frac1\epsilon$ and then at least one integer $m$ with $na<m<nb$ (because $nb-na>1$) and one integer $m'$ with $n(a-\sqrt 2)<m'<n(b-\sqrt 2)$. Then $c=\frac mn$ and $d=\frac {m'}n+\sqrt 2$ do the trick.
A: Hint: Given $a\lt b$ in $\mathbb{R}$, find any positive integer $n$ so that
$$
n(b-a)\gt1
$$
This assures that
$$
\frac1n\lt b-a
$$

Find the smallest integer $k$ so that
$$
\frac kn\ge b
$$
Show that
$$
a\lt\frac{k-1}{n}\lt b
$$

Find the smallest integer $m$ so that
$$
\frac mn+\sqrt2\ge b
$$
Show that
$$
a\lt\frac{m-1}{n}+\sqrt2\lt b
$$
A: Consider the numbers $c=\dfrac{a+b}{2}$ and $d=(\sqrt{2}-1)(b-a)+a$. 
