# 0.999… = 1

This morning Dream_Team brought up the age-old debate of whether
$0.999\dot{9} = 1$
which of course it does.

### Method 1

$\mathrm{let } x = 0.999\dot{9}$
$\Rightarrow 10x = 9.999\dot{9}$
$\Rightarrow 10x - x = 9x = 9.999\dot{9} - 0.999\dot{9} = 9$
$\Rightarrow x = 1$
Although this seems fairly conclusive, there is a much nicer (IMO) way.

### Method 2

One can treat the infintite decimal expansion as a geometric series.
$0.999\dot{9} = 0.9 + 0.09 + 0.009 + 0.0009 \ldots$
$\textrm{The common difference, } r = \frac{1}{10} \textrm{ and the first term, } a = 0.9$
Then it becomes apparent that the value of $0.999\dot{9}$ is equal to the sum to infinity of the geometric series.
$0.999\dot{9} = S_\infty$
And for a geometric series with common difference $r$ and first term $a$
$S_\infty = \frac{a}{1 - r}$     for explanation see below
So for $0.999\dot{9}$
$S_\infty = \frac{0.9}{1 - 0.1} = \frac{0.9}{0.9} = 1$ VoilĂ .

This then prompted me to code some haskell, creating types for geometric and arithmetic series, but that post can come later.

#### Sum of Geometric Series

$\textrm{let } S_n \textrm{ represent the sum to }n \textrm{ terms}$
$S_n = a + ar + ar^2 + ar^3 + ... + ar^{n-1}$
$rS_n = ar + ar^2 + ar^3 + ar^4 + ... + ar^n$
$S_n - rS_n = a - ar^n$
$S_n = \frac{a - ar^n}{1 - r} = \frac{a(1-r^n)}{1-r}$

Now for the sum to infinity:
$\textrm{if} \left | r \right | < 1 \textrm{ then } \lim_{n \to \infty} r^n = 0$
$\Rightarrow S_\infty = \frac{a}{1-r}$