I'm trying to find the cdf of the following discrete distribution:
$$f(k)=\frac{(1-\rho )^2 \rho ^{k-1}}{\left(1-\rho ^k\right) \left(1-\rho ^{k+1}\right)}+\frac{(1-\rho ) \rho ^{M-1}}{1-\rho ^M}$$
with domain of support
$$k\in \{1,...,M-1\}, k < M, \mbox{and}\ M \in Z.\ \mbox{Also}, 0<\rho<1.$$
I know its a proper pmf because, when $M=10$, I can compute
$$\sum _{k=1}^9 \left(\frac{(1-\rho )^2 \rho ^{k-1}}{\left(1-\rho ^k\right) \left(1-\rho ^{k+1}\right)}\right)+\frac{(1-\rho ) \rho ^{9}}{1-\rho ^{10}} = 1.$$
I'd like to compute the cdf, but I simply don't know how to do this. I can compute the pmf from the cdf for other distributions, but I can't do it in reverse.
Any help would be greatly appreciated.
Consider the sequences:
$$g_n=(1-\rho)\frac{\rho^{n-1}}{1-\rho^n}~~,~~f_n=(1-\rho)^2\frac{\rho^{n-1}}{(1-\rho^n)(1-\rho^{n+1})}$$
It is easy to see that the sequence $g$ is an "integral" to the sequence $f$, in other words:
$$g_{n+1}-g_{n}=-f_n$$
Then we see that the sum telescopes
$$\sum_{n=1}^{M-1}f_n=g_1-g_M=\frac{1-\rho^{M-1}}{1-\rho^M}=1-(1-\rho)\frac{\rho^{M-1}}{1-\rho^M}$$
This shows us that if the sequence g which is the "integral" is to be considered as a CDF then the corresponding PMF meaning must be assigned to $$t(n;M)=\begin{Bmatrix}f_n&~~0\leq n\leq M-1\\\frac{\rho^{M-1}}{1-\rho^M}&~~n=M\\ 0& \text{otherwise}\end{Bmatrix}$$
The corresponding CDF then is:
$$T(n;M)=\sum_{k=1}^{n}t(k;M)=\begin{Bmatrix}-g_{n+1}+g_1&~~1\leq n\leq M-1\\1&~~n=M\\ \end{Bmatrix}$$