← Back to course

Random Variables: Mean & Variance

You’ll be able to

Random variables and expected value

A random variable X assigns a number to each outcome of a chance process; a discrete random variable has a countable list of possible values, each with a probability. The expected value (mean) μ_X is the long-run average value of X — a probability-weighted average of its possible values. It need not be a value X can actually take: an expected number of 1.7 children is a perfectly good average.

Variance and standard deviation

The variance σ²_X measures how much X varies around its mean — a probability-weighted average of the squared deviations (x − μ_X)². The standard deviation σ_X is its square root, back in the original units. A larger σ_X means outcomes are more spread out and thus less predictable.

Mean and variance of a discrete random variable
μ_X = Σ x_i · P(x_i) · σ²_X = Σ (x_i − μ_X)² · P(x_i) · σ_X = sqrt(σ²_X)
Multiply each value by its probability and sum to get the mean; for variance, use the squared deviations weighted by probability. Standard deviation is the square root.
Combining random variables
μ_(X±Y) = μ_X ± μ_Y · for INDEPENDENT X, Y: σ²_(X±Y) = σ²_X + σ²_Y
Means add or subtract directly. Variances always ADD (never subtract) when combining independent variables — you add the variances even for X − Y, then square-root for the standard deviation.
Worked example

A carnival game charges $2 to play. You win $5 with probability 0.3 and $0 with probability 0.7. Let X be your net gain. Find the expected net gain per play.

  1. 1.Determine the net outcomes: win → 5 − 2 = +$3 (prob 0.3); lose → 0 − 2 = −$2 (prob 0.7).
  2. 2.Apply μ_X = Σ x·P(x): μ_X = (3)(0.3) + (−2)(0.7).
  3. 3.Compute: 0.9 + (−1.4) = −0.5.
Answer: The expected net gain is (3)(0.3) + (−2)(0.7) = −$0.50 per play. On average a player loses 50 cents each time, which is how the carnival profits.
Checkpoint

A random variable X takes value 0 with probability 0.5, value 10 with probability 0.4, and value 20 with probability 0.1. What is E(X)?

On the exam

When combining independent random variables, variances add even when you subtract the variables. To find the standard deviation of a difference X − Y, compute σ²_X + σ²_Y first, then take the square root. Never subtract standard deviations, and never add standard deviations directly.

Checkpoint

Independent variables X and Y have standard deviations σ_X = 3 and σ_Y = 4. What is the standard deviation of X + Y?

Answer the 2 checkpoints as you read.

Sign in to save your progress