Resources For Teachers For Tutors For Students & Parents Pricing
Year 11 Maths - Specialist (Unit 1 and Unit 2) Simulation, sampling and sampling distributions

Mean, variance and standard deviation of a discrete random variable

20 practice questions 0 video lessons Theory + worked examples

Master the mean, variance and standard deviation of a discrete random variable in Year 11 VCE Specialist Mathematics. A discrete random variable \(X\) takes separate numerical values, each with a probability set out in a probability distribution table. It sits in the Data analysis, probability and statistics area of study of the VCE Mathematics Study Design (VCAA), within the Simulation, sampling and sampling distributions topic of Unit 2.

You will learn to check a distribution and find an unknown probability from \(\sum P(x)=1\), calculate the mean \(E(X)=\sum x\,P(x)\), the variance \(\mathrm{Var}(X)=E(X^2)-[E(X)]^2\) and the standard deviation \(\mathrm{sd}(X)=\sqrt{\mathrm{Var}(X)}\), and apply the linear rule \(E(aX+b)=a\,E(X)+b\) — the foundation for sampling distributions later in Unit 2.

Create a free accountTrack your progress and save your work as you go.
Create free account

Theory

A discrete random variable \(X\) takes separate numerical values, each with a probability set out in a probability distribution table. In Year 11 Specialist Mathematics you find its mean \(E(X)=\sum x\,P(x)\), its variance \(\mathrm{Var}(X)=E(X^2)-[E(X)]^2\) and its standard deviation \(\mathrm{sd}(X)=\sqrt{\mathrm{Var}(X)}\), after checking the probabilities sum to \(1\). This page shows how, with fully worked examples.

A random variable \(X\) assigns a number to each outcome of a chance experiment. It is discrete when its possible values are separate numbers (for example \(0, 1, 2, 3\)) rather than a continuous range. The list of those values together with their probabilities is the probability distribution of \(X\), usually written as a table of \(x\) against \(P(X=x)\).

For a table to be a valid probability distribution, every probability must lie between \(0\) and \(1\), and the probabilities must add to \(1\): \(\sum P(x)=1\). This condition is what lets you solve for an unknown probability in a distribution.

The mean or expected value \(E(X)\), written \(\mu\), is the long-run average value of \(X\). It is the sum of each value multiplied by its probability, \(E(X)=\sum x\,P(x)\) — a weighted average that pulls towards the more likely values.

The variance \(\mathrm{Var}(X)\) measures how spread out the values are about the mean. It is the expected squared distance from the mean, \(\sum (x-\mu)^2 P(x)\), which rearranges to the shortcut \(E(X^2)-[E(X)]^2\). The standard deviation \(\mathrm{sd}(X)=\sqrt{\mathrm{Var}(X)}\) brings this spread back to the original units of \(X\).

\(x\)\(0\)\(1\)\(2\)\(3\)
\(P(X=x)\)\(0.1\)\(0.3\)\(0.4\)\(0.2\)
A probability distribution lists each value \(x\) with its probability \(P(X=x)\). This table is valid: every probability is in \([0,1]\) and they sum to \(0.1+0.3+0.4+0.2=1\).
    sum
\(x\)\(0\)\(1\)\(2\)\(3\)\(—\)
\(P(x)\)\(0.1\)\(0.3\)\(0.4\)\(0.2\)\(1\)
\(x\,P(x)\)\(0\)\(0.3\)\(0.8\)\(0.6\)\(1.7\)
\(x^2P(x)\)\(0\)\(0.3\)\(1.6\)\(1.8\)\(3.7\)
Adding a \(x\,P(x)\) row and a \(x^2P(x)\) row turns the distribution into two column sums: \(E(X)=1.7\) and \(E(X^2)=3.7\), so \(\mathrm{Var}(X)=3.7-1.7^2=0.81\).

A discrete random variable \(X\) has a valid probability distribution when the probabilities are non-negative and total \(1\):

\[ 0 \le P(x) \le 1, \qquad \sum P(x) = 1 \]
xP(x)=1

The mean (expected value) is the probability-weighted sum of the values:

\[ \mu = E(X) = \sum x\,P(x) \]
E(X)=xxP(x)

The variance is the expected squared distance from the mean; the right-hand form is the usual shortcut:

\[ \mathrm{Var}(X) = \sum (x-\mu)^2 P(x) = E(X^2)-[E(X)]^2 \]
Var(X)=E(X2)[E(X)]2

