Expectation and variance: the balance point and the spread
Expectation is the long-run average and a linear operator; variance measures spread — and Chebyshev turns that spread into a bound.
The full distribution of a random variable is often more than you need. Two numbers — where the mass sits on average, and how far it spreads — carry most of the useful information. Draw samples, average them, and you approach the first; look at the typical squared distance from it and you measure the second.
Expectation is a weighted average and a seesaw
For a discrete variable, : each value weighted by how likely it is. It is the balance point of the distribution. Change the weights and the balance point slides — that is the whole of the widget below.
Reweight the six payoffs and watch the exact mean and variance recompute while a stream of actual samples settles onto the mean.
Reweight the outcomes — expectation is the balance point
sample mean: 5.333
- E[X]
- 5.333
- Var(X)
- 16.889
- σ
- 4.110
The dashed line is E[X] = Σ x·P(X = x), and the jagged line is the mean of the samples so far. Each run is a different random walk, but they all drift toward the same balance point — the law of large numbers. Variance is the average squared distance from that point; pushing the weights to the extremes is the cheapest way to feel what “spread” means.
Expectation
For a discrete variable, ; for a continuous one, . The single most useful property is linearity, which holds with no independence assumption whatsoever:
For a function of , — you do not need the distribution of , only the distribution of . This is the law of the unconscious statistician, and it is what makes computing moments mechanical.
Note carefully that in general . Equality holds when and are independent, and the gap between the two sides is the covariance.
Variance and standard deviation
Variance measures the average squared distance from the mean:
The second form is the one you compute with: square the mean and subtract it from the mean of the square. Standard deviation is , which restores the original units. Variance is quadratic in scale:
so shifting a distribution does not change its spread and scaling by multiplies the variance by . For sums of independent variables variances add: . Without independence the covariance term appears.
The inequalities
Two bounds let you reason about tails knowing only the mean and variance:
- Markov. For a non-negative and , .
- Chebyshev. For any with finite variance and ,
Chebyshev is loose — a normal variable is far more concentrated than — but it requires only that the variance exists. That is enough to prove the law of large numbers: the sample mean's variance shrinks like , so it concentrates on the true mean as grows. The jagged line in the widget is exactly this convergence in action.
Expectation need not exist
The expectation is an integral, and integrals can diverge. A Cauchy distribution has no mean at all, and heavy-tailed losses can have infinite variance. "The expected value is infinite" is a real statement, not a rounding error; when it happens, simulation averages wander without settling. Always check the tail before trusting a mean.
Illustrative vs real
The widget samples a six-point payoff with weights you can dial, which makes the law of large numbers visible in a second. Real estimators may have infinite variance, correlated samples, or heavy tails, and then the sample mean converges far more slowly — or not at all. The convergence seen here is a property of this finite-variance toy, not a universal guarantee.
Check yourself
Eduspheria wiki · Mathematics for AI, Probability
0 / 5 answered
From the mid-term paper
Modeled on NITJ AI-501, Mid-Term October 2024
0 / 5 answered
Where next: Bayes' rule — updating a probability when new evidence arrives.