Statistics 🔔 Random Variables & Distributions

Expectation and Variance

Two numbers — where a distribution sits and how far it spreads — and the balance-point picture that makes them click.

Intro StatisticsAP Statistics level
💡
The big idea: Every probability distribution can be summed up by two numbers. The expected value E[X] is its long-run average — the point where the distribution would balance on a fulcrum. The variance, and its square root the standard deviation, say how far outcomes typically stray from that balance point. Together they turn a whole distribution into "center" and "spread", the two ideas nearly all of statistics is built on.
🎯 By the end, you'll be able to
  • Compute the expected value E[X] of a discrete random variable as a probability-weighted average
  • Interpret E[X] as the long-run average and as the balance point of a distribution
  • Compute the variance Var(X) = E[(X−μ)²] and the standard deviation as measures of spread
  • Explain why adding a constant shifts the mean but leaves the variance unchanged
📎 You should already know
  • Mean and standard deviation of a data set
  • Basic probability and probability distributions

Two numbers that summarize a whole distribution

A probability distribution can list many possible outcomes, each with its own chance of happening. That is a lot to hold in your head. Luckily, two numbers capture most of what you usually care about:

  • Where the distribution sits — its center, the value you would land near on average. This is the expected value.
  • How spread out it is — whether outcomes cluster tightly around that center or scatter far from it. This is the variance (and its friendlier cousin, the standard deviation).

Get comfortable with these two and you can describe almost any distribution in a single breath: center and spread.

🔑 Expected value, in one sentence
The expected value \(E[X]\) is what you would get by averaging the outcome over a huge number of repetitions — every possible value pulled toward the average in proportion to how likely it is. It answers the question: where does this distribution sit?

How to compute it

You do not average the outcomes equally — you weight each one by its probability. Multiply every value \(x\) by its chance \(p(x)\), then add up all those pieces. Rare outcomes barely move the total; likely ones dominate it.

\[ E[X] \;=\; \mu \;=\; \sum_{x} x\,p(x) \]
Expected value: each outcome x weighted by its probability p(x), summed over every possible outcome. We call this number the mean, μ.

Spread: how far outcomes stray from the mean

Two distributions can share the exact same mean yet feel completely different — one packed tightly around \(\mu\), the other flung wide. Variance measures that difference. For each outcome, take its distance from the mean, \(x-\mu\), then square it (so misses on either side count as positive, and large misses are penalized heavily). Finally, average those squared distances, again weighting by probability.

\[ \operatorname{Var}(X) \;=\; E\big[(X-\mu)^2\big] \;=\; \sum_{x}(x-\mu)^2\,p(x) \]
Variance: the probability-weighted average of the squared distances from the mean. Bigger variance means a more spread-out distribution.
\[ \sigma \;=\; \sqrt{\operatorname{Var}(X)} \]
The standard deviation σ is the square root of the variance — a typical distance from the mean, back in the same units as X.

Watch the balance point and the spread

In the simulation below, adjust the probability of each outcome and watch two things move. The triangle beneath the axis is a fulcrum — it sits exactly at \(E[X]\), the point where the distribution would balance. The shaded band spans \(\mu \pm \sigma\), one standard deviation on each side. Shift weight toward the high outcomes and the fulcrum slides right; bunch the weight together and the band narrows.

🎮 Interactive: the mean as a balance point LIVE
Adjust the probability of each outcome. The triangle marks the expected value E[X] (the balance point), and the shaded band spans one standard deviation on each side, μ ± σ. Concentrating the probability shrinks the band; shifting it slides the fulcrum.
✨ The mean is a balance point
Picture the probabilities as weights placed along a number line at each outcome. The expected value \(\mu\) is the exact spot where the bar would balance on a fulcrum — add more probability to the right and \(\mu\) slides right. The standard deviation \(\sigma\) marks a typical distance from that balance point, so the band \(\mu \pm \sigma\) shows how wide the distribution really is. One neat consequence: if you shift every outcome by a constant \(b\), the fulcrum slides but the spread is untouched — \(\operatorname{Var}(X+b) = \operatorname{Var}(X)\). And if you scale by a factor \(a\), the mean scales with it: \(E[aX] = a\,E[X]\).
📝 Worked example: A spinner lands on 1, 2, or 3 with probabilities P(1) = 0.2, P(2) = 0.5, and P(3) = 0.3. Find the expected value, the variance, and the standard deviation of the outcome X.
  1. Expected value: weight each outcome by its probability and add. \(E[X] = 1(0.2) + 2(0.5) + 3(0.3) = 0.2 + 1.0 + 0.9 = 2.1\).
  2. So the long-run average spin is \(\mu = 2.1\) — notice it is not even one of the possible outcomes, and it need not be.
  3. Variance: find each squared distance from the mean. \((1-2.1)^2 = 1.21\), \((2-2.1)^2 = 0.01\), \((3-2.1)^2 = 0.81\).
  4. Weight those by probability and add: \(\operatorname{Var}(X) = 0.2(1.21) + 0.5(0.01) + 0.3(0.81) = 0.242 + 0.005 + 0.243 = 0.49\).
  5. Standard deviation: \(\sigma = \sqrt{0.49} = 0.7\).
✓ The distribution has mean μ = 2.1 and standard deviation σ = 0.7: on average a spin lands near 2.1, and typically within about 0.7 of that balance point.

Check your understanding

1. The expected value E[X] of a random variable is best understood as…
E[X] is the probability-weighted average — what the outcome averages out to over many repetitions. It is not necessarily the most likely or the middle value.
2. A fair four-sided die shows 1, 2, 3, or 4, each with probability 1/4. What is E[X]?
E[X] = (1 + 2 + 3 + 4)/4 = 10/4 = 2.5. With equal probabilities, the expected value is just the ordinary average of the outcomes.
3. A random variable takes the value 0 with probability 0.5 and the value 2 with probability 0.5. Its variance Var(X) equals…
First the mean: E[X] = 0(0.5) + 2(0.5) = 1. Then Var(X) = 0.5(0−1)² + 0.5(2−1)² = 0.5 + 0.5 = 1.
4. You add 5 to every possible outcome of X. The mean E[X] goes up by 5. What happens to the variance Var(X)?
Adding a constant shifts every outcome equally, so each value's distance from the (also shifted) mean is unchanged. Variance measures spread, and the spread did not change: Var(X + b) = Var(X).
✅ Key takeaways
  • The expected value E[X] = Σ x·p(x) is the probability-weighted average — the long-run average and the balance point of the distribution.
  • E[X] need not be a possible outcome; it is simply where the distribution balances.
  • Variance Var(X) = E[(X−μ)²] averages the squared distances from the mean; larger variance means more spread.
  • The standard deviation σ = √Var(X) reports that spread as a typical distance in the original units.
  • Shifting every value by a constant moves the mean by that constant but leaves the variance and standard deviation unchanged.