Skip to content

Random Variables

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(X≤x)F_X(x) = P(X \leq x)

Proposition 2.1 (Properties of the CDF).

  1. FF is non-decreasing: if a≤ba \leq bThen F(a)≤F(b)F(a) \leq F(b).
  2. lim⁡x→−∞F(x)=0\lim_{x \to -\infty} F(x) = 0 and lim⁡x→+∞F(x)=1\lim_{x \to +\infty} F(x) = 1.
  3. FF is right-continuous: lim⁡x→a+F(x)=F(a)\lim_{x \to a^+} F(x) = F(a).

Proof. (1) If a≤ba \leq bThen {X≤a}⊆{X≤b}\{X \leq a\} \subseteq \{X \leq b\}So F(a)=P(X≤a)≤P(X≤b)=F(b)F(a) = P(X \leq a) \leq P(X \leq b) = F(b) by Proposition 1.1(3).

(2) As x→−∞x \to -\inftyThe events {X≤x}\{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 x→a+x \to a^+The events {X≤x}\{X \leq x\} decrease to {X≤a}\{X \leq a\}Giving right-continuity. ■\blacksquare

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]=∑xx pX(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)=a∑xx pX(x)+b∑yy pY(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

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(a≤X≤b)=∫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.

Discrete distributions:

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

Continuous distributions:

DistributionPDFE[X]E[X]Var(X)\mathrm{Var}(X)
Uniform(a,b)(a,b)1/(b−a)1/(b-a) on [a,b][a,b](a+b)/2(a+b)/2(b−a)2/12(b-a)^2/12
Exponential(λ)(\lambda)λe−λx\lambda e^{-\lambda x}, x≥0x \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

Definition. X∼N(μ,σ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 X∼N(μ,σ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(Z≤z)=P(X≤μ+σz)=∫−∞μ+σz1σ2πe−t2/2 dtP(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πe−u2/2 du= \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 X∼N(μ,σ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

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).

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

Solution

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

MX+Y(t)=MX(t)⋅MY(t)=e3(et−1)⋅e5(et−1)=e8(et−1)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+Y∼Poisson(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 Xi∼Exp(λ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(M≤t)=1−e−λtP(M \leq t) = 1 - e^{-\lambda t} where λ=∑i=1nλi\lambda = \sum_{i=1}^{n} \lambda_i. This means M∼Exp(λ)M \sim \mathrm{Exp}(\lambda). ■\blacksquare