where \(E(X^2)=\sum x^2\,P(x)\). The standard deviation is the square root of the variance, restoring the units of \(X\):

\[ \mathrm{sd}(X) = \sqrt{\mathrm{Var}(X)} \]
sd(X)=Var(X)

Expectation is linear, so for a linear function \(aX+b\):

\[ E(aX+b) = a\,E(X) + b \]
E(aX+b)=aE(X)+b
Use the shortcut for variance. Computing \(\mathrm{Var}(X)=E(X^2)-[E(X)]^2\) is almost always quicker than \(\sum (x-\mu)^2 P(x)\): build a \(x\,P(x)\) column for \(E(X)\) and a \(x^2P(x)\) column for \(E(X^2)\), then subtract the square of the mean.

Finding the mean, variance and standard deviation

  1. Check the distribution. Confirm every \(P(x)\) is in \([0,1]\) and that \(\sum P(x)=1\). If a probability is unknown, use \(\sum P(x)=1\) to solve for it.
  2. Mean. Multiply each value by its probability and add: \(E(X)=\sum x\,P(x)\). A \(x\,P(x)\) column keeps this tidy.
  3. \(E(X^2)\). Square each value first, then multiply by its probability and add: \(E(X^2)=\sum x^2\,P(x)\).
  4. Variance. Subtract the square of the mean: \(\mathrm{Var}(X)=E(X^2)-[E(X)]^2\).
  5. Standard deviation. Take the positive square root: \(\mathrm{sd}(X)=\sqrt{\mathrm{Var}(X)}\).
  6. Function of \(X\). For a linear function use \(E(aX+b)=a\,E(X)+b\); there is no need to build a new distribution.

Laying the work out as columns of a table — \(x\), \(P(x)\), \(x\,P(x)\) and \(x^2P(x)\) — makes the two sums \(E(X)\) and \(E(X^2)\) easy to read off and check.

Example 1 — Mean of a distribution
The discrete random variable \(X\) has the probability distribution shown. Find the mean \(E(X)\).
\(x\)\(0\)\(1\)\(2\)\(3\)
\(P(X=x)\)\(0.1\)\(0.3\)\(0.4\)\(0.2\)
Solution

First check the probabilities sum to \(1\):

\(\sum P(x)\)\(=\)\(0.1+0.3+0.4+0.2\)
\(=\)\(1\ \checkmark\)

Multiply each value by its probability and add, \(E(X)=\sum x\,P(x)\):

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

The mean is \(E(X)=1.7\).

Example 2 — Find an unknown probability
For the probability distribution shown, the value \(k\) is unknown. Given that the probabilities must sum to \(1\), find \(k\).
\(x\)\(1\)\(2\)\(3\)\(4\)
\(P(X=x)\)\(0.1\)\(0.2\)\(k\)\(0.3\)
Solution

The probabilities of a distribution add to \(1\), so set \(\sum P(x)=1\):

\(0.1+0.2+k+0.3\)\(=\)\(1\)
\(0.6+k\)\(=\)\(1\)
\(k\)\(=\)\(1-0.6\)
\(=\)\(0.4\)

The unknown probability is \(k=0.4\).

Example 3 — Variance and standard deviation
The discrete random variable \(X\) has the probability distribution shown. Find the mean \(E(X)\), the variance \(\mathrm{Var}(X)\) and the standard deviation \(\mathrm{sd}(X)\).
\(x\)\(1\)\(2\)\(3\)
\(P(X=x)\)\(0.2\)\(0.5\)\(0.3\)
Solution

Mean, \(E(X)=\sum x\,P(x)\):

\(E(X)\)\(=\)\(1(0.2)+2(0.5)+3(0.3)\)
\(=\)\(0.2+1.0+0.9\)
\(=\)\(2.1\)

\(E(X^2)=\sum x^2\,P(x)\) — square each value first:

\(E(X^2)\)\(=\)\(1(0.2)+4(0.5)+9(0.3)\)
\(=\)\(0.2+2.0+2.7\)
\(=\)\(4.9\)

Variance, \(\mathrm{Var}(X)=E(X^2)-[E(X)]^2\):

\(\mathrm{Var}(X)\)\(=\)\(4.9-(2.1)^2\)
\(=\)\(4.9-4.41\)
\(=\)\(0.49\)

Standard deviation, \(\mathrm{sd}(X)=\sqrt{\mathrm{Var}(X)}\):

