Random Variables
Random variables attach numbers to uncertain outcomes. Learn discrete and continuous random variables, PMF, PDF and CDF, expectation, variance and standard deviation, moments, linear transformations, and sums of independent variables.
The number of defects in a batch, the lifetime of a bearing, the noise voltage on a line and the load on a bridge are random variables. Their distributions summarise everything we know about their uncertainty.
An analogy
A random variable is like a weighted die: the distribution tells you how heavily each outcome is weighted.
Discrete vs continuous
Discrete: countable values with probabilities (PMF sums to 1). Continuous: probabilities are areas under a density (PDF integrates to 1); P(X = exact value) = 0.
Mean and spread
The mean is the long-run average; standard deviation measures typical deviation in the same units. Coefficient of variation σ/μ compares variability across scales.
Combining variables
Means always add. Variances add for independent variables — the basis of tolerance stack-up by RSS: σ_total = √(Σσᵢ²).
Moments and beyond
Skewness (third moment) and kurtosis (fourth) describe shape. Covariance and correlation describe dependence; the central limit theorem explains why sums tend to be normal.
Formulas
- Expectation:
E[X] = Σ x p(x) or ∫ x f(x) dx - Variance:
Var X = E[X²] − (E[X])² - Linear transform:
E[aX + b] = aE[X] + b; Var(aX + b) = a²Var X - Sums (independent):
E[X + Y] = E[X] + E[Y]; Var(X + Y) = Var X + Var Y - CDF ↔ PDF:
F(x) = ∫_{−∞}^x f(t) dt, f = F′
Worked example: Discrete mean and variance
Given: Defects per board: 0 (p 0.6), 1 (0.3), 2 (0.1)
Find: E[X], Var X.
- E = 0.3 + 0.2 = 0.5
- E[X²] = 0.3 + 0.4 = 0.7
- Var = 0.7 − 0.25 = 0.45, σ = 0.67
Answer: μ = 0.5, σ = 0.67
Worked example: Tolerance stack
Given: Three parts, each σ = 0.02 mm, independent
Find: σ of total length.
- Var = 3 × 0.0004 = 0.0012
- σ = 0.0346 mm
Answer: 0.035 mm (not 0.06 mm worst case)
Common mistakes
- Wrong: Adding standard deviations. — Right: Add variances (independent variables).
- Wrong: Reading a PDF value as a probability. — Right: Probability = area under the PDF.
Applications
- Tolerance analysis: RSS stack-up of dimensions.
- Noise analysis: Variance of random voltages.
- Reliability: Lifetime distributions.
Key takeaways
- PMF/PDF/CDF describe distributions.
- E[X], Var X = E[X²] − μ².
- Variances add for independent variables.
- Probability = area for continuous variables.
Going further
- Moment generating functions: Characterise distributions.
- Covariance matrices: Multivariate random vectors.
- Central limit theorem: Why sums become normal.