Home › Statistics & Probability › Expected Value Calculator
Expected Value Calculator
Computes the expected value E[X] = Σ x·p(x), the variance and the standard deviation of a discrete random variable from its list of outcomes and their probabilities.
When to use
You have a set of possible outcomes (payoffs, scores, counts) with known probabilities and need the long-run average and its spread: bets, lotteries, insurance, decision analysis.
Do not use when: The probabilities are unknown and you have observed data instead (use descriptive-statistics), or the weights are not probabilities (use weighted-average).
Formula
E[X] = Σ values_i × probabilities_i; variance = Σ probabilities_i × (values_i − E[X])²; std_dev = √variance
Probabilities are checked to sum to 1 within 0.001 (to tolerate rounded inputs such as 0.1667) and rescaled to sum exactly to 1 before computing; a note is added when rescaling changed them by more than 10⁻⁶.
Inputs
| Parameter | Type | Unit | Required | Description |
|---|---|---|---|---|
values | number_list | yes | Numeric value of each possible outcome (negative for losses). | |
probabilities | number_list | yes | Probability of each outcome as a fraction between 0 and 1, in the same order as values; they must sum to 1 (within 0.001). |
Outputs
| Output | Type | Unit | Description |
|---|---|---|---|
expected_value | number | Σ values × probabilities: the long-run average outcome. | |
variance | number | Σ probabilities × (values − E[X])². | |
std_dev | number | √variance. | |
count | integer | Number of outcome/probability pairs. |
Example
Payouts 0, 10, 100 with probabilities 0.7, 0.25, 0.05: {"values":[0,10,100],"probabilities":[0.7,0.25,0.05]} → {"expected_value":7.5,"variance":468.75,"std_dev":21.6506,"count":3}
Fair six-sided die: {"values":[1,2,3,4,5,6],"probabilities":[0.1666667,0.1666667,0.1666667,0.1666667,0.1666667,0.1666667]} → {"expected_value":3.5,"variance":2.9167,"std_dev":1.7078}
GET https://tttkmbb.com/api/v1/calculate/expected-value?values=0%2C10%2C100&probabilities=0.7%2C0.25%2C0.05
Machine access
- API:
GET https://tttkmbb.com/api/v1/calculate/expected-value(query parameters) orPOSTwith a JSON body{"inputs": {...}} - Schema: https://tttkmbb.com/api/v1/calculators/expected-value · Markdown: https://tttkmbb.com/statistics/expected-value.md · JSON definition: https://tttkmbb.com/statistics/expected-value.json
- MCP: server
https://tttkmbb.com/mcp, toolrun_calculator with calculator_id="expected-value" - OpenAPI operationId:
calculate_expected_value - Freshness:
static. Authentication: none. Rate limit: fair use (see rate limits).
Sources
FAQ
What does a negative expected value mean?
On average you lose that amount per play; for a lottery ticket or casino bet the expected value is negative because the house keeps a margin. It says nothing about any single outcome.
Can I enter percentages?
No, probabilities are fractions: 0.25 for 25 %. Values can be any numbers, including negative amounts for losses.
Related calculators
- Probability of Two Events Calculator — Combine probabilities of events before computing payoffs.
- Weighted Average Calculator — Weighted mean when the weights are not probabilities.
- Descriptive Statistics Calculator — Mean and variance of observed data instead of a known distribution.