I have the following progression, and I was wondering if there is a closed-form solution:
$q\cdot(1-q)^{N-1}+2\cdot q^2\cdot(1-q)^{N-2}+3\cdot q^3\cdot(1-q)^{N-3}+\dotsb + N\cdot q^N$
$q<1$
Thank you for your help.
I have the following progression, and I was wondering if there is a closed-form solution:
$q\cdot(1-q)^{N-1}+2\cdot q^2\cdot(1-q)^{N-2}+3\cdot q^3\cdot(1-q)^{N-3}+\dotsb + N\cdot q^N$
$q<1$
Thank you for your help.
On
You can consider the sum as a value of a derivative of a certain polynomial $$ \sum_{i=1}^N i q^i (1-q)^{N-i} = \left.\frac{\partial}{\partial x} \sum_{i=1}^N x^i q^i (1-q)^{N-i}\right|_{x=1} = (1-q)^N \left.\frac{\partial}{\partial x} \sum_{i=1}^N \left(\frac{xq}{1-q}\right)^i\right|_{x=1} $$ Please note, I first do the derivative and than set $x=1$. Using the formula for the sum of a geometric series $$ \sum_{i=1}^N i q^i (1-q)^{N-i} = \left.\frac{\partial}{\partial x} (xq) \frac{(1-q)^N - (xq)^N}{(1 - q) - (xq)}\right|_{x=1} $$ doing the derivative and substituting $x=1$ I get $$ \sum_{i=1}^N i q^i (1-q)^{N-i} = \frac{q \left((1-q)^n-(1+n)q^n\right)}{1-2 q} +\frac{q^2 \left((1-q)^n-q^n\right)}{(1-2 q)^2} $$
You can begin by pulling out the factor that doesn't depend on $i$, and then you can write the multiplication by $i$ as a sum of $i$ identical terms. After doing that, you want to sum against $i$ rather than the new variable $j$ (otherwise you just wind up right back where you were before), so you change the order of summation.
Doing those steps gives
$$\sum_{i=1}^N i q^i (1-q)^{N-i}=(1-q)^N \sum_{i=1}^n i \left ( \frac{q}{1-q} \right )^i \\ = (1-q)^N \sum_{i=1}^N \sum_{j=1}^i \left ( \frac{q}{1-q} \right )^i \\ = (1-q)^N \sum_{j=1}^N \sum_{i=j}^N \left ( \frac{q}{1-q} \right )^i.$$
To finish the problem, you just need to know the formula for the finite geometric sum:
$$\sum_{i=j}^n r^i = \frac{r^j-r^{n+1}}{1-r}$$
which holds whenever $r \neq 1$ (and holds in a limiting sense when $r=1$, i.e. when $r=1$ you get $n+1-j$).