Random Variables
& Distributions
Explore how random variables map outcomes to numbers, and how distribution functions capture their probabilistic behavior.
What Is a Random Variable?
A random variable is a function \( X : \Omega \to \mathbb{R} \) that assigns a real number to every outcome in a sample space \( \Omega \). It transforms abstract experimental outcomes into numerical quantities we can analyze mathematically.
Discrete vs Continuous
Random variables fall into two fundamental classes based on the nature of their range.
Why Do Distributions Matter?
A distribution function completely characterizes the probabilistic behavior of a random variable. Every quantity of interest: means, variances, tail probabilities, quantiles: derives from it.
The Cumulative Distribution Function
The CDF is the universal descriptor for any random variable. It is defined as:
Visualizing the CDF
PMF vs PDF: Key Distinction
| PMF \( p(x) \) | PDF \( f(x) \) | |
|---|---|---|
| Type | Discrete | Continuous |
| Gives | \( P(X = x) \) directly | Density, not probability |
| Values | \( 0 \leq p(x) \leq 1 \) | \( f(x) \geq 0 \), can exceed 1 |
| Sums/Integrates to | \( \sum_x p(x) = 1 \) | \( \int_{-\infty}^{\infty} f(x)\,dx = 1 \) |
| CDF from | \( F(x) = \sum_{t \leq x} p(t) \) | \( F(x) = \int_{-\infty}^{x} f(t)\,dt \) |
Expectation and Variance
Continuous: \( E[X] = \int_{-\infty}^{\infty} x \cdot f(x)\,dx \)
The "center of mass" of the distribution.
Measures spread around the mean. Standard deviation: \( \sigma = \sqrt{\text{Var}(X)} \).
How to Apply: Working with Distributions
Example 1: Discrete PMF
Let \( X \) have PMF: \( p(1) = 0.2 \), \( p(2) = 0.3 \), \( p(3) = 0.3 \), \( p(4) = 0.2 \). Find \( E[X] \) and \( \text{Var}(X) \).
Example 2: Continuous PDF
Let \( f(x) = 2x \) for \( 0 \leq x \leq 1 \), and 0 otherwise. Find \( P(X > 0.5) \) and \( E[X] \).
Example 3: The Normal Distribution
If \( X \sim N(\mu, \sigma^2) \), its PDF is:
Important Named Distributions
| Distribution | PMF/PDF | \( E[X] \) | \( \text{Var}(X) \) |
|---|---|---|---|
| Bernoulli(\( p \)) | \( p^x(1-p)^{1-x} \) | \( p \) | \( p(1-p) \) |
| Binomial(\( n,p \)) | \( \binom{n}{x}p^x(1-p)^{n-x} \) | \( np \) | \( np(1-p) \) |
| Poisson(\( \lambda \)) | \( \frac{e^{-\lambda}\lambda^x}{x!} \) | \( \lambda \) | \( \lambda \) |
| Exponential(\( \lambda \)) | \( \lambda e^{-\lambda x} \) | \( 1/\lambda \) | \( 1/\lambda^2 \) |
| Normal(\( \mu,\sigma^2 \)) | \( \frac{1}{\sigma\sqrt{2\pi}}\exp\!\left(-\frac{(x-\mu)^2}{2\sigma^2}\right) \) | \( \mu \) | \( \sigma^2 \) |
Moment Generating Functions
The moment generating function (MGF) of \( X \) is defined as:
Common Mistakes to Avoid
Question 1 of 5
Which of the following is a valid probability mass function?
Question 2 of 5
If \( X \) has PDF \( f(x) = 3x^2 \) for \( 0 \leq x \leq 1 \), what is \( E[X] \)?
Question 3 of 5
For the standard normal distribution, which property of the CDF \( \Phi(x) \) is true?
Question 4 of 5
If \( X \sim \text{Poisson}(\lambda = 4) \), what are \( E[X] \) and \( \text{Var}(X) \)?
Question 5 of 5
The MGF of \( X \) is \( M_X(t) = e^{3t + 2t^2} \). What is \( \text{Var}(X) \)?