Expected Value Calculator

Expected Value Calculator

Emerging AI Skill PRO

Enter Calculation

Formula

E(X)=∑i=1nxi·piE(X) = \sum_{i=1}^{n} {x_i} \cdot {p_i}
Usage stats

Advertisement

Results

Expected Value E(X)
17
weighted mean of outcomes
Number of terms 3
Sum of probabilities 1

Report an error on this page

What Is Expected Value?

The expected value (also called the mean or expectation) of a discrete random variable is the long-run average outcome you would expect if an experiment were repeated many times. It is found by multiplying each possible outcome by its probability and adding the products together. This calculator implements the formula \(E(X) = \sum_{i=1}^{n} x_i \cdot p_i\) for any list of outcomes and matching probabilities.

Discrete probability distribution bar chart with the mean marked as a balance point
Expected value is the probability-weighted balance point of all possible outcomes.

How to Use the Calculator

Enter your outcome values as a comma-separated list (for example 10, 20, 30) and the corresponding probabilities in the same order (for example 0.5, 0.3, 0.2). Each value is paired with the probability in the same position. The calculator returns the expected value, the number of terms used, and the sum of the probabilities so you can verify the distribution is valid (it should total 1).

The Formula Explained

$$E(X) = \sum_{i=1}^{n} x_i \cdot p_i$$ means: take each outcome \(x_i\), multiply it by its probability \(p_i\), then sum across all outcomes. Outcomes that are both large and likely contribute most to the expected value. If probabilities do not sum to 1, the result is technically a weighted sum rather than a true expectation — check the "Sum of probabilities" row.

Advertisement
Diagram showing each outcome value multiplied by its probability and summed
Each outcome value is multiplied by its probability, then all products are added together.

Worked Example

Suppose a game pays $0, $5, or $20 with probabilities 0.5, 0.3, and 0.2. Then $$E(X) = (0\times0.5) + (5\times0.3) + (20\times0.2) = 0 + 1.5 + 4 = 5.5.$$ The expected payout is $5.50 per play.

More Expected Value Examples

Both examples use \(E(X)=\sum_{i=1}^{n} x_i\,p_i\). Multiply each outcome by its probability, then add the products.

Example 1: A fair six-sided die

The outcomes are 1 to 6, and each has probability \(p_i = \tfrac{1}{6}\).

Outcome \(x_i\) Probability \(p_i\) Product \(x_i\cdot p_i\)
1 1/6 1/6
2 1/6 2/6
3 1/6 3/6
4 1/6 4/6
5 1/6 5/6
6 1/6 6/6
Sum 6/6 = 1 21/6 = 3.5

Check: the probabilities add up to \(6\cdot\tfrac{1}{6}=1\). Then:

$$E(X)=\frac{1+2+3+4+5+6}{6}=\frac{21}{6}=3.5$$

Example 2: A bet with a negative payoff

You win $100 with probability 0.02 and lose $5 with probability 0.98. Enter the loss as a negative outcome, \(-5\).

Outcome \(x_i\) Probability \(p_i\) Product \(x_i\cdot p_i\)
+$100 0.02 100 × 0.02 = 2.00
−$5 0.98 −5 × 0.98 = −4.90
Sum 0.02 + 0.98 = 1 2.00 − 4.90 = −2.90

Check: \(0.02+0.98=1\), so this is a complete distribution. Then:

$$E(X)=100(0.02)+(-5)(0.98)=2-4.90=-2.90$$

The expected value is -2.90 dollars per play. On average, this bet loses $2.90 each time it is played.

Advertisement

Key Terms and Symbols

Random variable
A variable whose value is a numerical result of a random process, such as the number shown on a die.
Discrete random variable
A random variable that takes a finite or countable set of separate values, such as 1, 2, 3, …
Outcome (\(x_i\))
One possible value of the random variable. Outcomes can be negative, for example a loss.
Probability (\(p_i\))
The chance that outcome \(x_i\) occurs. Each probability must satisfy \(0\le p_i\le 1\).
Probability distribution
The full list of outcomes with their probabilities. The probabilities must satisfy \(\sum p_i = 1\).
Expected value / mean / expectation (\(E(X)\) or \(\mu\))
The probability-weighted average of all outcomes, \(E(X)=\sum x_i p_i\).
Weighted sum
A sum in which each value is multiplied by a weight before adding. Here the weights are the probabilities.
Fair game
A game whose expected net gain is zero, so \(E(X)=0\).

FAQ

Do probabilities have to add to 1? For a valid probability distribution, yes. The calculator still computes the weighted sum if they don't, and shows the total so you can adjust.

Can outcomes be negative? Yes — losses or negative payoffs are entered as negative numbers, which is common in gambling and finance examples.

What if I enter different counts of values and probabilities? The calculator pairs items by position and uses only as many pairs as the shorter list provides.

Last updated:

Most popular in Math and Statistics

View all Math and Statistics calculators