Discrete random variables
A random variable turns the outcomes of a chance process into numbers, so we can talk about averages and variability of random results.
Random variables
A random variable \(X\) assigns a number to each outcome of a random process: the number of heads in 3 flips, the sum of two dice, a customer's waiting time. Discrete random variables take separate values you can list; continuous ones take any value in an interval.
Probability distributions
A discrete random variable's distribution lists each possible value with its probability. The probabilities must be between 0 and 1 and add to 1. For the number of heads in 2 fair flips: \(P(0) = \frac{1}{4}\), \(P(1) = \frac{1}{2}\), \(P(2) = \frac{1}{4}\).
Expected value
The expected value (mean) of \(X\) is the probability-weighted average of its values: \(E(X) = \sum x\,P(x)\). For the two-flip example, \(E(X) = 0 \cdot \frac{1}{4} + 1 \cdot \frac{1}{2} + 2 \cdot \frac{1}{4} = 1\). It is the long-run average if the process is repeated many times, even if it is not itself a possible value.
E(X) = \mu = \sum x\,P(x)Worked example: is a game fair?
You pay \$2 to roll a die and win \$10 on a six, nothing otherwise. Your net gain is \(+8\) with probability \(\frac{1}{6}\) and \(-2\) with probability \(\frac{5}{6}\). \(E = \frac{8}{6} - \frac{10}{6} = -\frac{1}{3}\): on average you lose about 33 cents per game. Casinos and insurers set prices using exactly this calculation.
Variance and standard deviation
The variance of \(X\) is the expected squared distance from the mean: \(\sigma^2 = \sum (x - \mu)^2 P(x)\). The standard deviation \(\sigma\) is its square root. For the two-flip example, \(\sigma^2 = (1)\frac{1}{4} + 0 + (1)\frac{1}{4} = \frac{1}{2}\).
\sigma^2 = \sum (x-\mu)^2 P(x)Rules for means and variances
For constants \(a\) and \(b\): \(E(a + bX) = a + bE(X)\) and \(\text{Var}(a + bX) = b^2\text{Var}(X)\); adding a constant shifts the mean but not the spread. For any random variables, \(E(X + Y) = E(X) + E(Y)\). If \(X\) and \(Y\) are independent, \(\text{Var}(X + Y) = \text{Var}(X) + \text{Var}(Y)\); variances add even when you subtract variables.
Continuous random variables
A continuous random variable is described by a density curve: probabilities are areas under the curve, and the total area is 1. The probability of any single exact value is 0, so \(P(X \le 3) = P(X < 3)\). Means and variances are found with integrals instead of sums, linking statistics to calculus.
Common mistakes
Forgetting to check that probabilities sum to 1. Treating the expected value as the most likely value. Adding standard deviations instead of variances. Thinking variance decreases when you subtract independent variables.
Key takeaways
Random variables give numerical outcomes with a probability distribution. \(E(X) = \sum xP(x)\) is the long-run average. Variance measures spread around the mean. Means add; variances of independent variables add. Continuous variables use areas under density curves.
Flashcard
A numerical outcome of a random process
Check your understanding
X takes values 0, 1, 2 with probabilities 0.2, 0.5, 0.3. What is E(X)?
