Prove that if $X \sim$ Geometric $(p)$ then, $E(X)=\frac{q}{p} \quad \operatorname{Var}(X)=\frac{q}{p^{2}} \quad m_{X}(t)=p\left(1-q e^{t}\right)$ Prove that if $X \sim$ Geometric $(p)$ then,
$E(X)=\frac{q}{p} \quad \operatorname{Var}(X)=\frac{q}{p^{2}} \quad m_{X}(t)=p\left(1-q e^{t}\right)$
My work:
$$
\begin{aligned}
E(X) &=(0)(p)+(1)(q p)+(2)\left(q^{2} p\right)+\cdots+(k)\left(q^{k} p\right)+\cdots \\
&=p\left(q+2 q+\cdots+k q^{k}+\cdots\right.
\end{aligned}
$$
Now
$$
\frac{X}{(1-x)^{2}}=x+2 x^{2}+3 x^{3}+\cdots+k x^{k}+\cdots
$$
So
$$
E (X)=p\left(\frac{q}{(1-q)^{2}}\right)=p\left(\frac{q}{p^{2}}\right)=\frac{q}{p}
$$
 A: I would do the MGF calculation first, then use the result to compute the expectation and variance.  That's probably not the intent of the problem, but it is mathematically valid.
$$M_X(t) = \operatorname{E}[e^{tX}] = \sum_{x=0}^\infty e^{tx} (1-p)^x p.$$
Then $$\operatorname{E}[X] = M_X'(0), \quad \operatorname{E}[X^2] = M_X''(0),$$ and $\operatorname{Var}[X] = \operatorname{E}[X^2] - \operatorname{E}[X]^2.$
A: For the variance, it suffices to compute $E[X^2]$. You can adapt the approach you used for computing $E[X]$; it may help to manipulate the series for $\frac{1}{(1-x)^3}$.
Here is a direct derivation:
\begin{align}
E[X^2]
&= \sum_{k \ge 0} k^2 p q^k
\\
(1-q)E[X^2] = E[X^2] - qE[X^2] &= \sum_{k \ge 0} k^2 pq^k - \sum_{m \ge 0} m^2 pq^{m+1}
\\
&= \sum_{k \ge 0} k^2 pq^k - \sum_{k \ge 1} (k-1)^2 pq^k
\\
&= \sum_{k \ge 1} (2k-1) pq^k
\\
\\
&= 2 \sum_{k \ge 1} kpq^k - \sum_{k \ge 1} pq^k
\\
&= 2 E[X] - (1-p) = 2 \frac{q}{p} - q = \frac{q(2-p)}{p}.
\end{align}
Given the above expression for $(1-q) E[X^2]$, you can then do a few more steps compute the variance of $X$.

For the MGF,
$$m_X(t) = E[e^{tX}] = \sum_{k \ge 0} e^{tk} pq^k = p \sum_{k \ge 0} (e^t q)^k$$
which is a geometric series that you should already know how to compute. By the way, there is a typo in your expression for the MGF.
