Probability of $i$ elements in a Branching process I have a branching process that's family size each generation is Binomially distributed. How do I calculated the probability of the family size $Z$ in stage $n$ is $i$: $P(Z_n=i)$. 
At the begining of analyzing the problem, it seemed pretty straightforward, because I though it could only happen for maximal cases of $Z_{n-1}\leq i$, but this is not true, since $Z_{n-1}\geq i$, and it can have $m$ branches from the $n-1$ stage fall in extinction.
Also most of the textbooks I've seen usually have a straightforward formula for the expectation of a branching process at a given stage $n$. So it seems like $\mathbf{E}[Z_n=i]$ is relatively easy compared to $P(Z_n=i)$. Why is this? And what is the role of the generating functions in Branching Processes?
 A: The generating functions $g_n:s\mapsto E[s^{Z_n}]$ of the generation sizes $Z_n$ of a homogenous branching process are related by the identity $g_{n+1}=g_n\circ g$ where $g:s\mapsto E[s^{L}]$ is the generating function of the number of descendants of each individual. In particular $g'_n(1)=E[Z_n]$ hence this allows to recover the well-known formula $E[Z_n]=E[L]^nE[Z_0]$. 
To extract the full distribution of $Z_n$ from $g_n$ is, unsurprisingly, more complicated. For every $k$, $P[Z_n=k]$ is the coefficient of $s^k$ in $g_n(s)$. An explicit formula is
$$
P[Z_n=k]=\int_0^1g_n(\mathrm e^{2\pi\mathrm i t})\mathrm e^{-2\pi k\mathrm i t}\mathrm dt.
$$
One of the rare cases when one can write down $g_n$ explicitely is when $g$ describes a geometric distribution, that is,
$$
g(s)=\frac{p}{1-(1-p)s},
$$
or for some closely related generating functions. The key-fact is that, for example, the generating function of a geometric distribution is conjugate to an affine transform in the sense that
$$
\frac1{1-g(x)}=A\left(\frac1{1-x}\right),\qquad A(t)=1+\frac{p}{1-p}t,
$$
hence, to iterate $g$, it suffices to iterate $A$, which is easy, directly when $p=\frac12$, and, when $p\ne\frac12$,, using the identity
$$
A(t)-\frac{1-p}{1-2p}=\frac{p}{1-p}\left(t-\frac{1-p}{1-2p}\right).
$$
