Loading…

Discrete Expected Value and Valence Tool

Math Probability • Discrete Probability Distributions

View all topics

Discrete Expected Value & Variance Calculator – E[X], Var(X) (Free)

Compute mean and variance for a discrete random variable from its PMF table: \[ \mathbb E[X]=\sum_x x\,P(x),\quad \mathbb E[X^2]=\sum_x x^2 P(x),\quad \mathrm{Var}(X)=\mathbb E[X^2]-\big(\mathbb E[X]\big)^2. \]

Tip: Press Play to sweep through the PMF and watch contributions accumulate to \(E[X]\) and \(E[X^2]\).

PMF table input
Expressions allowed in numbers: 1e-3, pi, e, sqrt(2), sin(), cos(), tan(), ln(), log(), abs(). Use * for multiplication.
Output & visualization
Drag on the chart to pan. Use mouse wheel / trackpad to zoom. Canvas labels are plain text (no LaTeX inside the chart).
Ready
Interactive PMF view — bars + mean line + Play (pan/zoom)

Bars show \(P(X=x)\). Vertical line marks \(\mathbb E[X]\). Play sweeps left-to-right accumulating \(E[X]\) and \(E[X^2]\).

Rate this calculator

0.0 /5 (0 ratings)
Be the first to rate.
Your rating
You can update your rating any time.

Frequently Asked Questions

What does E[X] represent?

E[X] is the expected value (mean), a probability-weighted average of the possible outcomes of X.

Why is Var(X)=E[X^2]-(E[X])^2 useful?

It is a convenient computational identity that avoids explicitly summing (x-mean)^2 p(x) and is numerically efficient for tables.

What if my probabilities don’t sum to 1?

You can treat it as a warning (compute using the given numbers) or auto-normalize by scaling each probability by the total sum so the PMF becomes valid.

Can the mean be a value not listed in the PMF?

Yes. The mean is a weighted average and can fall between outcomes, especially when there are multiple values.