Each year a tree of a particular type flowers once and produces a random number $N$ of flowers, where $\mathbb{P}(N=n)=(1-p)p^n$, $n=0,1,2,\dots $ and $0<p<1$. Each flower has probability $1/2$ of producing a ripe fruit, independently of all other flowers. Find the probability generating function for the number $R$ of ripe fruits produced by the tree. Hence, find the probability that in a given year
- the tree produces $r$ ripe fruits
- the tree has $n$ flowers if it produces $r$ ripe fruits
For clarity, reform $\mathbb{P}(N=n)=(1-p)p^n$ into $\mathbb{P}(X=k)=q(1-q)^{k-1}$, where $q=1-p$ and $n=k-1$. Therefore, $N$~$Geo(q)$ and $X_i$~$Ber(1/2)$. The p.g.f. of these RVs are
$G_N(s)=\frac{qs}{1-(1-q)s}$ and $G_{X_1}(s)=\frac{1}{2}(1+s)$
Since the p.g.f. of $\sum_{i=1}^N X_i$ is $G_N(G_X(s))=G_N(\frac{1}{2}(1+s))=\frac{q\frac{1}{2}(1+s)}{1-(1-q)\frac{1}{2}(1+s)}=$$\frac{1}{2}\frac{q+qs}{1-\frac{1}{2}(1+s-q-qs)}=\frac{q+qs}{1-s+q+qs}$
I am unsure of how to interpret this, or where I went wrong.
More generally, how do we interpret a general pgf of a geometric RV?
Let $G_R(s)$ be the generating function of $R$. Then
$$ \begin{align*} G_R(s) &= \frac{q+qs}{1-s+q+qs}\\ &= \frac{q+qs}{1+q-(1-q)s}\\ &= \frac q{1+q}(1+s)\left(\frac 1{1+\left(\frac{1-q}{1+q}\right)s}\right)\\ &= \frac q{1+q}(1+s)\sum_{n=0}^\infty \left(\frac{1-q}{1+q}\right)^n s^n\\ &= \frac q{1+q}\left(1 + \sum_{n=1}^\infty\left(\frac{1-q}{1+q}\right)^n s^n + \sum_{n=0}^\infty\left(\frac{1-q}{1+q}\right)^n s^{n+1}\right)\\ &= \frac q{1-q}\left(1 + \sum_{n=1}^\infty \frac2{1-q}\left(\frac{1-q}{1+q}\right)^n s^n \right)\\ &= \frac q{1+q} + \sum_{n=1}^\infty \left(\frac 2{1-q^2}\right)\left(\frac{1-q}{1+q}\right)^n s^n \end{align*} $$ Hence $$\mathbb P(R=r) = \begin{cases} \frac q{1+q},& r=0\\ \left(\frac2{1-q^2}\right)\left(\frac{1-q}{1+q}\right)^r,& r>0\end{cases}$$