Discrete random variables
A probability measure $\mathbb P$ on $(\Omega, \mathcal F)$ is discrete if there exists a countable set $S\subseteq\Omega$ and function $(p_x: x\in S)$ such that $$ \mathbb P(A) = \sum_{x\in S\cap A} p_x $$ for all $A\in\mathcal F$.
A random variable $X$ is discrete if there is a countable set $S\subseteq \R$ such that $$ \prob(X\in S) = 1. $$
Let $X$ be a random variable with values in $\Z^+ = \set{0,1,2,\ldots}$.
The probability generating function of $X$ is given by the power series $$ G_X(t) = \expect(t^X) = \fsum n0\infty \prob(X=n)\, t^n. $$
-
The radius of convergence $R\geq 1$ since $G_X(1) = \fsum n0\infty\prob(X=n) = 1$.
-
$G_X(t)$ is unique to the distribution of $X$ since we can recover the coefficients in $G_X(t)$ by $$ \prob(X=n)=\frac1{n!} G_X^{(n)}(0). $$
Let $X,Y$ be independent random variables with values in $\Z^+$. Then "generating functions turn convolutions into products": $$ G_{X+Y}(t) = G_X(t)\, G_Y(t). $$
Let $N, X, X_1, X_2, X_3,\ldots$ be non-negative integer-valued independent random variables, and suppose $X,X_1,X_2,X_3,\ldots$ are identically distributed. Define the random sum $$ S_N = \fsum n1N X_n. $$
Then $$ G_{S_N} = G_N \circ G_X. $$
The $n$-th moment of $X$ is $\expect(X^n)$.
If $R>1$, $$ \begin{align*} G_X'(1) &= \fsum n1\infty \prob(X=n)\,n = \expect(X) \\ G_X''(1) &= \fsum n1\infty \prob(X=n)\,n(n-1) = \expect(X(X-1)) \\ \end{align*} $$ and so on.
If $R=1$, we can take the limit instead: $$ G_X'(t) = \fsum n1\infty \prob(X=n) nt^{n-1} \to \fsum n1\infty \prob(X=n) n = \expect(X). $$
In counting, generating functions help convert convolutions into products. Example (Catalan number)
"Distributions" just mean probability measure.
Given a discrete random variable $X$ with values in a countable set $S$, the distribution of $X$ is a discrete distribution $\mu_X$ on $\R$ by $$ \mu_X(B) = \prob(X\in B). $$
The mass function of $X$ is $$ p_x = \mu_X(\set{x}) = \prob(X=x). $$
We only consider the case when $\set{x}\in\mathcal F$ for all $x\in S$. Then $p_x = \mathbb P(\set{x})$. $p_x$ is called the mass function.
Distribution $X\sim$ |
Parameters |
Values |
Mass function $p_k$ |
Mean $\expect(X)$ |
Variance $\var(X)$ |
PGF $G_X(t)$ |
Radius of convergence $R$ |
|---|---|---|---|---|---|---|---|
Bernoulli $B(1,p)$ |
$p\in[0,1]$ |
$\set{0,1}$ |
$p_0=1-p$ |
$p$ |
$p(1-p)$ |
$1-p+pt$ |
$\infty$ |
Binomial $B(n,p)$ |
$n\in\N$ |
$\set{0,1,\ldots,n}$ |
$\pmat{n \\ k}p^k(1-p)^{n-k}$ |
$np$ |
$np(1-p)$ |
$(1-p+pt)^n$ |
$\infty$ |
Geometric $G(p)$ |
$p\in(0,1)$ |
$\Z^+$ |
$p(1-p)^k$ |
$\frac{1-p}{p}$ |
$\frac{1-p}{p^2}$ |
$\frac{p}{1-(1-p)t}$ |
$\frac{1}{1-p}$ |
$\N$ |
$p(1-p)^{k-1}$ |
||||||
Poisson $P(\lambda)$ |
$\lambda\in(0,\infty)$ |
$\Z^+$ |
$e^{-\lambda}\frac{\lambda^k}{k!}$ |
$\lambda$ |
$\lambda$ |
$e^{-\lambda+\lambda t}$ |
$\infty$ |
A Bernoulli random variable $X$ of parameter $p\in[0,1]$, denoted as $X\sim B(1,p)$, has a distribution on $\set{0,1}$ given by $$ p_0 = 1-p, \quad p_1 = p. $$
This is used to model the outcome of one biased coin toss.
-
Mean $\expect(X)=p$.
-
Variance $\var(X) = p-p^2$.
-
Generating function $$ G_X(t) = 1-p+pt, \qquad R=\infty. $$
A binomial random variable $X\sim B(n,p)$ of parameters $n\in\N$ and $p\in[0,1]$ has a distribution on $\set{0,1,2,\ldots,n}$ given by $$ p_k = \pmat{n\\k} p^k (1-p)^{n-k}, \quad k=0,1,\dots,n.$$
Use this to model the number of heads obtained on tossing a biased coin $n$ times.
If random variables $X\sim B(n,p)$ and $Y\sim B(m, p)$ are independent, then $X+Y\sim B(n+m, p)$.
Adding Bernoulli random variables on a product space
-
Expectation $=np$;
-
Variance $=np(1-p)$. (Derivation)
-
Generating function: either using binomial theorem or adding up $n$ independent Bernoulli variables, $$ G_X(t) = (1-p+pt)^n, \qquad R=\infty. $$
A multinomial random variable $X$ of parameters $n\in\N$ and $(p_1, p_2, \ldots, p_k)$ where $p_i\geq 0$ and $p_1+p_2+\ldots+p_k = 1$ has a distribution on the set of ordered partitions $(n_1, n_2, \ldots, n_k)$ of $n$, i.e. $n_1+n_2+\ldots+n_k = n$, given by $$ p_{(n_1,n_2,\ldots, n_k)} = \pmat{n \\ n_1, n_2, \ldots, n_k} p_1^{n_1}\times p_2^{n_2}\times \ldots \times p_k^{n_k}. $$
Use this to model the number of balls in each of $k$ boxes when we assign $n$ balls independently to box $i$ with probability $p_i$.
A geometric random variable $X\sim G(p)$ of parameter $p\in(0,1)$ has a distribution on $\N_0=\set{0,1,2,\ldots}$ given by $$ p_k = p(1-p)^k, \quad k=0,1,2,\ldots. $$
Alternatively some define it as the probability measure on $\N=\set{1,2,\dots}$ given by $$ p_k = p(1-p)^{k-1}, \quad k=1,2,\ldots. $$
Be clear with the definition. This is to model the number of tosses of a biased coin up to (or including) the first head.
Using the first definition,
-
Expectation $= (1-p)/p$. (Derivation)
-
Variance $= (1-p)/p^2$. (Derivation)
-
Generating function $$ G_X(t) = \fsum n0\infty (1-p)^n pt^n = \frac{p}{1-(1-p)t}, \qquad R=\frac{1}{1-p}.$$
A Poisson random variable $X\sim P(\lambda)$ of parameter $\lambda\in(0,\infty)$ has a distribution on $\N_0 = \set{0,1,2,\dots}$ given by $$ p_k = e^{-\lambda}\frac{\lambda^k}{k!},\quad k=0,1,2,\ldots. $$
If random variables $X\sim P(\lambda)$ and $Y\sim P(\mu)$ are independent, then $X+Y\sim P(\lambda+\mu)$.
-
Expectation $=\lambda$;
-
Variance $=\lambda$. (Derivation)
-
Generating function $$ G_X(t) = \fsum n0\infty e^{-\lambda} \frac{\lambda^n}{n!} t^n = e^{-\lambda + \lambda t}, \qquad R=\infty. $$
The Poisson distribution $P(\lambda)$ is the limit of the binomial distribution $B(n, \lambda/n)$ as $n\to\infty$.
A random process is a sequence $(X_n:n\geq 0)$ of random variables.
A random walk is a random process $(X_n: n\geq0)$ that has the form $$ X_n = x+Y_1 + \ldots + Y_n $$ where constant $x$ is the initial value and $(Y_n: n\geq 1)$ are a sequence of independent identically distributed random variables.
Consider a random walk where at each step $k$, $$ \prob(Y_k = +1) = p, \quad \prob(Y_k = -1) = 1-p \equiv q. $$ The gambler will walk away either when $X_n = a$ or 0.
The key is to see that if we condition on the first step, say $Y_1=1$, then $(X_{n+1})_{n\geq 0}$ is again a simple random walk with the same step distribution.
Denote $\prob_x$ and $\expect_x$ for probability and expectation regarding initial value $x$, and $$ T = \min\sb{n\geq 0}{X_n=0\text{ or } a}. $$
The process almost always terminates, i.e. $\prob(T<\infty) = 1$. (Derivation)
Let the probability of success be $h_x = \prob(X_T=a)$.
For $x=1,2,\ldots,a-1$, using the law of total probability $$ \begin{align*} h_x &= \prob(Y_1=1)\prob(X_T=a|Y_1=1)+\prob(Y_1=-1)\prob(X_T=a|Y_1=-1) \\ &= ph_{x+1} + qh_{x-1} \end{align*} $$ and boundary condition is $$ h_0 = 0, \quad h_a=1. $$ Solving (derivation), $$ h_x = \begin{cases} \dfrac ax, &p=\dfrac12, \\ \dfrac{1-(p/q)^x}{1-(p/q)^a}, &p\neq\dfrac12. \end{cases} $$
Let the mean time to absorption be $\tau_x = \expect_x(T)$.
For $x=1,2,\ldots,a-1$, using the law of total expectation, $$ \begin{align*} \tau_x &= \prob(Y_1=1)\expect(X_T=a|Y_1=1)+\prob(Y_1=-1)\expect(X_T=a|Y_1=-1) \\ &= p(1+\tau_{x+1}) + q(1+\tau_{x-1}) \\ &= 1+p\tau_{x+1} + q\tau_{x-1}. \end{align*} $$ and boundary condition is $$ \tau_0 = 0,\quad \tau_a = 0. $$ Solving (Derivation), $$ \tau_x = \begin{cases} x(a-x),& p=\dfrac12,\\ \dfrac{x}{q-p}-\dfrac{a}{q-p}\dfrac{(q/p)^x - 1}{(q/p)^a-1},& p\neq\dfrac12. \end{cases} $$
This is to model a population, with $X_n$ being the size of the population in generation $n$, and $Y_{k,n}$ is the number of offspring of the $k$-th individual in generation $n$.
A random process $(X_n: n\geq 0)$ is a branching process (Galton-Watson process) if it is in the form $$ X_0 = 1, \quad X_{n+1} = \fsum n1{X_n} Y_{k,n} $$ for some array array $(Y_{k,n}: k\geq1, n\geq0)$ of independent and identically distributed non-negative integer-valued random variables. (The distribution is called the offspring distribution.)
Set $\mu=\expect(X_1)$. Conditioning on $X_n$, $$ \expect(X_{n+1}|X_n=m) = \expect(Y_{1,n}+\ldots+Y_{m,n}) = m\mu $$ so using the law of total expectation, $$ \begin{align*} \expect(X_{n+1}) &= \fsum m0\infty \expect(X_{n+1}|X_n=m)\,\prob(X_n=m) \\ &= \mu\fsum m0\infty m\prob(X_n=m) \\ &= \mu\expect(X_n). \end{align*} $$ Applying the boundary condition of $\expect(X_0)=1$, we have $\expect(X_n)=\mu^n$.
Generating function: let $F(t) = \expect(t^{X_1})$ and $F_n(t)=\expect(t^{X_n})$. Then using the result about random sums, $$ F_n(t) = F_{n-1}\big(F(t)\big) = \ub{F\circ F\circ\ldots\circ F}_\text{$n$-fold composition}(t). $$
A feature to exploit is that if we condition on $\set{X_1=m}$, the descendants of any individuals in generation 1 is another branching process.
Let $q_n = \prob(X_n=0)$ and the extinction probability $q=\prob(X_n=0\text{ for some } n\geq0)$. Since $\set{X_1=0}\subseteq\set{X_2=0}\subseteq\ldots$ and $\bigcup_n \set{X_n=0} = \set{X_n=0\text{ for some } n\geq 0}$, by continuity of probability, $q_n\to q$.
Note that $$ q_n = \prob(X_n=0) = F_n(0)=\ub{F\circ F\circ\ldots\circ F}_\text{$n$-fold composition}(0).$$ Alternatively we can condition on the first generation $$ \begin{align*} q_n &= \fsum m0\infty \prob(X_1=m)\prob(X_n=0|X_1=m) \\ &= \fsum m0\infty \prob(X_1=m) q_{n-1}^m = F(q_{n-1}) \end{align*} $$ since $\set{X_n=0|X_1=m}$ means that each of the descendants of the $m$ individuals in generation 1 go extinct, which are independent events.
And using analysis (Derivation), $q$ is the smallest non-negative solution of $q=F(q)$. Also if $\prob(X_1=1)<1$, then $q<1$ iff $\mu=\expect(X_1)>1$.
List the individuals in increasing order. Set $S_0=1$, and for $n\geq 1$ let $S_n$ for the number of offspring of all visited individuals who have not yet been visited (think about breadth-first search).
Then the jumps of $(S_n:n\geq0)$ are independent with the same distribution as $X_1-1$.