The expected value calculator computes E[X] — the probability-weighted average of a random variable — for the four most common scenarios: custom discrete distributions, binary Bernoulli events, continuous uniform intervals, and normal distributions. It always shows variance, standard deviation, and the full step-by-step working so you can verify every figure.
How it works
Expected value is the central concept of probability theory. For any random variable X, E[X] answers the question: “If I repeated this experiment an infinite number of times, what would the average outcome converge to?” It is used everywhere from insurance pricing and investment analysis to game design and clinical trial planning.
Discrete distributions
The canonical formula is:
E[X] = Σ xᵢ · P(xᵢ)
You list every possible outcome xᵢ and its probability P(xᵢ). Each term xᵢ · P(xᵢ) is the
contribution of that outcome to the overall average. Sum them all and you have the expected value.
The probabilities must sum to exactly 1 — the calculator shows a live running total so you can
spot any discrepancy immediately.
Alongside E[X] the calculator computes variance:
Var(X) = Σ P(xᵢ) · (xᵢ − E[X])²
and standard deviation σ = √Var(X), which measures how widely outcomes are spread around the expected value. Two bets can share the same EV but have very different standard deviations — meaning one is far riskier than the other.
Bernoulli and binary events
Many real-world decisions boil down to a binary outcome — win or lose, pass or fail, convert or
churn. The Bernoulli mode accepts a success probability p, a win payoff, and a lose payoff. The
formula reduces to:
E[X] = p · win + (1 − p) · lose
For n independent trials the total expected value is simply n · E[X], and the expected number
of successes is n · p with standard deviation √(n · p · (1 − p)).
Continuous uniform distribution
When every value in a range is equally likely — for example estimating a delivery time anywhere
between 30 and 90 minutes — the distribution is uniform on [a, b]. The closed-form result is:
E[X] = (a + b) / 2 (the midpoint)
Var(X) = (b − a)² / 12
σ = (b − a) / √12
Normal distribution
For a normal (Gaussian) distribution the expected value equals the mean by definition:
E[X] = μ
The calculator also outputs the 68% confidence interval (μ ± σ) and the 95% confidence interval (μ ± 1.96σ) directly from the 68-95-99.7 rule, which tells you where the vast majority of outcomes will fall.
Worked example — should you take the bet?
Suppose a game costs £20 to play and has three outcomes:
| Outcome | Value | Probability | Contribution |
|---|---|---|---|
| Jackpot | £1,000 | 0.05 | £50 |
| Small prize | £50 | 0.15 | £7.50 |
| Nothing (lose stake) | −£20 | 0.80 | −£16 |
E[X] = 50 + 7.50 − 16 = +£41.50
The expected value is positive, so over many plays you would profit on average. However, σ ≈ £166 — the standard deviation is large relative to the stake, meaning individual outcomes are highly volatile. A positive EV alone does not make a gamble a good choice; risk tolerance and bankroll size both matter (see the Kelly criterion for bankroll-optimal bet sizing).
Formula note
All four modes use exact closed-form arithmetic — no simulation or Monte Carlo approximation. The discrete and Bernoulli calculations are O(n) in the number of outcomes; the uniform and normal results are computed in constant time from their distributional formulas. Everything runs in your browser with no server calls, so your inputs remain private.