Expected value calculator: mean and SD of X

By Jude Wallis · Published

The expected value (mean) of a discrete random variable is $\mu_X = \sum x_i P(x_i)$, each outcome times its probability. The standard deviation is $\sigma_X = \sqrt{\sum (x_i - \mu_X)^2 P(x_i)}$. Enter outcomes and probabilities that add to 1, and the tool returns both.

expected value (mean of X)

1

Standard deviation: 1. Over many repetitions, X averages about 1 per trial.

Steps

  1. 1.multiply each outcome by its probability: (0)(0.4) + (1)(0.3) + (2)(0.2) + (3)(0.1)
  2. 2.mean = 0 + 0.3 + 0.4 + 0.3 = 1
  3. 3.squared deviations times probability: (0 - 1)^2(0.4) + (1 - 1)^2(0.3) + (2 - 1)^2(0.2) + (3 - 1)^2(0.1)
  4. 4.variance = 1
  5. 5.standard deviation = sqrt(1) = 1

AP Statistics: Unit 2 (topics 2.9 Parameters of Random Variables). This calculator covers Unit 2 topic 2.9, calculating and interpreting the mean and standard deviation of a discrete random variable. The mean is the expected value, the long-run average outcome, and the standard deviation is the typical distance of outcomes from that mean. Both are parameters of the distribution, not statistics from a sample.

What the expected value tells you

The expected value of a random variable, written μX\mu_X or E(X)E(X), is the mean of its probability distribution. You find it by multiplying each possible outcome xix_i by its probability P(xi)P(x_i) and adding the products:

μX=xiP(xi)\mu_X = \sum x_i \cdot P(x_i)

Here xix_i is a value the variable can take and P(xi)P(x_i) is the chance of that value. The result is the long-run average outcome: if you repeated the situation many times, the outcomes would average out to about μX\mu_X per trial.

How the standard deviation is built

The standard deviation σX\sigma_X measures how far the outcomes typically fall from the mean. First find the variance by taking each deviation from the mean (xiμX)(x_i - \mu_X), squaring it, weighting it by that outcome's probability, and adding:

σX2=(xiμX)2P(xi)\sigma_X^2 = \sum (x_i - \mu_X)^2 \cdot P(x_i)

The standard deviation is the square root of that variance:

σX=(xiμX)2P(xi)\sigma_X = \sqrt{\sum (x_i - \mu_X)^2 \cdot P(x_i)}

Because the variance is in squared units, taking the square root brings it back to the same units as XX, which is why AP reports the standard deviation. The variance itself is also written V(X)V(X) or σX2\sigma_X^2, and it is always the square of the standard deviation.

The probabilities have to sum to 1

A valid probability distribution assigns a chance to every outcome, and those chances add to exactly 1. If your probabilities sum to something else, one of them is wrong or an outcome is missing, and the mean and standard deviation will be off. Each probability also has to sit between 0 and 1. The calculator checks the total for you and will not compute until it equals 1.

Using the calculator

Type your outcomes in the first box and their probabilities in the second, in the same order, separated by commas or spaces. The tool returns the expected value as its headline, then shows the variance and standard deviation with each step. The worked example below uses the values the calculator starts with, so you can match the tool against the arithmetic by hand. These results are parameters of the whole distribution, not statistics estimated from a sample.

Expected value is a parameter, not a sample mean

The expected value describes the model, not a batch of data. A sample mean xˉ\bar{x} comes from outcomes you actually observed and changes from sample to sample. The expected value μX\mu_X is a single fixed number built from the probabilities, so it does not move. When you collect real data, the average of your results should land near μX\mu_X once you have enough trials.

When the mean is not a possible outcome

The expected value does not have to be a value the variable can take. Roll a fair six-sided die and the mean is 3.53.5, even though no face shows 3.5. That is fine, because the mean is a balance point of the distribution, not a prediction of any single roll. Read it as the long-run average, not the most likely result.

Interpret the results in context

AP topic 2.9 asks you to interpret the mean and standard deviation, not just compute them, and it wants that interpretation tied to a specific population. Suppose XX counts the cars a randomly chosen household owns. A mean of μX=1.0\mu_X = 1.0 then reads as an average of about 1 car per household over the long run. A standard deviation of σX=1.0\sigma_X = 1.0 says household counts typically differ from that average by about 1 car, so always name the units and the population when you write up an answer.

Mean and SD of a four-outcome distribution

A discrete random variable XX takes the values 0, 1, 2, and 3 with probabilities 0.4, 0.3, 0.2, and 0.1. Find the mean and standard deviation of XX.

  1. Check the probabilities add to 1: 0.4+0.3+0.2+0.1=1.00.4 + 0.3 + 0.2 + 0.1 = 1.0, so this is a valid distribution.

  2. Multiply each outcome by its probability: (0)(0.4)+(1)(0.3)+(2)(0.2)+(3)(0.1)(0)(0.4) + (1)(0.3) + (2)(0.2) + (3)(0.1).

  3. Add those products to get the mean: 0+0.3+0.4+0.3=1.00 + 0.3 + 0.4 + 0.3 = 1.0, so μX=1.0\mu_X = 1.0.

  4. Find each squared deviation times its probability: (01)2(0.4)=0.4(0-1)^2(0.4) = 0.4, then (11)2(0.3)=0(1-1)^2(0.3) = 0, then (21)2(0.2)=0.2(2-1)^2(0.2) = 0.2, then (31)2(0.1)=4(0.1)=0.4(3-1)^2(0.1) = 4(0.1) = 0.4.

  5. Add these for the variance: 0.4+0+0.2+0.4=1.00.4 + 0 + 0.2 + 0.4 = 1.0.

  6. Take the square root for the standard deviation: σX=1.0=1.0\sigma_X = \sqrt{1.0} = 1.0.

The mean is μX=1.0\mu_X = 1.0 and the standard deviation is σX=1.0\sigma_X = 1.0. These are population parameters: over many trials, XX averages about 1.0 per trial and its values typically sit about 1.0 away from that mean.

Frequently asked questions

Do the probabilities need to add up to 1?

Yes. Every outcome's probability must be between 0 and 1, and together they must total 1 for a valid probability distribution. If they do not sum to 1, the calculator will not return a mean or standard deviation until you fix them.

What is the difference between expected value and a regular average?

The expected value is the long-run average of a random variable, weighted by how likely each outcome is, and it is a fixed parameter. A regular average, or sample mean, is computed from data you actually collected and varies from sample to sample. With enough trials, the sample mean settles near the expected value.

Is the standard deviation just the square root of the variance?

Yes. The variance is σX2=(xiμX)2P(xi)\sigma_X^2 = \sum (x_i - \mu_X)^2 P(x_i), and the standard deviation is its square root. AP reports the standard deviation because it is in the same units as the variable.

Can the expected value be a number the variable never takes?

Yes. The expected value is a balance point of the distribution, not a guaranteed outcome. A fair die has an expected value of 3.5 even though no face shows 3.5.