Random Variables

Discrete RVs

Takes countable values. PMF: \(P(X=x)\geq 0\), \(\sum P(X=x)=1\).

Continuous RVs

PDF \(f(x)\geq 0\), \(\int_{-\infty}^{\infty}f(x)dx=1\). \(P(a\leq X\leq b)=\int_a^b f(x)dx\).

Expectation & Variance

PropertyStatement
E[X]\(\sum x\,P(X=x)\) or \(\int x\,f(x)dx\)
Var(X)\(E[X^2]-(E[X])^2\)
Linearity\(E[aX+b]=aE[X]+b\)

Examples

Example 1. X ~ Bernoulli(p). Find E[X] and Var(X).

Solution. E[X] = p. Var(X) = p(1−p).

Background

A random variable (RV) is a function that assigns a numerical value to each outcome in a sample space. It transforms qualitative outcomes into numbers amenable to mathematical analysis. Discrete RVs take countable values; continuous RVs take values in an interval.

The cumulative distribution function (CDF) \(F(x)=P(X\leq x)\) is defined for all RVs and completely characterizes the distribution. For discrete RVs, the probability mass function (PMF) gives \(P(X=x)\); for continuous RVs, the probability density function (PDF) \(f(x)\) satisfies \(P(a\leq X\leq b)=\int_a^b f(x)\,dx\).

Key properties: \(E[g(X)]=\sum g(x)P(X=x)\) or \(\int g(x)f(x)\,dx\). The variance \(\text{Var}(X)=E[(X-\mu)^2]=E[X^2]-\mu^2\). For independent RVs, \(\text{Var}(X+Y)=\text{Var}(X)+\text{Var}(Y)\).

Moment generating functions (MGFs) \(M_X(t)=E[e^{tX}]\) uniquely determine distributions and simplify computing moments: \(E[X^n]=M_X^{(n)}(0)\). The MGF of a sum of independent RVs is the product of their MGFs.

Further Reading & Context

The study of random variables connects to many areas of mathematics and its applications. Understanding the foundational definitions and theorems provides the basis for advanced work in analysis, algebra, and applied mathematics.

Historical development: most mathematical concepts evolved over centuries, with contributions from mathematicians across many cultures. The modern axiomatic treatment provides rigor, while computational tools enable practical application.

In modern mathematics, this topic appears in graduate courses and research across pure and applied mathematics. Connections to computer science, physics, and engineering make it a versatile and important area of study. Mastery of the core results and techniques opens doors to research in number theory, analysis, geometry, and beyond.

Recommended next steps: work through the standard theorems with full proofs, explore the connections to related topics listed above, and practice with a variety of problems ranging from computational exercises to theoretical proofs. The interplay between different areas of mathematics is one of the subject's greatest rewards.

Deep Dive: Random Variables

This lesson extends core ideas for random variables with rigorous reasoning, edge-case checks, and application framing in statistics.

Practice Set

Practice. Derive one main result on this page and validate with a numeric or geometric check.

Goal. Confirm assumptions, transformation steps, and final interpretation.

References & Editorial Notes

  • Stewart, Calculus.
  • Strang, Introduction to Linear Algebra.
  • Apostol, Mathematical Analysis.

Last editorial review: 2026-04-14.