How to use the expected value calculator
Compute expected value and variance of a discrete variable. Enter outcomes, probabilities in the fields above; the expected value, variance, standard deviation are computed instantly and plotted on the chart so you can see how the answer changes.
Formula
Variables
- x β Outcomes
- p β Probabilities
Worked example
With outcomes = 0,1,2,3, probabilities = 0.1,0.3,0.4,0.2, the calculator gives expected value β 1.7; variance β 0.81; standard deviation β 0.9.
Frequently asked questions
What is the formula for the expected value calculation?
Expected value = sum(x.map(function(v,i){return v Γ p[i]})). Variance = sum(x.map(function(v,i){return p[i] Γ (v-[Expected value])^2})). Standard deviation = β([Variance]). Here x is outcomes, p is probabilities.
What inputs do I need for the expected value calculator?
You need outcomes, probabilities. Each field is pre-filled with a typical example so you can see how the result responds as you edit the numbers.
How do I use this calculator?
Type values into the input fields. Results and the chart update instantly. Use Reset to restore the example values, Copy results to paste them elsewhere, or Share to copy a link that preserves your inputs.
Is the result exact?
Calculations use standard formulas and double-precision arithmetic, then display about seven significant figures. Real-world measurements carry uncertainty, so treat results as estimates unless your inputs are exact.