You shoot a basketball $N$ times, where $N∼Geometric(q)$. Every time you shoot you have the same probability $p$ of scoring one point (independently of other shots). Let $X$ be the total number of points you scored.
a) Find $E(X)$.
b) Find $Var(X)$
c) Find the Moment Generating Function of $X$
I used the law of total expectation and total variance to find that $E(X) = \frac pq$ and $Var(X)=\frac {pq(1-p)+p^2(1-q)}{q^2}$, however I'm having a hard time finding the MGF of X. I tried $$E(e^{tx})=\sum_{i=0}^n E(e^{tx}|N=n)P(N=n)=\sum_{i=0}^n [(pe^t+1-p)^n]*[(1-q)^{n-1}q]$$ but this does not give me the desired result. Where am I going wrong?