Expected Value Calculator – E[X], Variance & Standard Deviation
Expected value — often written E[X] — is the probability-weighted average of every possible outcome of a discrete random variable. It answers a simple but powerful question: if this random process were repeated many times, what outcome should you expect on average? This calculator computesE[X], its variance, and its standard deviation for any discrete distribution you define, whether that's a dice roll, a lottery ticket, an insurance payout, or a business decision with uncertain returns.
The Formula
Expected value is calculated as E[X] = Σ xᵢ · P(xᵢ) — multiply each outcome xᵢ by its probability P(xᵢ), then sum the results. Variance measures how spread out the outcomes are around that average: Var(X) = Σ (xᵢ − E[X])² · P(xᵢ), and the standard deviation σ = √Var(X) expresses that spread in the same units as the outcomes themselves. The calculator shows every term of the summation in a step-by-step breakdown table so you can see exactly how each outcome contributes to the final result.
Three Ways to Enter Your Data
Not every problem hands you clean probabilities. This calculator supports three input modes: enter probabilities directly when you already know them (they must sum to 1); enter raw frequencies or counts from observed data and the calculator normalizes each by the total count to derive P(xᵢ) = countᵢ / Σ counts; or select equally likely (uniform) outcomes — such as the faces of a fair die — and every outcome automatically gets probability 1/n. Switching modes preserves your outcome values so you can compare approaches quickly.
Expected Monetary Value and Net Expected Value
In gambling and business decision analysis, the raw expected value often needs to be compared against the cost of participating. A raffle ticket that pays $500 with 1% probability has E[X] = $5.00 — but if the ticket costs $5, the net expected value (E[X] − cost) is exactly $0, meaning the game is mathematically fair before accounting for the thrill of playing. This same net-EV comparison, often called Expected Monetary Value (EMV) in business contexts, helps decision makers weigh uncertain outcomes — like launching a product or not — by their probability-weighted payoffs.
Computing E[g(X)] for Transformed Variables
Beyond the basic mean, this calculator can compute the expected value of a function ofX, written E[g(X)] = Σ g(xᵢ) · P(xᵢ), for expressions such as x^2, 2*x + 5, or abs(x). This is especially useful for verifying variance by hand: since Var(X) = E[X²] − (E[X])², computing E[X²]directly and comparing it against the calculator's variance output is a common way students check their work.
E[X] — but any single trial can land far from that average. A favorable expected value describes what happens on average over many repetitions, not what will happen the next time you play.Common Applications
Analysts use expected value to price insurance premiums against expected claim payouts, evaluate whether a lottery or casino game is favorable or unfavorable, compare investment scenarios weighted by bull, base, and bear-case probabilities, and teach foundational probability and statistics concepts in the classroom. Because the underlying math is identical across all these domains — multiply, weight, and sum — the same calculator handles a fair-die textbook problem and a real-world business decision equally well.
How This Calculator Works
Add each possible outcome and its likelihood, choose the input mode that matches your data, and the calculator instantly computes E[X], Var(X), and σ, validates that your probabilities sum to 1, and renders an interactive probability distribution chart with the expected value and a ±1 standard deviation band overlaid. Results can be copied to the clipboard or exported as a CSV file for further analysis.