Expected Value Calculator

Calculate the expected value of a discrete random variable from its outcomes and probabilities. Get the variance, standard deviation, and a step-by-step breakdown. Supports weights and frequencies. Free and instant.

https://hexacalculator.com/calculators/mathematics/statistics/expected-value-calculator

Mathematics

Statistics

Expected Value Calculator

Calculate the expected value of a discrete random variable from its outcomes and probabilities. Get the variance, standard deviation, and a step-by-step breakdown. Supports weights and frequencies. Free and instant.

Expected Value Calculator

Your outcomes and probabilities

Pick Probabilities if your numbers already add up to 1. Pick Weights or frequencies to enter counts or any positive numbers; the calculator divides by their total for you.

Results

Variance

Charts and calculation steps

Show the charts

Plot the probability of each outcome and how much each one adds to the expected value.

Show the calculation table

List every outcome with its probability, its product, and its share of the variance.

Show extra measures

Add E(X squared), the smallest and largest outcome, the range, and the most likely outcome.

Loading calculator…

The expected value of a random variable is the weighted average. It represents the long-term average outcome that you would get if the same situation were repeated over and over again. It's a single number that summarizes the central position of the probability distribution.

In addition to the expected value this calculator also calculates variance and standard deviation which indicates how spread out the results are around the expected value based on a list of outcomes and their respective probabilities. Once you enter each outcome and its probability, all details of the calculation can be seen in the right hand area.

What is an expected value?

A random variable X can take values x1, x2 etc., with P(x) being the probability of each of these values. The expected value is denoted by E(X), and is also known as the mean of the distribution. It is calculated by multiplying each outcome by its probability, and then adding up all of these products.

E(X)=i=1nxiP(xi)=x1P(x1)+x2P(x2)++xnP(xn)E(X) = \sum_{i=1}^{n} x_i \, P(x_i) = x_1 P(x_1) + x_2 P(x_2) + \cdots + x_n P(x_n)

Since each probability weighs the corresponding outcome, more probable outcomes pull the average value toward them. When all outcomes are equally likely, the expected value is the simple average of those outcomes.

How do you calculate expected value?

The formula can be broken down into three simple steps: Multiply each outcome by its probability. Add up those products. The sum is the expected value.

Suppose the possible outcomes of a random variable are 0, 1, 2, and 3, and the corresponding probabilities are 0.1, 0.3, 0.4, and 0.2. These are the values that will be entered in this calculator.

E(X)=0(0.1)+1(0.3)+2(0.4)+3(0.2)=0+0.3+0.8+0.6=1.7E(X) = 0(0.1) + 1(0.3) + 2(0.4) + 3(0.2) = 0 + 0.3 + 0.8 + 0.6 = 1.7

So the expected value is 1.7. 1.7 isn't actually a possible outcome. The expected value is an average and will usually not be the actual outcome of any given trial.

The table below shows the calculation process for each result, corresponding to the content of the tool's calculation table.

Outcome (x)

Probability P(x)

Product x times P(x)

0

0.1

0.0

1

0.3

0.3

2

0.4

0.8

3

0.2

0.6

Total

1.0

1.7

Probability or weight:

In a true probability distribution the probabilities are between 0 and 1 and they must sum to exactly 1. If the sum of the probabilities is not 1 then either there is an error or it is actually weights or frequencies rather than probabilities.

If you switch the input mode to "weights" or "frequencies", you can enter any positive numbers, such as how often each outcome occurs. The calculator will divide these numbers by their sum and convert the formula into a weighted average, showing the correct expected value without having to calculate each fraction manually.

E(X)=i=1nxiwii=1nwiE(X) = \frac{\sum_{i=1}^{n} x_i \, w_i}{\sum_{i=1}^{n} w_i}

Variance and standard deviation

The expected value gives the average of a distribution but says nothing about risk or the degree of spread. Two variables can have the same expected value with one leading to a certain outcome and another being highly volatile. Variance and standard deviation are used to measure this degree of spread.

Variance is the weighted average of squared distances between each outcome and the expected value. A simple way to calculate it is by subtracting the square of the expected value from the mean of the squares of the outcomes.

Var(X)=i=1nP(xi)(xiE(X))2=E(X2)(E(X))2\operatorname{Var}(X) = \sum_{i=1}^{n} P(x_i)\,(x_i - E(X))^2 = E(X^2) - \big(E(X)\big)^2
σ=Var(X)\sigma = \sqrt{\operatorname{Var}(X)}