\(\mathrm{sd}(X)\)\(=\)\(\sqrt{0.49}\)
\(=\)\(0.7\)

\(E(X)=2.1\), \(\mathrm{Var}(X)=0.49\) and \(\mathrm{sd}(X)=0.7\).

Example 4 — Full summary and a function of X
The discrete random variable \(X\) has the probability distribution shown. Find the standard deviation \(\mathrm{sd}(X)\), and hence \(E(2X+3)\).
\(x\)\(1\)\(2\)\(3\)\(4\)
\(P(X=x)\)\(0.4\)\(0.3\)\(0.2\)\(0.1\)
Solution

Mean and \(E(X^2)\) from the distribution:

\(E(X)\)\(=\)\(1(0.4)+2(0.3)+3(0.2)+4(0.1)\)
\(=\)\(0.4+0.6+0.6+0.4=2\)
\(E(X^2)\)\(=\)\(1(0.4)+4(0.3)+9(0.2)+16(0.1)\)
\(=\)\(0.4+1.2+1.8+1.6=5\)

Variance, then standard deviation:

\(\mathrm{Var}(X)\)\(=\)\(5-(2)^2=1\)
\(\mathrm{sd}(X)\)\(=\)\(\sqrt{1}=1\)

Expectation is linear, so \(E(2X+3)=2\,E(X)+3\):

\(E(2X+3)\)\(=\)\(2(2)+3\)
\(=\)\(7\)

\(\mathrm{sd}(X)=1\) and \(E(2X+3)=7\).

    sum
\(x\)\(1\)\(2\)\(3\)\(4\)\(—\)
\(P(x)\)\(0.4\)\(0.3\)\(0.2\)\(0.1\)\(1\)
\(x\,P(x)\)\(0.4\)\(0.6\)\(0.6\)\(0.4\)\(1.7\)
\(x^2P(x)\)\(0.4\)\(1.2\)\(1.8\)\(1.6\)\(3.7\)

Common pitfalls

Forgetting to square before weighting for \(E(X^2)\). \(E(X^2)=\sum x^2\,P(x)\) squares each value then multiplies by its probability. It is not \([E(X)]^2\), and the two are almost never equal — their difference is exactly the variance.
Confusing the variance with the standard deviation. The variance is in squared units; the standard deviation is its square root, \(\mathrm{sd}(X)=\sqrt{\mathrm{Var}(X)}\). If asked for \(\mathrm{sd}(X)\), remember the final square-root step.
Not checking the distribution first. A table is only a probability distribution if every \(P(x)\in[0,1]\) and \(\sum P(x)=1\). Always confirm this — and use it to find any unknown probability — before computing \(E(X)\).
Squaring the whole \(E(aX+b)\) rule. Expectation is linear, so \(E(aX+b)=a\,E(X)+b\). Do not square \(a\) here; the factor \(a^2\) belongs to variance (\(\mathrm{Var}(aX+b)=a^2\,\mathrm{Var}(X)\)), not to the mean.

Frequently asked questions

What is a discrete random variable?

It is a variable \(X\) whose possible values are separate numbers, each with a probability given by a probability distribution. For a valid distribution every \(P(x)\) lies in \([0,1]\) and \(\sum P(x)=1\).

How do I find the mean of a discrete random variable?

The mean, or expected value, is \(E(X)=\sum x\,P(x)\): multiply each value by its probability and add. It is a weighted average of the values.

What is the formula for the variance?

The variance is \(\mathrm{Var}(X)=E(X^2)-[E(X)]^2\), where \(E(X^2)=\sum x^2\,P(x)\). This is equal to \(\sum (x-\mu)^2 P(x)\) but is usually quicker to compute.

How is the standard deviation related to the variance?

The standard deviation is the square root of the variance, \(\mathrm{sd}(X)=\sqrt{\mathrm{Var}(X)}\). It measures spread in the same units as \(X\), whereas the variance is in squared units.

How do I find an unknown probability in a distribution?

Use the fact that the probabilities sum to \(1\). Add the known probabilities and the unknown, set the total equal to \(1\), and solve. For example \(0.1+0.2+k+0.3=1\) gives \(k=0.4\).

How do I find the expected value of a function of X?

For a linear function, expectation is linear: \(E(aX+b)=a\,E(X)+b\). For a general function \(g(X)\), use \(E\big(g(X)\big)=\sum g(x)\,P(x)\), for example \(E(X^2)=\sum x^2\,P(x)\).