Random
The value can change from one observation to the next.
- Your next exam grade
- Commute time tomorrow
- Number of Wi-Fi failures in class
- Whether it rains, coded 0 or 1
Chapter 2 study guide
This chapter is about describing uncertainty with numbers. The ideas build in a straight line: define possible outcomes, give them probabilities, summarize what is typical, then measure how two uncertain things move together.
A random variable turns an uncertain outcome into a number so we can calculate with it.
The starting point
A random variable is a number whose value depends on chance. “Random” means we do not know the result yet—not that the result is chaotic.
The value can change from one observation to the next.
The value is already fixed by the situation.
Special case
A binary variable has only two possible values, usually 0 and 1. A single 0-or-1 trial is called a Bernoulli random variable.
Next person is male
P(X = 0) = 0.45
Next person is female
P(X = 1) = 0.55
Key idea: binary variables are discrete, not continuous.
Organizing uncertainty
A probability distribution lists every possible value and how likely it is. All probabilities must add to 1.
Worked example
| Applicants, x | 0 | 1 | 2 | 3 | 4 |
|---|---|---|---|---|---|
| P(X = x) | 0.45 | 0.30 | 0.15 | 0.08 | 0.02 |
| F(x) = P(X ≤ x) | 0.45 | 0.75 | 0.90 | 0.98 | 1.00 |
The cumulative distribution function keeps a running total. At x = 2, it asks: “What is the chance of 0, 1, or 2 applicants?”
F(2) = 0.45 + 0.30 + 0.15 = 0.90Continuous variables
For a continuous variable, the height of the curve is a density. Probability is the area under the curve over the range you care about.
Summarizing a distribution
Four words do most of the work: expected value, variance, standard deviation, and skewness.
The probability-weighted average—the long-run “center.”
E(X) = Σ x · P(X=x)Average squared distance from the mean. It measures spread.
Var(X) = Σ p(x − μ)²The square root of variance. It is easier to interpret because it uses the original units.
SD(X) = √Var(X)Measures asymmetry: which side has the longer tail.
Kurtosis describes tail thickness—not symmetry.
Worked example
| Economy | Probability | Stock A | Stock B |
|---|---|---|---|
| Boom | 0.50 | 0.25 | 0.10 |
| Normal | 0.30 | 0.20 | 0.30 |
| Recession | 0.20 | 0.06 | 0.50 |
Expected return 0.197
Variance 0.005161
Standard deviation 0.0718
Expected return 0.24
Variance 0.0244
Standard deviation 0.1562
More total riskWhy? B’s returns are spread farther from its average. Its standard deviation is more than twice A’s.
Moving together
Covariance tells you whether two variables tend to move in the same direction or opposite directions.
Usually move together
No linear co-movement
Usually move opposite ways
Covariance changes when units change. Its sign is useful; its raw magnitude is not easy to compare.
A standardized relationship
Correlation rescales covariance to a clean range from −1 to +1. Because it has no units, both sign and size are meaningful.
Full worked example
| State | p | Return X | Return Y |
|---|---|---|---|
| Boom | 0.10 | 0.30 | 0.04 |
| Normal | 0.40 | 0.35 | 0.10 |
| Recession | 0.50 | 0.05 | 0.60 |
Find the means
E(X) = 0.195
E(Y) = 0.344
Find the variances
Var(X) = 0.021225
Var(Y) = 0.065824
Multiply paired deviations
Σp(x−μx)(y−μy)
Read the result
Cov(X,Y) = −0.03688
ρ = −0.99
Interpretation: when X is above its average, Y is usually below its average, and vice versa. The relationship is very strong.
The bell curve
A normal distribution is described by its mean μ (the center) and variance σ² (the spread squared). Standardizing turns any normal value into a z-score.
In this course, the second number is the variance. For Y ~ N(6, 9), the mean is 6 and the standard deviation is √9 = 3.
The Φ function
Three normal-probability examples
P(Y ≤ 4)
z = (4 − 6) / 3 = −0.6670.2525P(Y > −3)
z = (−3 + 4) / 3 = 0.3330.3694P(−5 ≤ Y ≤ −1)
z: −0.5 to 1.50.6247Before the exam
Use this as your final pass.
Most mistakes come from choosing the wrong side of the curve—not from the arithmetic.