Skip to content

Random Variables

2.1 Definition and Distribution Functions

Definition. A random variable is a measurable function X:ΩRX : \Omega \to \mathbb{R}. The cumulative distribution function (CDF) of XX is

FX(x)=P(Xx)F_X(x) = P(X \leq x)

Proposition 2.1 (Properties of the CDF).

  1. FF is non-decreasing: if aba \leq bThen F(a)F(b)F(a) \leq F(b).
  2. limxF(x)=0\lim_{x \to -\infty} F(x) = 0 and limx+F(x)=1\lim_{x \to +\infty} F(x) = 1.
  3. FF is right-continuous: limxa+F(x)=F(a)\lim_{x \to a^+} F(x) = F(a).

Proof. (1) If aba \leq bThen {Xa}{Xb}\{X \leq a\} \subseteq \{X \leq b\}So F(a)=P(Xa)P(Xb)=F(b)F(a) = P(X \leq a) \leq P(X \leq b) = F(b) by Proposition 1.1(3).

(2) As xx \to -\inftyThe events {Xx}\{X \leq x\} decrease to \emptysetSo by continuity from above of probability measures, F(x)0F(x) \to 0. As x+x \to +\inftyThe events increase to Ω\OmegaSo F(x)1F(x) \to 1.

(3) As xa+x \to a^+The events {Xx}\{X \leq x\} decrease to {Xa}\{X \leq a\}Giving right-continuity. \blacksquare

2.2 Discrete Random Variables

A random variable is discrete if its range is countable. The probability mass function (PMF) is pX(x)=P(X=x)p_X(x) = P(X = x).

Definition (Expected Value). For a discrete random variable:

E[X]=xxpX(x)E[X] = \sum_{x} x\, p_X(x)

Provided the sum converges absolutely.

Definition (Variance). Var(X)=E[(Xμ)2]=E[X2](E[X])2\mathrm{Var}(X) = E[(X - \mu)^2] = E[X^2] - (E[X])^2 where μ=E[X]\mu = E[X].

Proposition 2.2 (Linearity of Expectation). E[aX+bY]=aE[X]+bE[Y]E[aX + bY] = aE[X] + bE[Y] for any random variables XX, YY and constants aa, bb.

Proof. Direct computation from the definition of expected value. For the discrete case:

E[aX+bY]=x,y(ax+by)pX,Y(x,y)=axxpX(x)+byypY(y)=aE[X]+bE[Y]E[aX + bY] = \sum_{x,y} (ax + by)\, p_{X,Y}(x,y) = a\sum_x x\, p_X(x) + b\sum_y y\, p_Y(y) = aE[X] + bE[Y]

\blacksquare

2.3 Continuous Random Variables

A random variable is continuous if its CDF is absolutely continuous, i.e., there exists a probability density function (PDF) fXf_X such that

FX(x)=xfX(t)dtF_X(x) = \int_{-\infty}^{x} f_X(t)\, dt

Key properties:

  1. fX(x)0f_X(x) \geq 0 for all xx.
  2. fX(x)dx=1\int_{-\infty}^{\infty} f_X(x)\, dx = 1.
  3. P(aXb)=abfX(x)dxP(a \leq X \leq b) = \int_a^b f_X(x)\, dx.
  4. P(X=a)=0P(X = a) = 0 for any single point aa.

2.4 Common Distributions

Discrete distributions:

DistributionPMFE[X]E[X]Var(X)\mathrm{Var}(X)
Bernoulli(p)(p)px(1p)1xp^x(1-p)^{1-x}, x{0,1}x \in \{0,1\}ppp(1p)p(1-p)
Binomial(n,p)(n,p)(nx)px(1p)nx\binom{n}{x}p^x(1-p)^{n-x}npnpnp(1p)np(1-p)
Poisson(λ)(\lambda)eλλx/x!e^{-\lambda}\lambda^x / x!λ\lambdaλ\lambda
Geometric(p)(p)(1p)x1p(1-p)^{x-1}p, x1x \geq 11/p1/p(1p)/p2(1-p)/p^2

Continuous distributions:

DistributionPDFE[X]E[X]Var(X)\mathrm{Var}(X)
Uniform(a,b)(a,b)1/(ba)1/(b-a) on [a,b][a,b](a+b)/2(a+b)/2(ba)2/12(b-a)^2/12
Exponential(λ)(\lambda)λeλx\lambda e^{-\lambda x}, x0x \geq 01/λ1/\lambda1/λ21/\lambda^2
N(μ,σ2)N(\mu, \sigma^2)1σ2πe(xμ)2/(2σ2)\frac{1}{\sigma\sqrt{2\pi}}e^{-(x-\mu)^2/(2\sigma^2)}μ\muσ2\sigma^2

