Geometric Series-Bounce Height of a Ball A ball is dropped from a height of $20 \, \mathrm{m}$. It rebounds to a height of $16 \, \mathrm{m}$ and continues to rebound to eight-tenths of its previous height for subsequent bounces.
Calculate the total distance the ball travels before it comes to rest. 
How do you answer this question? 
I'm using the formula
$$
S_n = \frac{a(1-r^n)}{1-r}, \qquad   r\lt 1
$$
I believe that the variables:
$$
\begin{align}
a &= 20 \\
r &= 0.8 \\
n &= \text{undefined}
\end{align}
$$
The answer is meant to equal $100 \, \mathrm{m}$ so, $S_n = 100 \, \mathrm{m}$.
Please help.
Thank you in advance. 
 A: You need the sum of the infinite geometric series given by
$$S=20+\frac{8}{10}\times20+\left(\frac{8}{10}\right)^2\times20+\cdots$$
For a geometric series
$$S=a+ar+ar^2+\cdots$$
The $N^{th}$ partial sum is given by
$$S_N=a+ar+ar^2+\cdots+ar^{N-1}=\frac{a(1-r^N)}{1-r}$$
Then,
$$S=\lim_{N\to\infty}S_N=\lim_{N\to\infty}\frac{a(1-r^N)}{1-r}$$
If $|r|<1$, the limit exists and is given by,
$$S=\frac{a}{1-r}$$
Hence, here
$$S=\frac{20}{1-\frac{8}{10}}=100$$
A: Let's say that at iteration $n$ the ball goes down $d_n$ meters, and then goes up $u_n$ meters, for all $n \ge 0$. We are told that $d_0 = 20$ and that $u_n = \frac 8 {10} d_n = \frac 4 5 d_n$. It is also clear that $d_{n+1} = u_n$ for all $n \ge 0$. The total distance is
$$(d_0 + u_0) + (d_1 + u_1) + \dots = \sum _{n \ge 0} \left( d_n + \frac 4 5 d_n \right) = \frac 9 5 \sum _{n \ge 0} d_n \ .$$
Now, using the relations from the first paragraph, $d_{n+1} = u_n = \frac 4 5 d_n$, whence we get that $d_{n+1} = \left( \frac 4 5 \right) ^{n+1} d_0$ for all $n \ge 0$, whence it is immediate that $d_n = \left( \frac 4 5 \right) ^n d_0$ for all $n \ge 0$. Using this back in our sum, the total distance becomes
$$\frac 9 5 \sum _{n \ge 0} \left( \frac 4 5 \right) ^n d_0 = \frac 9 5 \frac 1 {1 - \frac 4 5} d_0 = 180 \ .$$
