= Solution
Conditional on $N=n$, the $n$ type indicators are <independent random variables> with the <Bernoulli distribution> of parameter $p$. Thus $F\mid N=n$ has the <binomial distribution> and its <probability generating function> is $(1-p+ps)^n$. The general rule used here is that for a nonnegative integer-valued <random variable> $X$, $G_X(s)=\mathbb E[s^X]$; for a sum of independent such variables, their <probability generating functions> multiply, since the <expected value> of the product $s^{X_1}\cdots s^{X_n}$ factors. The <law of total expectation> then averages the conditional result:
$$
G_F(s)=\mathbb E[\mathbb E(s^F\mid N)]=\mathbb E[(1-p+ps)^N]=\boxed{G_N(1-p+ps)},\qquad 0\le s\le1.
$$
This calculation uses the given independent labeling of objects, including conditional on their number.
Back to article page