Solution (source code)

= Solution
{c}

For an independent nonnegative integer-valued count $N$ and identically distributed independent summands, the <random sum probability generating function> is $G_Z(s)=G_N(G_{X_1}(s))$. Conditioning on $N=n$ proves this, since the conditional <probability generating function> is $G_{X_1}(s)^n$.

Here $G_{X_1}(s)=1-r+rs$, so
$$
\boxed{G_Z(s)=\frac p{1-(1-p)(1-r+rs)}=\frac p{p+(1-p)r-(1-p)rs}.}
$$
This identity holds throughout $|s|\leq1$, and its power-series extension has radius $[p+(1-p)r]/[(1-p)r]$.