MISSION · Data and probability

Discrete Random Variables

A table of outcomes with their chances, and the two numbers that summarise it

Explorer level
Grades 10-12
Quest time
7 minutes
Mission skill
Building a probability distribution and computing its mean and standard deviation

LEVEL 1 · EXPLORE

Make the idea move

Change the controls and watch what happens. Follow your curiosity and see what you notice.

Loading the activity…

LEVEL 2 · LEARN

Unlock the explanation

Open the chapters in any order. Try the examples as you go.

The idea in one sentence

A random variable attaches a number to each outcome of a random experiment, and its probability distribution lists every value that number can take alongside how likely it is.

From outcomes to numbers

Flip three coins. The outcomes are HHH, HHT, HTH, and five more — eight in all, none of them numbers. Let \(X\) be the number of heads. Now every outcome carries a number, and you can ask what \(X\) usually is.

Collecting the eight equally likely outcomes by their head count gives the distribution:

\(x\) 0 1 2 3
\(P(X = x)\) \(\frac{1}{8}\) \(\frac{3}{8}\) \(\frac{3}{8}\) \(\frac{1}{8}\)

Two rules hold for every distribution, and checking them catches most setup errors:

\[0 \le P(X = x) \le 1 \qquad \text{and} \qquad \sum P(X = x) = 1\]

The total must be 1 because something has to happen.

Discrete means the values can be listed — 0, 1, 2, 3, or any whole number. A continuous random variable like a height takes every value in a range, and needs the normal distribution machinery instead, where individual values have probability zero and only intervals have probability.

The mean: a weighted average

The expected value \(E(X)\), also written \(\mu\), is each value multiplied by its probability, all added:

\[E(X) = \sum x \cdot P(X = x)\]

For the three coins: \(0(\tfrac18) + 1(\tfrac38) + 2(\tfrac38) + 3(\tfrac18) = 1.5\).

It is a weighted average, and the weights are the probabilities. That is why it can be a value \(X\) never actually takes — 1.5 heads never happens, and a die averages 3.5 without ever showing it. \(E(X)\) is the long-run mean over many repeats, not a prediction of the next one.

The spread: variance and standard deviation

Two distributions can share a mean and behave completely differently. A game paying $1 every time and a game paying $0 or $2 on a coin flip both have \(E(X) = 1\); only one of them is exciting.

The variance measures that, as the expected squared distance from the mean:

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

There is a shortcut that is usually faster by hand:

\[\text{Var}(X) = E(X^2) - \left[E(X)\right]^2\]

where \(E(X^2)\) means squaring each value before weighting. For the three coins, \(E(X^2) = 0(\tfrac18) + 1(\tfrac38) + 4(\tfrac38) + 9(\tfrac18) = 3\), so \(\text{Var}(X) = 3 - 1.5^2 = 0.75\).

The standard deviation is \(\sigma = \sqrt{\text{Var}(X)} = \sqrt{0.75} \approx 0.87\), and unlike the variance it is back in the original units — heads, dollars, goals — which is why it is the one usually quoted.

Using it on a game

A game costs $2 to play. You win $10 with probability 0.1, $1 with probability 0.3, and nothing otherwise.

\[E(\text{winnings}) = 10(0.1) + 1(0.3) + 0(0.6) = 1.30\]

Against a $2 stake, the expected profit is \(-\$0.70\) per play. The game is not fair, and over 1000 plays you should expect to be about $700 down. A fair game is one where the expected profit is exactly zero — which no commercial game has ever been.

Common mix-ups

  • Probabilities not summing to 1. Always check before computing anything else.
  • Averaging the values instead of weighting them. The mean of \(\{0,1,2,3\}\) is 1.5 here only because this distribution happens to be symmetric. Change the probabilities and the plain average is wrong.
  • Squaring after weighting. \(E(X^2)\) squares each \(x\) first; \([E(X)]^2\) squares at the end. The gap between them is the variance.
  • Expecting \(E(X)\) to be attainable. 3.5 on a die, 1.5 heads — both fine.
  • Quoting the variance as the spread. Its units are squared. Take the root.

Check yourself

What must the probabilities in a distribution add to, what is \(E(X)\) for a fair die, and what is \(E(X)\) if \(X\) is 0 with probability 0.75 and 4 with probability 0.25?

They must sum to 1. A die gives \(\frac{1+2+3+4+5+6}{6} = 3.5\). And \(0(0.75) + 4(0.25) = 1\) — a value \(X\) itself never takes.

LEVEL 3 · REFLECT

Add this quest to your trail

When you feel ready, mark this idea as explored. You can always come back and try it again.

EXPLORER STRATEGIES

More ways to see it

Loading shared methods…
Share how you learned it