Find the distribution of the sum $Z = X_1+X_2+...+X_N$ 
Let $0<p=1-q<1$. Suppose that $X_1,X_2,...$ are independent Ge(q)-distributed R.V.'s and that $N \in Ge(p)$ is independent of $X_1,X_2,...$. Find the distribution of $Z=X_1+X_2+...+X_N$.

I have tried using the Probability Generating Function and that
$$
g_{S_N}(t)=g_N(g_X(t)).
$$
Given that
$$
g_{Ge(p)}(t)=\frac p {1-q \cdot t}
$$
and
$$
g_{Ge(q)}(t)=g_{Ge(1-p)}(t)=\frac {1-p} {1-q \cdot t}.
$$
Then I get that
$$
g_Z(t)=g_{S_N}(t)=\frac p {1-q \cdot g_{Ge(q)}(t)} = \frac p {1-q\left(\frac {1-p} {1-qt}\right)}
$$
However, how do I get the pdf $p_Z=P(Z=k)$? I have tried but can never get it right. Any help is much appreciated.
The answer is supposed to be 
$$
P(Z=k)=\frac {(1-p)^2} {(2-p)^{k+1}}
$$
and in the specific case
$$
P(Z=0)=\frac 1 {2-p}.
$$
 A: The formula $g_N(g_X(t))$ is correct but somewhere you got confused with $p, q$. As you have it $N \sim Ge(p)$ and $X\sim Ge(q)$, so $$g_N(g_X(t))=\frac{q}{1-p\cdot g_X(t)}$$ but $g_X(t)=\frac{p}{1-qt}$ and therefore $$g_{S_N}(t)=g_N(g_X(t))=\frac{q}{1-p\frac{p}{1-qt}}=\frac{(1-qt)q}{1-qt-p^2}$$ Now, you should do the following: You should write this fraction in the form $b\cdot\frac{1}{1-tc}$, where $b,c$ can be anything (as long as $|tc|<1$), and then apply the formula of the geometric series to obtain: $$b\frac{1}{1-tc}=\sum_{k=0}^{\infty}bc^kt^k$$ By the definition of the pgf you have that $bc^k=P(X=k)$. This method is standard. So, let's try it: \begin{align}\frac{(1-qt)q}{1-qt-p^2}&=\frac{(1-qt)q}{\not1-qt-\not1+2q-q^2}=\frac{1-qt}{-q-t+2}=\frac{1}{2-q}\cdot\frac{1}{1-\frac{t}{2-q}}-\frac{qt}{2-q}\cdot\frac{1}{1-\frac{t}{2-q}}\\[0.4cm]&=\frac{1}{2-q}\cdot\sum_{k=0}^{\infty}\left(\frac{t}{2-q}\right)^k-\frac{qt}{2-q}\cdot\sum_{k=0}^{\infty}\left(\frac{t}{2-q}\right)^k\\[0.4cm]&=\sum_{k=0}^{\infty}\frac{1}{(2-q)^{k+1}}\cdot t^k-\sum_{k=0}^{\infty}\frac{q}{(2-q)^{k+1}}\cdot t^{k+1}\\[0.4cm]&=\frac{1}{2-q}\cdot t^0+\sum_{k=1}^{\infty}\left(\frac{1}{(2-q)^{k+1}}-\frac{q}{(2-q)^{k}}\right)\cdot t^{k}\end{align} So, this implies that $P(Z=0)=\frac{1}{2-q}$ and that $$P(Z=k)=\frac{1}{(2-q)^{k+1}}-\frac{q}{(2-q)^{k}}=\frac{(1-q)^2}{(2-q)^{k+1}}$$ A, and for the step with the geometric series we assumed that $$\left|\frac{t}{2-q}\right|<1 \implies |t|<2-q$$
A: Note that $g(t)=E(t^Z)=\sum_{k=0}^\infty t^kP(Z=k)$
So $g(0)=P(Z=0)$.
Differentiate once, and you get $g'(t)=\sum_{k=1}^\infty kt^{k-1}P(Z=k)$.
So $g'(0)=P(Z=1)$.
Differentiate again and again, look for a pattern in the derivatives, and succeedingly substitute $t=0$ on both sides.
A: If $X_1,X_2,X_3,...,X_N$ are Ge(p), then 
$$Z=X_1+X_2+X_3,...+X_N$$ follows negative binomial distribution with parameters N, p.  Thus 
$$P(Z=k) = {(k+N-1)\choose k} (1-p)^{N} p^{k}$$
Let us do a manipulation (slight) of the above expression.
$$P(Z=k) = (1-p)\frac{(k+N-1)!}{k!(N-1)!0!} (1-p)^{N-1}(1-p)^0 p^{k}\tag 1$$
RHS looks like a term in a multinomial expression, Isn't?
Now Apply Multinomial theorem which states that 
$$(p_1+p_2+p_3)^{k+N-1}= \sum \frac{(k+N-1)!}{(k)!(N-1)!0!} (1-p)^{N-1}(1-p)^0 p^{k} $$for all k and N's where $p_1 = 1-p, p_2 = 1-p, p_3 = p$
Thus the left hand side is $ = (1-p+1-p+p)^{k+N-1} = (2-p)^{k+N-1}$
The coefficient term $(1-p)^{N-1}$ in the expression $(2-p)^{k+N-1}$ is $(k+N-1)$ 
Here expand $(2-p)^{k+N-1}$ to be $(1+q)^{k+N-1}$.  for any value of k and N, the expansion would be  $= .... + (k+N-1).q^{N-1} + 1$.  Thus the coefficient of $q^{N-1}$  is (k+N-1) and the last term is 1.
Thus $$\frac{(k+N-1)!}{(k)!(N-1)!0!}= (k+N-1)$$
$$\frac{(k+N-1)(k+N-2)!}{(k)!(N-1)!0!}= (k+N-1)$$
$$\frac{(k+N-2)!}{(k)!(N-1)!0!} = 1$$
This can happen only when N = 2, 
Notice, 2-p >1, In order to get the pmf for Z you may have to divide by (2-p)^{k+N-1}. Thus
$$P(Z=k) = (1-p)\frac{(1-p)p^{k}}{(2-p)^{k+1}}$$
$$P(Z=k) = \frac{(1-p)^{2}p^{k}}{(2-p)^{k+1}}$$
Another way of  representing this would be leave out $p^{k}$ which is obvious in a negative binomial distribution and represent 
$P(Z=k) = \frac{(1-p)^2}{(2-p)^{k+1}}$
To find P(Z=0) the following trick can work:
For k = 0 and N = 2
The last term $(2-p)^{k+N-1}$ is equal to  1 
so 
$\frac{(k+N-1)!}{(k)!(N-1)!0!}(1-p)^{1}(1-p)^0p^k=1\tag2$
and hence you multiply $\frac{1}{(1-p)}$ to the former expression
Referring back to the line (1)
$$P(Z=k) = (1-p)\left(\frac{(k+N-1)!}{(k)!(N-1)!0!}(1-p)^{1}(1-p)^0p^k\right)\frac{1}{(2-p)^{k+1}}$$
from (2) the terms in parenthesis should be multiplied by $\frac{1}{1-p}$
$$P(Z=0) = (1-p)\frac{1}{(1-p)}.\frac{1}{2-p}$$
you  get $$P(Z=0)  = \frac{1}{2-p}$$
This is a different kind of proof>
Goodluck
