Tutorials › AP Statistics › Variance of a Discrete Random Variable

Expected value and variability · Tutorial 326 of 1000

Variance of a Discrete Random Variable

Build a probability-weighted table of squared deviations to calculate and interpret the variance of a discrete random variable.

Intermediate 9 min read

What You'll Learn

  • Calculate the variance of a discrete random variable from its probability distribution.
  • Organize values, probabilities, deviations from the mean, squared deviations, and weighted contributions in a table.
  • Check a variance calculation by confirming that the weighted deviations from the mean sum to zero.
  • Interpret variance as an average squared distance from the mean and report its squared units.
  • Avoid common errors such as forgetting to square deviations or weighting squared deviations incorrectly.

Measuring Variation Around the Mean

In Expected Value for Insurance Decisions, you used the expected value to describe the probability-weighted center of an outcome distribution. The mean does not tell the whole story: two distributions can have the same mean but place their probabilities at different distances from it. Variance measures how spread out a discrete random variable’s values are around their mean.

The calculation uses the mean \(\mu_X\) from The Mean of a Discrete Random Variable. For each possible value \(x\), find its deviation from the mean, square that deviation, and weight it by the probability \(P(X=x)\). Adding these weighted squared deviations gives the variance.

Definition: The variance of a discrete random variable \(X\), written \(\sigma_X^2\), is the probability-weighted average of the squared distances between its possible values and its mean \(\mu_X\).
$$ \sigma_X^2=\sum (x-\mu_X)^2P(X=x) $$

The expression \(x-\mu_X\) is the deviation of one possible value from the mean. Squaring the deviation makes every contribution nonnegative: a value below the mean and a value above the mean can both contribute to the variance. The probability weights each contribution according to how likely that value is.

Variance is an average of squared distances, so its units are squared as well. If \(X\) measures dollars, \(\sigma_X^2\) is measured in dollars squared. If \(X\) counts events, the variance is measured in events squared. The calculation describes spread, but the squared units mean the variance is not a distance in the original units.

A Table for Calculating Variance

A table helps keep the steps separate. First calculate \(\mu_X\), then fill in the deviation and squared-deviation columns, and finally multiply each squared deviation by its probability. Check that the original distribution is valid before using it, as in Checking Whether a Probability Distribution Is Valid.

Procedure: For each possible value \(x\), calculate \(x-\mu_X\), then \((x-\mu_X)^2\), and then \((x-\mu_X)^2P(X=x)\). Add the last column to find \(\sigma_X^2\).

A useful arithmetic check follows from the definition of the mean: the probability-weighted deviations from the mean should sum to zero. In symbols, \(\sum (x-\mu_X)P(X=x)=0\). This check does not replace the variance calculation, because variance uses squared deviations, but it can help reveal an incorrect mean or deviation.

Worked Example: Late Deliveries in a Two-Delivery Batch

Worked Example: Late Deliveries in a Two-Delivery Batch

A delivery service uses a model for a randomly selected batch of two deliveries. Let \(X\) be the number of deliveries in the batch that arrive late. The model gives the following distribution. Calculate and interpret \(\sigma_X^2\).

Late deliveries \(x\)\(P(X=x)\)
00.40
10.40
20.20

Check the distribution and find the mean. All probabilities are between 0 and 1, and \(0.40+0.40+0.20=1.00\). The probability-weighted mean is:

$$ \begin{aligned} \mu_X &=0(0.40)+1(0.40)+2(0.20)\\ &=0+0.40+0.40\\ &=0.80\text{ late deliveries}. \end{aligned} $$

Complete the variance table. Use \(0.80\) as the mean for every row.

\(x\)\(P(X=x)\)\(x-\mu_X\)\((x-\mu_X)^2\)\((x-\mu_X)^2P(X=x)\)
00.40\(-0.80\)0.640.256
10.400.200.040.016
20.201.201.440.288

Add the weighted squared deviations.

$$ \sigma_X^2=0.256+0.016+0.288=0.560 $$

As a check on the mean, the weighted deviations are \((-0.80)(0.40)+(0.20)(0.40)+(1.20)(0.20)=-0.32+0.08+0.24=0\).

Interpret in context. According to this model, the variance in the number of late deliveries per two-delivery batch is \(0.56\) late deliveries squared. It summarizes the probability-weighted squared distances of the possible counts from the mean of \(0.80\) late deliveries per batch.

Worked Example: Variance of an Insurance Payout

Worked Example: Variance of an Insurance Payout

An invented insurance model gives an insurer’s payout \(Y\) for one policy period. Calculate the variance of the payout. The payout values are dollar amounts.

Payout \(y\)\(P(Y=y)\)
$00.60
$5000.30
$1,0000.10

Check the distribution and find its mean. The probabilities are between 0 and 1 and sum to \(0.60+0.30+0.10=1.00\). Using the expected-value calculation from the earlier insurance tutorial:

$$ \begin{aligned} \mu_Y &=0(0.60)+500(0.30)+1000(0.10)\\ &=0+150+100\\ &=\$250. \end{aligned} $$

Find and weight each squared deviation. Keep the amounts in dollars while calculating the deviation column.

