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.multiply each outcome by its probability: (0)(0.4) + (1)(0.3) + (2)(0.2) + (3)(0.1)
- 2.mean = 0 + 0.3 + 0.4 + 0.3 = 1
- 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.variance = 1
- 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 or , is the mean of its probability distribution. You find it by multiplying each possible outcome by its probability and adding the products:
Here is a value the variable can take and 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 per trial.
How the standard deviation is built
The standard deviation measures how far the outcomes typically fall from the mean. First find the variance by taking each deviation from the mean , squaring it, weighting it by that outcome's probability, and adding:
The standard deviation is the square root of that variance:
Because the variance is in squared units, taking the square root brings it back to the same units as , which is why AP reports the standard deviation. The variance itself is also written or , 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 comes from outcomes you actually observed and changes from sample to sample. The expected value 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 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 , 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 counts the cars a randomly chosen household owns. A mean of then reads as an average of about 1 car per household over the long run. A standard deviation of 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 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 .
Check the probabilities add to 1: , so this is a valid distribution.
Multiply each outcome by its probability: .
Add those products to get the mean: , so .
Find each squared deviation times its probability: , then , then , then .
Add these for the variance: .
Take the square root for the standard deviation: .
The mean is and the standard deviation is . These are population parameters: over many trials, 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 , 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.