Can someone explain to me how the following summation goes from the left to the right:
$\sum_{i=1}^{r}n(1-p)^{i-1} = \frac{n(1-(1-p)^r)}{p}$.
I have used the formula for a Geometric series. My common ratio is: $(1-p)$. I get the following:
$\sum_{i=1}^{r}n(1-p)^{i-1} = n\cdot\frac{1-(1-p^r)}{1-(1-p)}$.
From here, I simply don't know how to get to $\frac{n(1-(1-p)^r)}{p}$
In your question, $n$ is a constant, which has nothing to do with $i$. The first implication of what you have done is incorrect.
Note that $n(1-p)^{i-1}$ means $n\cdot ((1-p)^{i-1})$, and
$$ \sum_{i=1}^{r}n(1-p)^{i-1}=n\sum_{i=1}^{r}(1-p)^{i-1} $$
all you need to work out is to find a formula for $$ \sum_{i=1}^{r}x^{i-1} $$ and then set $x=1-p$.