Geometric Distribution - Memoryless property - geometric series

112 Views Asked by At

I came across this post here and can't comprehend one of the steps here. Memoryless property and geometric distribution.

Can someone please explain to me how you can go from this

$$=\sum_{i=0}^{\infty} (1-p)^{i-1}p-\sum_{i=0}^{s-1}(1-p)^{i-1}p$$ to this $$=\frac{p}{1-p}(\frac{1}{1-(1-p)}-\frac{1-(1-p)^s}{1-(1-p)})$$? I understand pretty much everything on this exercise except where the factor p/1-p comes from. So geometric series for finite sequence being the second element and geometric series for infinte sequence being the first one. However wouldn't you just write $={p}*\frac{1}{1-(1-p)}$?? Why $\frac{p}{1-p}$??