The standard deviation sigma is the square root of the variance and therefore has the same unit as the results, which makes it easier to interpret. In the example provided, the variance is 0.81 and the standard deviation is 0.9. A small standard deviation means that the results are concentrated around the expected value. A large standard deviation means that the results are spread over a larger range, which generally implies higher risk.

Can the expected value be negative?

Yes. The expected value doesn't have to be positive because the outcome itself can be negative. Let's say we ask people to rate something on a scale of -2 to 2. Five people give it a rating of -2, two people give it a rating of 1, and three people give it a rating of 0.

E(X)=510(2)+210(1)+310(0)=1+0.2+0=0.8E(X) = \tfrac{5}{10}(-2) + \tfrac{2}{10}(1) + \tfrac{3}{10}(0) = -1 + 0.2 + 0 = -0.8

The expected value is negative 0.8. A negative expected value clearly indicates that a particular game or decision will result in an average loss over the long run.

Use of expected value:

The expected value is a basis for decision making when dealing with uncertainty.

In gambling and games of chance, the expected value determines whether or not a bet is favorable. A positive expected value means an average gain while a negative expected value represents the advantage of the house. In investments it is used to compare the expected returns of different options. In insurance, appropriate premiums are set taking into account possible payouts and their probabilities. Generally when choosing between uncertain options, it is common to compare expected values in combination with standard deviation as a measure for risk.

The term "expected value" is also used in connection with the chi-square test. In this case, the expected cell frequency is the product of the row sum and the column sum divided by the grand total. This is a different calculation than the weighted average by probability used here, so this tool cannot be used to calculate the expected frequencies for the chi-square test.

Used symbols:

The table below shows the symbols used in the formulas above.

Symbol

Meaning

Example

x sub i

One possible outcome

3

P(x sub i)

Probability of that outcome

0.2

E(X)

Expected value, the mean of the distribution

1.7

Var(X)

Variance, the spread around E(X)

0.81

sigma

Standard deviation, the variance's square root

0.9

n

How many outcomes there are

4

This calculator is for general educational and analytical purposes only. The expected value represents the long-term average of a probabilistic process and does not represent the outcome of any single series of trials. Therefore, use it as one of several bases for decisions but do not consider it to be a guarantee.

Frequently asked questions

What is an expected value?

An expected value is the weighted average of all possible outcomes of a random variable, where each outcome is multiplied by its probability. It's also known as the mean of the distribution since it represents the long-term average value that can be expected from repeated trials of the same experiment.

How do you calculate an expected value?

Multiply each outcome by its probability and add all the products together. If the outcomes are 0, 1, 2, 3 and the probabilities are 0.1, 0.3, 0.4, 0.2 then the expected value is 0(0.1) + 1(0.3) + 2(0.4) + 3(0.2) = 1.7. If the numbers are not probabilities but weights or frequencies, please change the input mode. The calculator will automatically divide by the sum.

Can the expected value be negative?

Yes. The expected value is negative when the probability of a negative outcome is so high that it outweighs the impact of positive outcomes. For example, if the payoffs are -2, 1 and 0, and the corresponding probabilities are 0.5, 0.2, 0.3, then the expected value is -0.8. A negative expected value means that a particular bet or decision will result in an average loss over the long term.

Does the sum of probabilities have to be 1?

For a valid probability distribution yes. Each probability is between 0 and 1, and the sum is 1. If the sum of probabilities is not 1 then either there's an input error or the numbers are weights or frequencies. In the weighting mode the calculator automatically divides by the sum so you get the correct weighted average from any combination of positive numbers.

Are expected value and mean the same thing?

The expected value is a weighted average that takes into account the probability of each possible outcome. Not all values are treated equally. If every outcome has an equal chance of occurring, then the expected value will be the same as the regular arithmetic mean. This is different from a single observed result. The expected value is the result that the average tends towards if an experiment is repeated many times. This is known as the law of large numbers.

Related calculators

Disclaimer: This calculator is provided for general informational and educational purposes only. Our calculators are under active development, and results may be inaccurate, incomplete, or unsuitable for your situation. Always verify the figures independently and seek advice from a qualified professional before relying on them. We make no warranties and accept no liability for any loss or decision arising from use of this tool.

References

  1. Wikipedia: Expected value

    Definition, formula, and properties of the expected value of a random variable.

  2. Wikipedia: Variance

    How variance and standard deviation measure spread around the expected value.

  3. Khan Academy: Expected value

    Worked examples of the mean of a discrete random variable.