2.5 The Normal Distribution

Definition. XN(μ,σ2)X \sim N(\mu, \sigma^2) if XX has PDF f(x)=1σ2πexp((xμ)22σ2)f(x) = \frac{1}{\sigma\sqrt{2\pi}}\exp\left(-\frac{(x-\mu)^2}{2\sigma^2}\right).

Theorem 2.3 (Standardisation). If XN(μ,σ2)X \sim N(\mu, \sigma^2)Then Z=(Xμ)/σN(0,1)Z = (X - \mu)/\sigma \sim N(0, 1).

Proof. The CDF of ZZ: P(Zz)=P(Xμ+σz)=μ+σz1σ2πet2/2dtP(Z \leq z) = P(X \leq \mu + \sigma z) = \int_{-\infty}^{\mu + \sigma z} \frac{1}{\sigma\sqrt{2\pi}} e^{-t^2/2}\, dt. Substituting u=(tμ)/σu = (t - \mu)/\sigma: =z12πeu2/2du= \int_{-\infty}^{z} \frac{1}{\sqrt{2\pi}} e^{-u^2/2}\, duWhich is the CDF of N(0,1)N(0, 1). \blacksquare

Theorem 2.4 (Moment Generating Function). If XN(μ,σ2)X \sim N(\mu, \sigma^2)Then

MX(t)=E[etX]=exp(μt+σ2t22)M_X(t) = E[e^{tX}] = \exp\left(\mu t + \frac{\sigma^2 t^2}{2}\right)

Proof. MX(t)=etx1σ2πe(xμ)2/(2σ2)dxM_X(t) = \int_{-\infty}^{\infty} e^{tx} \frac{1}{\sigma\sqrt{2\pi}} e^{-(x-\mu)^2/(2\sigma^2)}\, dx. Completing the square in the exponent and evaluating the Gaussian integral gives the result. \blacksquare

2.6 Moment Generating Functions

Definition. The moment generating function (MGF) of XX is MX(t)=E[etX]M_X(t) = E[e^{tX}] (when it exists in a neighbourhood of t=0t = 0).

Theorem 2.5. If the MGF exists in a neighbourhood of 0, it uniquely determines the distribution. Furthermore, E[Xn]=MX(n)(0)E[X^n] = M_X^{(n)}(0).

2.7 Worked Examples

Problem. Let XPoisson(3)X \sim \mathrm{Poisson}(3) and YPoisson(5)Y \sim \mathrm{Poisson}(5) be independent. Find the distribution of X+YX + Y.

Solution

The MGF of XPoisson(λ)X \sim \mathrm{Poisson}(\lambda) is MX(t)=eλ(et1)M_X(t) = e^{\lambda(e^t - 1)}.

MX+Y(t)=MX(t)MY(t)=e3(et1)e5(et1)=e8(et1)M_{X+Y}(t) = M_X(t) \cdot M_Y(t) = e^{3(e^t - 1)} \cdot e^{5(e^t - 1)} = e^{8(e^t - 1)}.

This is the MGF of Poisson(8)\mathrm{Poisson}(8). Since the MGF uniquely determines the distribution, X+YPoisson(8)X + Y \sim \mathrm{Poisson}(8).

\blacksquare

Worked Example: Minimum of Exponential Random Variables

Solution. Let X1,,XnX_1, \ldots, X_n be independent with XiExp(λi)X_i \sim \mathrm{Exp}(\lambda_i). Find the distribution of M=min(X1,,Xn)M = \min(X_1, \ldots, X_n).

P(M>t)=P(X1>t,,Xn>t)=i=1nP(Xi>t)=i=1neλit=e(λ1++λn)tP(M > t) = P(X_1 > t, \ldots, X_n > t) = \prod_{i=1}^{n} P(X_i > t) = \prod_{i=1}^{n} e^{-\lambda_i t} = e^{-(\lambda_1 + \cdots + \lambda_n)t}

So P(Mt)=1eλtP(M \leq t) = 1 - e^{-\lambda t} where λ=i=1nλi\lambda = \sum_{i=1}^{n} \lambda_i. This means MExp(λ)M \sim \mathrm{Exp}(\lambda). \blacksquare