Are terminating decimals dense in the reals? I have read that rationals are dense in the reals, but I've been curious if the terminating decimals are as well. Since, in applied math, all effectively "real" numbers are approximated with terminating decimals, I would expect the terminating decimals to have this property, and if not I'm curious why. Here I'm defining the terminating decimals like this:
$$D = \{\frac{m}{10^n} \in \mathbb{Q} : m \in \mathbb{Z} \wedge n \in \mathbb{N}_0\}$$.
 A: Yes, they are.
First, think informally (and you do this, with your sentence beginning "since"). A set $X$ is dense iff every real number $r$ can be "well-approximated" by an element of $X$. For terminating decimals, this approximation amounts to simply ... truncating at a certain point! E.g. $\pi$ is the limit of the sequence $$3.0000..., 3.1000..., 3.1400..., ...$$ of reals with terminating decimal expansions.

OK, now we need to make this rigorous. Fix reals $a<b$.

*

*First, show that there is some $n$ such that $10^{-n}<b-a$. (This is actually the most substantial step, but at the same time may be the intuitively clearest one.)


*Let $X=\{z\cdot 10^{-n}: z\in\mathbb{Z}\}$. Show that $X\cap (-\infty,a]$ has a greatest element - that is, there is a largest "$n$-place decimal" which is $\le a$.

*

*It may be easiest to first assume $a>0$ here.



*Calling that number "$\alpha$," what can you say about $\alpha+10^{-n}$?
Note that this works for any base, not just $10$.
A: Another approach is to show that the dyadic rationals (IE numbers of the form $\frac{ a}{ 2^b}$, where $a$ is an integer and $b$ is a natural number) are dense.
Another number can be approximated by a dyadic sequence by bisecting the interval that it is in.
The 2-adic rationals terminates with at most $b$ decimal places. (In fact, it needs $b$ decimal places if $a$ is odd.)
A: We have
$\quad D \subset \Bbb Q \subset \Bbb R$
We know $\Bbb Q$ is dense in $\Bbb R$.
We'll now show that $D$ is dense in $\Bbb Q$, leaving it to the OP to
complete the argument (i.e. denseness is transitive) that $D$ is dense in $\Bbb R$.
Let $s \in \Bbb Q$ so that we can write
$\quad s = \Large \frac{u}{v} \normalsize \quad \text{with } u,v \in \Bbb Z \text{ and } v \ge 1$
If $n \in \Bbb N$ consider the division of $u\cdot 10^n$ by $v$,
$\quad u\cdot 10^n = vq + r \text{ with } 0 \le r \lt v$
But then
$\quad \Large \frac{u}{v} - \large q \cdot 10^{-n} = \Large \frac{r}{v} \large 10^{-n}$
Since $q\cdot 10^{-n} \in D$ and
$\quad \large 0  \le \Large \frac{r}{v} \large 10^{-n} \lt 10^{-n}$
we've demonstrated that $s \in \Bbb Q$ can be approximated
to any specified precision with a terminating decimal.

Using the above theory a simple algorithm can be specified to find these expansions.
Example: Approximate $\large \frac{23}{7}$ up to $6$ (fractional) decimals of precision;
i.e. repeat $6$ times: multiply the numerator (the residue) by $10$ and then divide by $7$.




Divide
Approximate (append quotient)




$23\cdot 10 = 7 \cdot 32 + 6$
$\large \frac{23}{7} \approx 3.2$


$6\cdot 10 = 7 \cdot 8 + 4$
$\large \frac{23}{7} \approx 3.28$


$4\cdot 10 = 7 \cdot 5 + 5$
$\large \frac{23}{7} \approx 3.285$


$5\cdot 10 = 7 \cdot 7 + 1$
$\large \frac{23}{7} \approx 3.2857$


$1\cdot 10 = 7 \cdot 1 + 3$
$\large \frac{23}{7} \approx 3.28571$


$3\cdot 10 = 7 \cdot 4 + 2$
$\large \frac{23}{7} \approx 3.285714$




Since the decimal expansions of fractions eventually keep repeating a block of digits, this algorithm is useful. For the above, the algorithm can be designed to determine that
$\large \frac{23}{7} = 3.\overline{285714}$

Note that the above theory and algorithm design does not depend on the base being equal to $10$;
it follows the same logic path for any base $b \ge 2$.
A: Suppose $a$ and $b$ are terminating decimals. We will find a terminating decimal that lies between them, namely  $\frac{a+b}2$.  For example, between $1.7$ and $0.0001$ is $\frac{1.7+0.0001}2 = 0.850005$.
First, as you said, write $$a=\frac A{10^i}, b=\frac B{10^j}.$$
Without loss of generality, $i\le j$. Then write $$a=\frac{A\cdot 10^{j-i}}{10^j}.$$
Now $$\frac{a+b}2=   \frac{A\cdot10^{j-i} + B}{2\cdot 10^j} =
 \frac{5A\cdot 10^{j-i} + 5B}{10^{j+1}} $$
is a terminating decimal between $a$ and $b$.
