<s>[INST] Expectation and variance of 4th generation Let $z_1,z_2,...,z_n$ describe a branching process in which each parent has j offspring with probability $p_j$, for 
$ p_0 = \frac{1}{12}, p_1 = \frac{1}{6}, p_2 = \frac{3}{4}$.
Find the expectation and variance of the $4$th generation.

$H(s) = \frac{1}{12} + \frac{1}{6} s + \frac{3}{4}s^2$
I start by finding $ H_2(s), H'_2 (s), H''_2 (s)$.
$H_2(s) = H(\frac{1}{12} + \frac{1}{6} s + \frac{3}{4}s^2)\\
H_2(s) = \frac{59}{576} + \frac{7s}{144}+ \frac{41s^2}{288}+\frac{3s^3}{16}+\frac{27s^4}{16} \\
H'_2(s) = \frac{7}{144}+\frac{41s}{144}+\frac{9s^2}{16}+\frac{27s^3}{16} \ \rightarrow  \mathbb{E}(z_2) = H'_2(1) = \frac{31}{12}\\$ 
Similarly, 
$H''_2(s) = \frac{41}{144} + \frac{9s}{8} + \frac{81s^2}{16} \ \rightarrow H''_2(1) = \frac{895}{144}$
Now, I am presuming it works like this: 
$H_4(s)= H_2[H_2(s)] \\
H'_4(s) =H'_2[H_2(s)]H'_2(s) \\
\ \ \ \ \ \ \ \ \        = \frac{31}{12} \times H'_2[H_2(s)] \\
 \  \ \ \  \  \ \ \ \ = \frac{31}{12} \times H''_2[H_2(s)].H'_2(s) \\
\ \ \ \ \ \ \ \ \  = \left[\frac{31}{12}\right]^2 \times H_2[H''_2(s)] \\
H'_4(1) = H_2 \left[\frac{895}{144}\right] \left[\frac{31}{12}\right]^2 \rightarrow \mathbb{E}(z_4)=  4541.16 $
Is this logic right. Is it the right direction?
 [/INST] Let $$P(s) = \sum_{k=0}^\infty \mathbb P(Z_1=k)s^k=\frac1{12}+\frac16s+\frac34s^2$$ be the generating function of the offspring distribution. Then
$$
m:=\mathbb E[Z_1] = \lim_{s\uparrow 1}P'(s) = \frac53
$$
and
$$
\mathbb E[Z_1(Z_1-1)] =\lim_{s\uparrow 1}P''(s)=\frac32,
$$
so 
$$
\sigma^2:= \mathsf{Var}(Z_1) = P''(1) + P'(1) - P'(1)^2 = \frac7{18}.
$$
Let $P_n(s)$ be the generating function of $Z_n$. Since $Z_n = \sum_{i=1}^{Z_{n-1}} Z_{n,i}$ where the $Z_{n,i}$ are independent with the same distribution as $Z_1$, we have $P_n(s)=P_{n-1}(P(s))$. To compute $m_n:=\mathbb E[Z_n]$, note that
$$
P_n'(s) = P_{n-1}'(P(s))P'(s),
$$
and letting $s\uparrow 1$ yields $m_n=m_{n-1}m$. This recursion implies that $m_n=m^n$. From $P_n(s) = P(P_n(s))$ we find by a rather tedious computation that
$$
\mathsf{Var}(Z_n) = \sigma^2m^{n-1}\left(\frac{1-m^n}{1-m} \right).
$$
Substituting $m=\frac53$ and $\sigma^2=\frac7{18}$, we have
\begin{align}
m_n &= \left(\frac53\right)^n\\
\mathsf{Var}(Z_n) &= \frac7{20}\left(\left(\frac{25}9\right)^n - \left(\frac53\right)^n\right).
\end{align}
For $n=4$, this gives
\begin{align}
\mathbb E[Z_4] &= \left(\frac53\right)^4 = \frac{625}{81}\approx 7.71605\\
\mathsf{Var}(Z_n) &= \frac7{20}\left(\left(\frac{25}9\right)^4 -\left(\frac53\right)^4\right) = \frac{119000}{6561}\approx 18.1375.
\end{align}
</s>