STAT 101
M04 · L01
Module 4

Random Variables

The bridge between probability and numbers. Every statistical model speaks the language of random variables.

01 / 13
STAT 101
M04 · L01
Definition

Not a Variable. A Function.

A random variable X maps each outcome ω in the sample space to a real number. The randomness comes from the experiment, not from X itself.

Formal
X : Ω → ℝ    X(ω) = number
02 / 13
STAT 101
M04 · L01
The key distinction

Discrete vs. Continuous

Discrete
Counts things
Finite / countable values
Continuous
Measures things
Uncountable continuum
03 / 13
STAT 101
M04 · L01
For discrete random variables

Probability Mass Function

p(x) = P(X = x). How much probability mass sits at each point?

PMF
p(x) = P(X = x),\quad \sum_x p(x) = 1
04 / 13
STAT 101
M04 · L01
For continuous random variables

Probability Density Function

Probability = area under f(x). The value f(x) itself is a density, not a probability — it can exceed 1.

Key insight
P(a ≤ X ≤ b) = ∫ f(x) dx from a to b
05 / 13
STAT 101
M04 · L01
Works for both types

Cumulative Distribution Function

F(x) = P(X ≤ x). Accumulates probability up to x. Always runs from 0 to 1, never decreases.

Discrete shape
Staircase
Continuous shape
Smooth S-curve
06 / 13
STAT 101
M04 · L01
Center of the distribution

Expected Value

E[X] is the probability-weighted average — the balancing point of the distribution. Need not be an achievable value.

E[X] discrete
E[X] = \sum_x x\,p(x)
07 / 13
STAT 101
M04 · L01
The most powerful property

Linearity of Expectation

  • E[aX + b] = a·E[X] + b
  • E[X + Y] = E[X] + E[Y] always — even if dependent
  • No assumptions about independence needed
  • Used in almost every probabilistic argument
08 / 13
STAT 101
M04 · L01
Spread of the distribution

Variance & Std. Deviation

Var(X) = E[(X − μ)²] = E[X²] − μ². Takes squared units. Standard deviation σ = √Var(X) restores original units.

Key property
Var(aX + b) = a² Var(X)   (shift b doesn’t change spread)
09 / 13
STAT 101
M04 · L01
Functions of random variables

LOTUS: No Rederivation Needed

E[g(X)] = ∑ g(x) p(x). Apply g to each value of X, weight by P(X = x). Variance is just LOTUS with g(x) = (x − μ)².

10 / 13
STAT 101
M04 · L01
Why random variables matter

Every Model Is a Random Variable

  • Regression: Y = f(X) + ε where ε is a random variable
  • Hypothesis tests use test statistics as random variables
  • Separates the model from the specific experiment
  • Common toolkit for an endless variety of problems
11 / 13
STAT 101
Knowledge Check

Check what stuck

Four questions from this lesson. Answer to see why — the explanation appears whether you were right or wrong. Nothing is scored or saved.

Question 1 of 0
Score 0/0

12 / 13
STAT 101
Summary
Recap

What you learned

Random variables, PMF, PDF, CDF, expected value, linearity of expectation, variance, standard deviation, and LOTUS — the core language of probability.

13 / 13