% vim: tw=50
% 22/02/2022 11AM

\begin{note*}
    PGF is much nicer than PMF of $X$!
\end{note*}

\begin{example*}
    $X \sim \mathrm{Bin}(n, p)$
    \[ X = X_1 + \cdots X_n \]
    (Identical independently distributed
    $\mathrm{Bern}(p)$)
    \[ G_X(z) = (1 - p + pz)^n \]
\end{example*}

\begin{example*}
    $X \sim \mathrm{Poi}(\lambda)$, $Y \sim
    \mathrm{Poi}(\mu)$ independent.
    \[ G_X(z) = e^{\lambda (z - 1)}, \qquad G_Y(z)
    = e^{\mu (z - 1)} \]
    We will study $Z = X + Y$.
    \begin{align*}
        G_{X + Y}(z)
        &= G_X(y)G_Y(z) \\
        &= e^{\lambda (z - 1)} e^{\mu (z - 1)} \\
        &= e^{(\lambda + \mu)(z - 1)} \\
        &= \text{PGF of $\mathrm{Poi}(\lambda +
        \mu)$}
    \end{align*}
    So $X + Y \sim \mathrm{Poisson}(\lambda +
    \mu)$.
\end{example*}

\subsubsection*{PGF for Random Sums}

Setting: $X_1, X_2, \dots$ IID with same
distribution as $X$. $X$ takes values in $\{0, 1,
2, \dots\}$ and $N$ is a random value taking
values in $\{0, 1, 2, \dots\}$ \emph{independent}
of $(X_n)$.

\begin{remark*}
    Perfect pairing with PGFs.
    \begin{align*}
        \EE[z^{X_1 + \cdots + X_n}]
        &= \sum_{n \ge 0} \EE[z^{X_1 + \cdots +
        X_N} \mid N = n] \PP(N = n) \\
        &= \sum_{n \ge 0} \EE[z^{X_1 + \cdots +
        X_n} \mid N = n] \PP(N = n) \\
        &= \sum_{n \ge 0} \EE[z^{X_1 + \cdots +
        X_n}] \PP(N = n) \\
        &= \sum_{n \ge 0} \EE[z^{X_1}] \cdots
        \EE[z^{X_n}] \PP(N = n) \\
        &= \sum_{n \ge 0} (G_X(z))^n \PP(N = n) \\
        &= G_N(G_X(z))
    \end{align*}
\end{remark*}

\begin{example*}
    $X_i \sim \mathrm{Bern}(p)$, $N \sim
    \mathrm{Poisson}(\lambda)$.
    \[ G_{X_i}(z) = (1 - p) + pz \]
    \[ G_N(s) = e^{\lambda (s - 1)} \]
    Interpretation: ``Poisson thinning'', for
    example ``$\mathrm{Poi}(\lambda)$ misprints,
    each gets found with $\PP = 1 - p$.'' (see Q7
    on Example sheet)
    \[ Y = X_1 + \cdots + X_N \]
    \begin{align*}
        G_Y(z)
        &= G_N(G_{X_i}(z)) \\
        &= e^{\lambda [1 - p + pz - 1]} \\
        &= e^{\lambda p (z - 1)} \\
        &= \text{PGF of $\mathrm{Poi}(\lambda p)$}
    \end{align*}
\end{example*}

\noindent
In general: PMF of $X_1 + \cdots + X_n$ is
horrible, $G_N(G_X(z))$ is nice.

\subsubsection*{Branching Process}

``Modelling growth of a population''. \\
History:
\begin{itemize}
    \item Bienaym\'e (1840s)
    \item Galton-Watson (1870s)
\end{itemize}
\ul{Setting}: Random branching tree. \\
Let $X$ be a random variable on $\{0, 1, 2,
\dots\}$.
\begin{itemize}
    \item One individual at generation 0
    \item has a random number of children, with
        distribution $X$. If 0, end. Each child
        independently has some children, each with
        distribution $X$.
    \item Continue.
\end{itemize}
\begin{center}
    \includegraphics[width=0.6\linewidth]
    {images/b55a3a42a2ec11ec.png}
\end{center}
\ul{Goal}:
\begin{itemize}
    \item Study number of individuals in each
        generation
    \item Total population size: is it
        \emph{finite} of \emph{infinite}.
\end{itemize}
\ul{Reduction}: Write $Z_n = \text{number of
individuals in generation $n$}$.
\[ Z_0 = 1, \qquad Z_1 \sim X, \qquad Z_{n + 1} =
Z_1^{(n)} + \cdots + X_{Z_n}^{(n)} \]
``$X_k^{(n)} = \text{number of children of $k$-th
individual in generation $n$}$''.

\begin{note*}
    If $Z_n = 0$ then $Z_{n + 1} = Z_{n + 2} =
    \cdots = 0$.
\end{note*}

\noindent
\ul{Key Observation}: $Z_{n + 1}$ is a random sum,
\[ \EE[Z_{n + 1}] = \EE[X]\EE[Z_n] \]
Induction:
\[ \EE[Z_n] = (\EE[X])^n \]
Notation:
\[ \mu = \EE[X] \implies \EE[Z_n] = \mu^n .\]
Using PGFs: Let $G$ be the PGF of $X$, $G_n$ the
PGF of $Z_n$. \\
Random sums:
\[ G_{n + 1}(z) = G_n(G(z)) \]
Induct:
\[ G_n(z) = \ub{G(\cdots G(}_{\text{$n$ $G$s}} z)
\cdots) \]
\ul{Key event of interest}:
\[ \{Z_n = 0\}, \qquad q_n = \PP(Z_n = 0) \]
``extinct by generation $n$''.

\begin{definition*}[Extinction Probability]
    \[ q = \PP(Z_n = 0 \text{ for $n \ge 1$}) \]
    (which is the probability that the population
    size is finite)
\end{definition*}

\begin{note*}
    $\{Z_n = 0\} \subseteq \{Z_{n + 1} = \}$. Why?
    Because $Z_n = 0 \implies Z_{n + 1} = 0$, and
    \[ \{Z_n \text{ for some $n \ge 1$}\} =
    \bigcup_{n \ge 1} \{Z_n = 0\} \]
    So continuity gives
    \[ \PP(Z_n = 0) \uparrow \PP \left( \bigcup_{n
    \ge 1} \{Z_n = 0\} \right) \]
    so
    \[ q_n \uparrow q \]
    as $n \to \infty$.
\end{note*}

\noindent
\ul{Classification}:
\begin{itemize}
    \item $\mu < 1$ \emph{subcritical}
    \item $\mu = 1$ \emph{critical}
    \item $\mu > 1$ \emph{supercritical}
\end{itemize}
Degenerate case: $\PP(X = 1) = 1$. Boring $\to$
exercise.

\begin{theorem*}
    Assume $\PP(X = 1) \neq 1$. Then $q = 1$ (i.e.
    ``always finite / dies out'') if and only if
    $\mu = \EE[X] \le 1$.
\end{theorem*}

\begin{remark*}
    Interesting that depends on $X$ only through
    $\EE$.
\end{remark*}
