# Joint probability generating functions, help please!

With a sequence of $N$ independent Bernoulli trials performed, where $N \in \mathbb{Z}^+$ and the probability of success on any trial is $p$, and $S$ and $F$ being total number of success and fails respectively.

How to show joint probability generating functions of $S$ and $F$ is given by $G_{S,F}(s,t) = G_N(ps + (1-p)t)$, where $G_N$ is the probability generating function of $N$?

Now I am pretty sure $G_S(z) = (1-p)p z^s$ and $G_F(z) = (1-(1-p)p)z^s$ right?

So how do I join them to prove that?!

• Simpler problem: let $S_n$ and $F_n$ denote the number of successes and fails during $n$ trials. Cn you write down $G_{S_n}(z)$ and $G_{F_n}(z)$? These are not what is written in your post... – Did May 22 '14 at 12:42
• @Did If I write up an attempt of that as a partial answer, could you review it in like twenty minutes or so? – user142198 May 22 '14 at 12:44
• @Did Attempt posted for $G_{S_n}(z)$ – user142198 May 22 '14 at 13:04
• @Did Added to partial attempt extrapolation of different model(possibly right)? – user142198 May 22 '14 at 13:37
• Sorry but where is the function $G_{S_n}:z\mapsto G_{S_n}(z)=E(z^{S_n})$? – Did May 22 '14 at 13:43

Here is a step that should be mastered before attacking the full question. Consider $S_n$ and $F_n$ the number of successes and fails during $n$ trials. (Note that now $n$ is fixed while in the question, one performs a random number $N$ of trials.) The generating function $G_{S_n}$ of $S_n$ is defined by $G_{S_n}(z)=E(z^{S_n})$ for every $|z|\leqslant1$.
Since $S_n$ is binomial $(n,p)$, $P(S_n=k)={n\choose k}p^kq^{n-k}$ for every $0\leqslant k\leqslant n$, where $q=1-p$, hence $$G_{S_n}(z)=\sum_{k=0}^nP(S_n=k)z^k=\sum_{k=0}^n{n\choose k}(zp)^kq^{n-k}=(q+pz)^n.$$ The generating function $G_{n}$ of $(S_n,F_n)$ is defined by $G_{n}(z,w)=E(z^{S_n}w^{F_n})$ for every $|z|\leqslant1$ and $|w|\leqslant1$. Since $S_n+F_n=n$, this is $$G_{n}(z,w)=E(z^{S_n}w^{n-S_n})=w^nG_{S_n}(zw^{-1})=(qw+pz)^n.$$
One is finally ready to consider $(S,F)=(S_N,F_N)$ where $N$ is random and independent of the collection $(S_n,F_n)_n$. Thus, the generating function $G$ of $(S,F)$ is defined by $G(z,w)=E(z^{S}w^{F})$ for every $|z|\leqslant1$ and $|w|\leqslant1$. One gets $$G(z,w)=\sum_nP(N=n)G_{n}(z,w)=\sum_nP(N=n)(qw+pz)^n,$$ that is, $$G(z,w)=E((qw+pz)^N).$$ Using the generating function $G_N$ of $N$, this can be rewritten as $$G(z,w)=G_N(qw+pz).$$
• How did you achieve the step: $\sum_{k=0}^n{n \choose k} (zp)^k (1-p)^{n-k} = {(q+pz)}^n$? Is that an identity? – user142198 May 23 '14 at 0:15