Interactive guide

Expected value is where the distribution balances.

Drag any bar's top edge. The rest rescale so the probabilities still sum to 1.

 P(X = x)    E[X] (balance point)    ±1 SD

Jump to a distribution

E[X] = Σ x·P(x) =
Var(X) = Σ (x−E[X])²·P(x) =

SD
ΣP(x)
1.00

Push the "Nearly certain" preset, then drag that one huge bar down just slightly and watch the spread bracket snap open wide, even though the probabilities barely changed. Variance doesn't ask "how far apart are the possible outcomes," it asks "how much probability sits away from the center," and those are very different questions.

A weighted average, not a plain one

E[X] isn't the average of the six numbers 1 through 6, that's always 3.5 no matter what. It's the average weighted by how likely each one is, drag all the probability onto 6 and E[X] slides all the way over to 6 with it, even though 3.5 is still sitting right there as the plain average of the labels.

Variance is the same idea, one layer up: it's the expected value of the squared distance from E[X]. Squaring does two things at once, it makes every deviation positive (so they can't cancel out), and it punishes big deviations much more than small ones.

Reading the chart

  1. 1

    The green triangle is E[X]

    Literally a balance point: it's where the bars would balance on a see-saw, weighted by height.

  2. 2

    A symmetric distribution centers E[X] exactly

    Fair die and Two Extremes both average to 3.5, drag either one off-balance and watch the triangle move immediately.

  3. 3

    The orange bracket is ±1 SD, not the full range

    It's a probability-weighted spread, not "lowest to highest possible value," a rare far outcome barely moves it if it's rare enough.

  4. 4

    Two Extremes vs. Fair die: same E[X], different Var

    Both center on 3.5; Two Extremes pushes nearly everything out to the edges instead, and its variance is dramatically larger.

This bracket is exactly the same ±1 SD idea from the Central Limit Theorem and Law of Large Numbers pages, just measured on the population itself instead of on a sampling distribution of averages. Every one of those pages' "σ" is this page's SD, computed the exact same way, on whatever distribution you've dragged into existence here.

The jargons

A weighted center, and how far things typically stray from it.

Expected value E[X]

The probability-weighted average of a random variable's possible values: Σ x·P(x).

Variance Var(X)

The expected squared distance from E[X]: Σ (x−E[X])²·P(x). Always in squared units.

Standard deviation SD

√Var(X), variance brought back into the original units, which is what makes it plottable right on the chart.

Probability mass function

The full list of (value, probability) pairs for a discrete random variable, exactly what each bar's height encodes.

Random variable X

A number whose value isn't fixed, it's determined by a random outcome, here just "which bar gets sampled."

Linearity of expectation

E[X] is a genuine weighted average, so it always lands somewhere between the smallest and largest possible value, never outside.

A teaching tool: dragging one bar redistributes the rest proportionally, preserving their relative shape, so the six probabilities always sum to exactly 1.