\(y\)\(P(Y=y)\)\(y-\mu_Y\)\((y-\mu_Y)^2\)\((y-\mu_Y)^2P(Y=y)\)
$00.60\(-\$250\)62,500 dollars squared37,500 dollars squared
$5000.30$25062,500 dollars squared18,750 dollars squared
$1,0000.10$750562,500 dollars squared56,250 dollars squared

For instance, the last row contributes \((1000-250)^2(0.10)=750^2(0.10)=562{,}500(0.10)=56{,}250\) dollars squared. Adding all three contributions gives:

$$ \sigma_Y^2=37{,}500+18{,}750+56{,}250=112{,}500\text{ dollars squared}. $$

Check the mean with the weighted deviations: \((-250)(0.60)+(250)(0.30)+(750)(0.10)=-150+75+75=0\).

Interpret in context. Under this invented payout model, the variance of the insurer’s payout per policy period is \(112{,}500\) dollars squared. It is the probability-weighted average of the squared dollar distances between each possible payout and the mean payout of $250. This result describes the payout distribution; it is not a payout amount the insurer should expect on one particular policy.

Worked Example: A Complete Four-Step Variance Solution

Worked Example: A Complete Four-Step Variance Solution

A technology help desk models \(X\), the number of customer chats it receives during a randomly selected ten-minute block. The distribution is shown below. Find and interpret the variance.

Chats \(x\)\(P(X=x)\)
00.10
10.30
20.40
30.20

State. \(X\) is the number of customer chats received in one ten-minute block. The requested quantity is \(\sigma_X^2\), the variance of this discrete random variable.

Plan. Check that the table is a valid probability distribution. Find the mean \(\mu_X\), then calculate and add \((x-\mu_X)^2P(X=x)\) for every possible value. The interpretation will be in chats squared per ten-minute block. The model’s probabilities are treated as given.

Do. Every probability is between 0 and 1, and \(0.10+0.30+0.40+0.20=1.00\). First find the mean:

$$ \begin{aligned} \mu_X &=0(0.10)+1(0.30)+2(0.40)+3(0.20)\\ &=0+0.30+0.80+0.60\\ &=1.70\text{ chats per ten-minute block}. \end{aligned} $$

Now calculate every weighted squared deviation.

\(x\)\(P(X=x)\)\(x-\mu_X\)\((x-\mu_X)^2\)\((x-\mu_X)^2P(X=x)\)
00.10\(-1.70\)2.890.289
10.30\(-0.70\)0.490.147
20.400.300.090.036
30.201.301.690.338

Therefore, \(\sigma_X^2=0.289+0.147+0.036+0.338=0.810\) chats squared per ten-minute block. As a check, the weighted deviations sum to \((-1.70)(0.10)+(-0.70)(0.30)+(0.30)(0.40)+(1.30)(0.20)=-0.17-0.21+0.12+0.26=0\).

Conclude. According to the help desk’s model, the variance in the number of chats received per ten-minute block is \(0.81\) chats squared. This summarizes the probability-weighted squared distances from the mean of \(1.70\) chats per block; it does not say that a particular block will contain 0.81 chats.

Common Mistakes and AP Exam Tips

  • Forgetting to square the deviation. The contribution is \((x-\mu_X)^2P(X=x)\), not \((x-\mu_X)P(X=x)\). Without squaring, values below the mean contribute negatively and can cancel values above it.
  • Squaring the probability or weighting at the wrong point. Square the distance from the mean, then multiply by the probability: \((x-\mu_X)^2P(X=x)\). Do not use \((x-\mu_X)^2P(X=x)^2\).
  • Using the wrong center. Calculate \(\mu_X\) from the distribution before filling the variance table. The deviations must be measured from the probability-weighted mean, not from the most likely value or the middle value.
  • Leaving out a possible value. Include every row in the distribution, even when its probability is small. First check the table as in Checking Whether a Probability Distribution Is Valid.
  • Stopping after finding the mean. The mean describes the center; it is not the variance. Show the deviations, their squares, the weighted contributions, and the sum.
  • Reporting ordinary units or overinterpreting the result. State squared units, such as dollars squared or chats squared. A full-credit interpretation identifies the random variable and explains that the variance is a probability-weighted average of squared distances from its mean.

For a clear AP response, name the random variable, calculate and show its mean, and organize the variance calculation so every possible value is accounted for. Finish by adding the weighted squared deviations and interpreting the result in context with squared units.

Key Takeaway

Variance describes spread by averaging squared distances from the mean, with each distance weighted by the probability of its value. Its formula uses the same probabilities as the mean, but each value’s contribution is based on its squared deviation from that mean.

Key takeaway: Find \(\mu_X\), calculate \((x-\mu_X)^2P(X=x)\) for every possible value, and add the contributions to obtain \(\sigma_X^2\). Report the variance in squared units and interpret it as an average squared distance from the mean.

Check Your Understanding

Use the distribution below for \(X\), the number of plants in a small sample that show a specified leaf pattern.

\(x\)\(P(X=x)\)
00.20
10.50
20.30
  1. Check that the probabilities form a valid discrete distribution.
  2. Calculate and interpret \(\mu_X\).
  3. Complete a variance table with columns for \(x-\mu_X\), \((x-\mu_X)^2\), and \((x-\mu_X)^2P(X=x)\).
  4. Find \(\sigma_X^2\), showing the sum of the weighted squared deviations.
  5. Check whether the weighted deviations from the mean sum to zero, and state the units for the variance.