Expected value calculator
An expected value calculator finds the long-run average of a random variable: what you would get on average if you repeated the situation many times. E(X) = Σ x P(x), each outcome times its probability, added up. Type each outcome and its probability into our calculator and it gives E(X), the variance and the standard deviation, after checking the probabilities add up to 1.
Probabilities can be typed as decimals or fractions, such as 1/6, and the calculator shows a working table of x P(x) and x² P(x). It opens on a four-outcome example with E(X) = 1.7.
Expected Value Calculator
Find the expected value and variance of a random variable
How to use the expected value calculator
- In the table, type each outcome in the x column and its probability in P(X = x). Use one row per outcome; Enter adds a new row.
- Probabilities can be decimals, such as 0.25, or fractions, such as 1/4. You can also paste two columns from a spreadsheet.
- If the probabilities do not add up to 1, the calculator says what they add up to, so you can find the mistake.
- Read E(X), E(X²), Var(X) and the standard deviation, with the working table and steps underneath.
The chart plots the distribution with the mean and spread marked. Up to 50 outcomes fit in the table. For practice, Practice and help sets random E(X) and Var(X) questions with worked solutions.
The expected value formula
The variance measures how spread out the outcomes are around E(X), and the standard deviation is its square root:
The expected value does not have to be a possible outcome. The expected number of heads in one coin toss is 0.5, even though you can only get 0 or 1.
Worked examples you can check in the calculator
Example 1: goals in a match
A team's goals per match follow this distribution:
| Goals, x | 0 | 1 | 2 | 3 |
|---|---|---|---|---|
| P(X = x) | 0.15 | 0.35 | 0.3 | 0.2 |
| x P(x) | 0 | 0.35 | 0.6 | 0.6 |
| x² P(x) | 0 | 0.35 | 1.2 | 1.8 |
Adding the rows: E(X) = 1.55 goals and E(X²) = 3.35. So Var(X) = 3.35 − 1.55² = 0.9475 and the standard deviation is √0.9475 = 0.973. Type the four rows into the calculator to see the same table.
Example 2: is a game worth playing?
A game costs $2 to play. You roll a dice and win $10 if it shows a six. Take X as your profit: +$8 with probability 1/6, and −$2 with probability 5/6.
On average you lose about 33 cents a game, so it is not a fair game. Type 8 with 1/6 and −2 with 5/6: the calculator gives E(X) = −0.333 and a standard deviation of 3.73. A game is fair when its expected profit is 0.
Example 3: a raffle
500 raffle tickets are sold at $5 each. There is one prize of $1,000 and two of $250. For one ticket, the profit is $995 with probability 1/500, $245 with probability 2/500, and −$5 otherwise:
Each ticket loses $2 on average, which is the raffle's profit per ticket. The same method works for insurance and for betting: an expected value calculator for betting is just this table with the stake as a loss and each payout as a gain.
Now try one in the course, then press Mark to check it:
Calculate the expected value of a distribution and judge if a game is fair.
Press Mark to have your answer marked in the Probability course.
Finding a missing probability
Questions often give a table with one unknown, k. Because the probabilities must add up to 1, set their sum to 1 and solve. For P(X = x) = 0.2, 0.35, k and 0.15, k = 1 − 0.7 = 0.3. Then type the full table into the calculator. If you type the wrong k, it tells you what the probabilities add up to instead.
Expected value of a binomial or other named distribution
Some distributions have a shortcut. A binomial distribution B(n, p) has E(X) = np, and a Poisson distribution with rate λ has E(X) = λ. For example, the expected number of sixes in 30 rolls is 30 × 1/6 = 5. The Probability Calculator shows these for each distribution, and our probability calculator guide covers them. For the variance of a list of data rather than a distribution, see the variance calculator guide.
Common mistakes
- Probabilities that do not sum to 1. Check the total first. The calculator will not give an answer until it is 1.
- Forgetting to subtract the cost. For a game, use profit, not the prize. A $10 win on a $2 game is a profit of $8.
- Using Var(X) = E(X²) − E(X). The mean must be squared: E(X²) − [E(X)]².
- Squaring the probabilities. In E(X²), square the outcomes, not the probabilities.
- Expecting E(X) to be an outcome. It is an average, so it is often a value X can never take.
Practise in a short timed paper
Expected value and random variables come up in AP Statistics practice, and in A-level Maths: Statistics in the UK. Each daily paper is a short timed paper of 8 questions worth 25 to 35 marks, and the papers mix topics. The Probability course teaches expected value with a dice game before its practice question.
Common questions
How do you calculate expected value?
What does expected value mean?
Can expected value be negative?
How do you find the variance of a random variable?
What is a fair game?
Can I type fractions?
Revision cards
Say the answer first, then flip the card to check it.
Where to go next
- Solve it
Expected Value Calculator
Find the expected value and variance of a random variable
Open the tool - Learn it
Probability
Distributions, expected values and the maths behind uncertainty
Start the course - Test it
AP Statistics
A new exam-style paper every day, with instant marking and a mark scheme
Start today's paper