Expected Value Calculator Formula
Understand the math behind the expected value calculator. Each variable explained with a worked example.
Formulas Used
Expected Value E(X)
expected_value = evVariance
variance_val = ev2 - pow(ev, 2)Standard Deviation
std_dev = sqrt(abs(ev2 - pow(ev, 2)))Sum of Probabilities
prob_sum = p1 + p2 + p3Variables
| Variable | Description | Default |
|---|---|---|
x1 | Outcome 1 | 10 |
p1 | Probability 1 | 0.2 |
x2 | Outcome 2 | 20 |
p2 | Probability 2 | 0.5 |
x3 | Outcome 3 | 50 |
p3 | Probability 3 | 0.3 |
ev | Derived value= x1 * p1 + x2 * p2 + x3 * p3 | calculated |
ev2 | Derived value= pow(x1, 2) * p1 + pow(x2, 2) * p2 + pow(x3, 2) * p3 | calculated |
How It Works
How to Calculate Expected Value
Formula
E(X) = Sum of (xi * pi)
The expected value is the long-run average outcome of a random variable. Multiply each possible outcome by its probability and sum the products. It represents the "center of gravity" of the probability distribution. The variance is E(X^2) - [E(X)]^2.
Worked Example
A game pays $10 with probability 0.2, $20 with probability 0.5, and $50 with probability 0.3.
- 01E(X) = 10*0.2 + 20*0.5 + 50*0.3
- 02= 2 + 10 + 15 = 27
- 03E(X^2) = 100*0.2 + 400*0.5 + 2500*0.3 = 20 + 200 + 750 = 970
- 04Var(X) = 970 - 27^2 = 970 - 729 = 241
- 05SD = sqrt(241) ≈ 15.5242
Frequently Asked Questions
Does the expected value have to be a possible outcome?
No. The expected value is a weighted average and often falls between outcomes. For example, the expected value of a fair die roll is 3.5, which is not a possible outcome.
What if probabilities do not sum to 1?
For a valid probability distribution, probabilities must sum to exactly 1. If they do not, either the distribution is incomplete or there is an error in the inputs.
How is expected value used in decision making?
Expected value helps compare options by their long-run average payoff. In finance, it estimates average returns. In gambling, a positive expected value means a profitable bet on average.
Ready to run the numbers?
Open Expected Value Calculator