Chapter 2: Random Variables
Core Objective
Understand how to define, classify, and manipulate random variables (RVs),
compute expectations and moments, and apply these concepts in both discrete
and continuous contexts for quantitative risk analysis.
Key Topics
0.1 1. Definition of a Random Variable
A random variable (RV) is a function that maps outcomes in a sample space
(Ω) to numeric values.
• Notation:
– Uppercase (e.g., X) = Random variable
– Lowercase (e.g., x) = Realization (specific value)
• Example: x = X(ω) where ω ∈ Ω
0.2 2. Discrete vs. Continuous Random Variables
• Discrete RV:
– Takes values from a countable set.
– Described by Probability Mass Function (PMF).
– Example: Bernoulli, Binomial.
• Continuous RV:
– Takes values from an uncountable set (e.g., R).
– Described by Probability Density Function (PDF).
– Example: Normal, Exponential.
1
0.3 3. Probability Functions
• PMF (fX (x)): For discrete RVs, gives Pr(X = x).
– Must satisfy:
∗ fX (x) ≥ 0
∗
P
x∈R(X) fX (x) = 1
• CDF (FX (x)): Cumulative probability Pr(X ≤ x).
– Discrete: Step function
– Continuous: Integral of PDF
– Properties:
∗ FX (x) is non-decreasing
∗ limx→−∞ FX (x) = 0
∗ limx→∞ FX (x) = 1
• PDF (for continuous RVs):
d
– fX (x) = dx FX (x)
– Probability of a specific value = 0 (Pr(X = x) = 0 for continuous RVs)
0.4 What it represents:
The PMF P (X = x) gives the exact probability that a discrete random
variable X takes a specific value x.
• Example: Rolling a die → P (X = 3) = 61 .
• Unlike the PDF (which is a density), the PMF is a true probability (be-
tween 0 and 1).
0.5 Key Properties:
• 0 ≤ P (X = x) ≤ 1
• Sum of all PMF values = 1:
X
P (X = x) = 1
all x
2
1 Cumulative Distribution Function (CDF) —
Works for Both Discrete and Continuous Vari-
ables
1.1 For Discrete Variables:
• The CDF is a step function obtained by summing the PMF:
X
FX (x) = P (X ≤ x) = P (X = k)
k≤x
• Example (Die Roll):
1 1 1
FX (3) = P (X = 1) + P (X = 2) + P (X = 3) = + + = 0.5
6 6 6
1.2 For Continuous Variables:
• The CDF is obtained by integrating the PDF:
Z x
FX (x) = fX (t) dt
−∞
2 Probability Density Function (PDF) — Only
for Continuous Variables
2.1 No PMF Equivalent:
• For continuous variables, P (X = x) = 0 (since there are infinitely many
possible values).
• Instead, we use the PDF to describe probability density, and probabili-
ties are calculated over intervals:
Z b
P (a ≤ X ≤ b) = fX (x) dx
a
3 Comparison: PMF vs. PDF vs. CDF
Feature PMF (Discrete) PDF (Continuous) CDF (Both)
Definition P (X = x) fX (x) (density) P (X ≤ x)
Range 0≤P ≤1
P RfX∞(x) ≥ 0 (can be > 1) 0 ≤ FX (x) ≤ 1
Total Sum/Integral P (X = x) = 1 −∞ X
f (x) dx = 1 Rx FX (∞) = 1
P
How to get CDF Sum PMF: FX (x) = k≤x P (X = k) Integrate PDF: FX (x) = −∞ fX (t) dt —
How to get PMF/PDF from CDF Take differences: P (X = x) = FX (x) − FX (x− ) d
Differentiate: fX (x) = dx FX (x) —
3
4 Examples
4.1 Discrete Example (Die Roll)
• PMF:
1
P (X = k) = , k = 1, 2, . . . , 6
6
• CDF:
1 1 1
FX (3) = P (X ≤ 3) = + + = 0.5
6 6 6
4.2 Continuous Example (Exponential Waiting Time)
• PDF:
fX (x) = λe−λx , x≥0
• CDF:
FX (x) = 1 − e−λx , x≥0
• Probability of waiting between 2 and 5 mins:
P (2 ≤ X ≤ 5) = FX (5) − FX (2) = e−2λ − e−5λ
5 Key Takeaways
• PMF is for discrete variables (exact probabilities at points).
• PDF is for continuous variables (density, not a probability itself).
• CDF works for both and gives cumulative probability up to a point.
• From PMF → CDF: Sum the probabilities.
• From PDF → CDF: Integrate the density.
• From CDF → PMF (discrete): Take differences.
• From CDF → PDF (continuous): Take the derivative.
5.1 4. Mathematical Expectation (Expected Value)
Measures the central tendency or long-run average.
• Discrete: X
E[X] = x · Pr(X = x)
x∈R(X)
• Continuous: Z ∞
E[X] = x · fX (x) dx
−∞
4
5.2 5. Moments of a Random Variable
• First Moment: Mean (µ)
– Central location of the distribution.
• Second Moment: Variance (σ 2 )
Var(X) = E[(X − µ)2 ] = E[X 2 ] − (E[X])2
– Measures dispersion.
• Third Moment: Skewness
E[(X − µ)3 ]
Skew(X) =
σ3
– Positive = right-skewed; Negative = left-skewed.
• Fourth Moment: Kurtosis
E[(X − µ)4 ]
Kurt(X) =
σ4
– 3 = leptokurtic (fat tails), =3 = mesokurtic (normal), ¡3 = platykurtic
(thin tails)
5.3 6. Quantiles and Modes
• Quantile: Inverse of the CDF.
– Median = 50th percentile
– Interquartile Range (IQR) = 75th - 25th percentile
• Mode: Value with the highest probability density or mass.
5.4 7. Linear Transformations
Let Y = aX + b
• E[Y ] = aE[X] + b
• Var(Y ) = a2 Var(X)
• Skewness and kurtosis are invariant to linear shifts.
5
Common Exam Traps
• Confusing PDF and PMF: PDFs are for continuous, PMFs for discrete.
• Assuming Pr(X = x) > 0 for continuous RVs—It’s always zero.
• Mixing CDF and PDF: CDF = integral of PDF; PDF = derivative of CDF.
• Forgetting units in variance: Variance is in squared units, std. deviation
restores scale.
• Using wrong transformation rule for variance (don’t forget the square on ’a’).
Mnemonics & Shortcuts
• ”M-V-S-K” for moments:
– Mean
– Variance
– Skewness
– Kurtosis
– (Order of importance and testing frequency too)
• ”CDF goes up, PDF shows bump”:
– CDF increases, PDF indicates peak
Top 5 Exam Takeaways
1. Distinguish clearly between discrete and continuous random variables, espe-
cially in terms of PMF vs. PDF.
2. Master expectation and variance formulas—these are used throughout risk
modeling and quant questions.
3. Understand moment definitions (mean, variance, skewness, kurtosis) and how
they describe distribution shape.
4. CDF and quantile functions are essential for VaR and percentile-based mea-
sures.
5. Linear transformations affect location and scale but not shape—key for in-
terpreting model outputs and standardization.
6
7