I have a heard time seeing why is this true $\frac{1-y^n}{1-y}=(1+y+y^2+...+ y^{n-1})$
Could you show me some kind of proof, or an identity that would me to find this?
I have a heard time seeing why is this true $\frac{1-y^n}{1-y}=(1+y+y^2+...+ y^{n-1})$
Could you show me some kind of proof, or an identity that would me to find this?
This is a classic result for the sum $S_{n-1}$ of a geometric progression :
Let $$S_{n-1} = \sum_\limits{k=0}^{n-1}y^k=1+y+y^2+...+ y^{n-2}+ y^{n-1}$$
Thus, you have : \begin{align} y\times S_{n-1}&=y+y^2+y^3+...+y^{n-1}+ y^{n}\\ & \Rightarrow S_{n-1}-yS_{n-1} =1-y^n\\ & \Rightarrow S_{n-1}(1-y)=1-y^n\\ & \Rightarrow S_{n-1} = \frac{1-y^n}{1-y}\\ \end{align} $\square$
$(1-y)(1+y+y^2+\ldots+y^{n-1})=1+ \not\!y+\not\!y^2+\ldots+\not\!y^{n-1}-\not\!y-\not\!y^2-\ldots-\not\!y^{n-1}-y^n=$ $$1-y^n$$
You can check pretty easily that $1-y^n = (1-y)(1 + y + y^2 + \cdots y^{n-1})$. Notice that, in distributing, you get a positive copy of every monomial in $1 + y + \cdots + y^{n-1}$, and a negative copy of a ton of powers of $y$.
We can proceed by induction on $n$. If $n=1$, we have $$\frac{1-y}{1-y}=1=\sum_{k=0}^0 y^k.$$ Now suppose that $$\frac{1-y^n}{1-y}=1+y+y^2+...+ y^{n-1}$$ For some $n\in\mathbb{N}$. Then we have $$ 1+y+y^2+...+ y^{n-1}+y^n= \frac{1-y^n}{1-y}+y^n=\frac{1-y^n}{1-y}+\frac{y^n(1-y)}{1-y}=\frac{1-y^{n+1}}{1-y}.$$ Therefore, the formula is valid for all $n\in\mathbb{N}$.
This isn't a proof, more of a motivator to give you the intuition that the formula should work: calculate a few examples with $y=10$ and smallish $n$, after multiplying numerator and denominator by $-1$ to get
$$\frac{y^n-1}{y-1}$$
Example with $n=5$:
$$\frac{10^5-1}{10-1} = \frac{99999}{9} = 11111 = 10^4+10^3+10^2+10^1+10^0$$
$$\begin{align} \frac{1-y^n}{1-y} &=\frac{1\color{red}{-y+y}\color{blue}{-y^2+y^2}-y^3+\cdots+y^{n-2}\color{magenta}{-y^{n-1}+y^{n-1}}-y^n}{1-y}\\ &=\frac{(1\color{red}{-y})+y(\color{red}{1}\color{blue}{-y})+y^2(\color{blue}{1}-y)+\cdots+y^{n-2}(1\color{magenta}{-y})+y^{n-1}(\color{magenta}{1}-y)}{1-y}\\ &=\frac{(1-y)(1+y+y^2+\cdots+y^{n-2}+y^{n-1})}{1-y}\\ &=1+y+y^2+\cdots+y^{n-2}+y^{n-1} \end{align}$$
More generally, if
$$ s_n = \sum_{k=0}^{n-1} ar^k = as + ar + ar^2 + \dots + ar^{n-1}, $$
then
$$ s_n(1 - r) = s_n - rs_n = a - ar^n = a(1-r^n), $$
so
$$ s_n = \frac{a(1-r^n)}{1-r}. $$