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.
x1 = 10p1 = 0.2x2 = 20p2 = 0.5x3 = 50p3 = 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
Ready to run the numbers?
Open Expected Value Calculator