Suppose that $X$ has a geometric distribution with probability mass function $P(X=x) = q^{i-1}p$, $i=1,2,...$ and $q=1-p$
Show that its probability generating function is given by $ \pi(s)=\frac{ps}{1-qs}$. Hence show that $E(x)=\frac{1}{p}$ and $Var(X)=\frac{q}{p^2}$
Hi everyone, I am doing this question for exam practice, and I can't seem to get the correct answer. And to be honest, I am just working through it mechanically and don't have a great understanding of the probability generating functions.
Here is what I have:
$$\pi(s)=E(S^X)=\sum^\infty_{i=0}q^{i-1}p\cdot s^i$$ $$= p\sum^\infty_{i=0}q^{i-1}\cdot s^i=p\sum^\infty_{i=0}\frac{q^i}{q}\cdot s^i$$ $$=\frac{p}{q}\sum^\infty_{i=0}(qs)^i$$
Then using the sum of a geometric series formula, I get:
$$=\frac{p}{q}(\frac{1}{1-qs})$$
Now I am stuck. I feel like I am close, but am just missing something. I'll be ok with deriving the expected value and variance once I can get past this part.
As an addition I was wondering if anyone could also give me a bit of an 'idiots' explanation of the probability generating function, as I am struggling to understand it conceptually. $s$ seems to be the dependent variable, but my lecturer hasn't explained what exactly it is.
Many thanks in advance!