# Discrete probability distributions, expectation and variance

> IB Mathematics: Analysis and Approaches SL · IB AA SL
> Source: https://www.owlsprep.com/study/ib-math-aa-sl-u4-discrete-probability-distributions-expectation-and/

This sub-topic covers discrete probability distributions for countable random outcomes, how to verify valid probability mass functions, and calculate expected value and variance, core concepts for most IB AA SL probability exam questions.

**Prerequisites:** [Basic probability rules and axioms](https://www.owlsprep.com/study/ib-math-aa-sl-u4-basic-probability-rules/); [Descriptive statistics: mean and variance](https://www.owlsprep.com/study/ib-math-aa-sl-u2-descriptive-statistics/)

## Learning objectives

- Define discrete probability distributions and verify valid probability mass functions
- Calculate the expected value (mean) of a discrete random variable
- Calculate variance and standard deviation of a discrete random variable
- Apply linear properties of expectation and variance to transformed random variables

## Discrete Random Variables and Valid Distributions

**Discrete random variable** — A variable that takes a countable set of distinct values, where each value corresponds to a random outcome.

*Notation:* $X$

*Example:* Number of heads in 3 coin flips, number of customers entering a shop per hour

A discrete probability distribution is described by a **probability mass function (PMF)** $p(x) = P(X=x)$, which gives the probability of the random variable taking each value $x$. For a PMF to be valid, it must satisfy two core conditions:

- All probabilities satisfy $0 \leq p(x) \leq 1$
- The sum of all probabilities equals 1: $\sum_{x} p(x) = 1$

**Worked example:** A random variable $X$ has PMF $P(X=x) = kx$ for $x = 1, 2, 3$, and 0 otherwise. Find the value of $k$ that makes this a valid distribution.

1. Use the condition that the sum of all probabilities must equal 1:
2. $$P(X=1) + P(X=2) + P(X=3) = 1$$
3. Substitute the PMF into the equation:
4. $$k(1) + k(2) + k(3) = 1 \implies 6k = 1$$
5. Solve for $k$, then check all probabilities are between 0 and 1:
6. $$k = \frac{1}{6}, \quad \frac{1}{6}, \frac{2}{6}, \frac{3}{6} \in [0,1] \text{ so valid}$$

> **Exam tip:** Always check both conditions (sum to 1, all probabilities between 0 and 1) when asked to find a constant $k$ in an exam.

## Expectation of a Discrete Distribution

**Expected Value (Expectation)** — The long-run average value of the random variable over many repeated trials, calculated as a weighted average of outcomes weighted by their probability.

*Notation:* $E[X]$ or $\mu$

For any discrete random variable $X$, expectation is calculated with the formula:

$$E[X] = \sum_{x} x \cdot P(X=x)$$

> **tip**
>
> Expectation is the population mean, it does not need to be a value that $X$ can actually take.

**Worked example:** For the valid distribution $P(X=x) = \frac{x}{6}$ for $x=1,2,3$, calculate the expected value of $X$.

1. Substitute into the expectation formula:
2. $$E[X] = (1 \cdot \frac{1}{6}) + (2 \cdot \frac{2}{6}) + (3 \cdot \frac{3}{6})$$
3. Simplify the sum:
4. $$E[X] = \frac{1 + 4 + 9}{6} = \frac{14}{6} = \frac{7}{3} \approx 2.33$$

## Variance and Standard Deviation

**Variance** — A measure of the spread of the distribution around the expected value, equal to the expected value of the squared deviation from the mean.

*Notation:* $\text{Var}(X)$ or $\sigma^2$

For IB exams, the computational formula below is almost always faster and less error-prone than the definition formula:

$$\text{Var}(X) = E[X^2] - (E[X])^2, \quad E[X^2] = \sum_{x} x^2 P(X=x)$$

Standard deviation $\sigma = \sqrt{\text{Var}(X)}$ is also a measure of spread, in the same units as the original variable $X$.

**Worked example:** Given $E[X] = \frac{7}{3}$ for $P(X=x) = \frac{x}{6}$ for $x=1,2,3$, calculate the variance of $X$.

1. First calculate $E[X^2]$, the expected value of $X^2$:
2. $$E[X^2] = (1^2 \cdot \frac{1}{6}) + (2^2 \cdot \frac{2}{6}) + (3^2 \cdot \frac{3}{6}) = \frac{1 + 8 + 27}{6} = 6$$
3. Substitute into the variance formula:
4. $$\text{Var}(X) = 6 - \left(\frac{7}{3}\right)^2 = 6 - \frac{49}{9} = \frac{5}{9} \approx 0.56$$

> **Exam tip:** If you are running low on time, use the computational formula to avoid mistakes with squared deviations.

## Properties of Expectation and Variance

For any constants $a$ and $b$, the following linear properties hold for transformed random variables $Y = aX + b$, and are heavily tested in IB exams:

- $E[aX + b] = aE[X] + b$
- $\text{Var}(aX + b) = a^2 \text{Var}(X)$

> **warning**
>
> Adding a constant $b$ does not change variance! It shifts all values equally without changing their spread.

**Worked example:** Given $X$ has $E[X] = 3$ and $\text{Var}(X) = 2$, find $E[Y]$ and $\text{Var}(Y)$ for $Y = 2X - 4$.

1. Calculate expectation using the linear property:
2. $$E[2X - 4] = 2E[X] - 4 = 2(3) - 4 = 2$$
3. Calculate variance, note the constant term disappears:
4. $$\text{Var}(2X - 4) = 2^2 \text{Var}(X) = 4(2) = 8$$

## Common pitfalls

- **Wrong:** Forgetting to square the scaling factor $a$ when calculating $\text{Var}(aX + b)$
  - Why it fails: Variance measures squared spread, so scaling by $a$ changes variance by $a^2$, not $a$
  - Correct: Always use $\text{Var}(aX + b) = a^2 \text{Var}(X)$, the constant term $b$ is removed completely
- **Wrong:** Only checking that probabilities sum to 1 when finding a constant $k$, ignoring the $0 \leq p(x) \leq 1$ condition
  - Why it fails: Solving for $k$ can give a value that produces negative probabilities or probabilities greater than 1
  - Correct: Always verify that all individual probabilities are between 0 and 1 after solving for $k$
- **Wrong:** Calculating expectation as an unweighted average of $x$ values, ignoring their probabilities
  - Why it fails: Confusing the sample mean of data with the expected value of a distribution
  - Correct: Always multiply each $x$ by its probability before summing to get expectation
- **Wrong:** Mixing up the variance formula to get $\text{Var}(X) = (E[X^2] - E[X])^2$
  - Why it fails: Misremembering where the square goes in the computational formula
  - Correct: The square is only on the second term: $\text{Var}(X) = E[X^2] - (E[X])^2$
- **Wrong:** Expecting expectation to always be one of the possible values of $X$
  - Why it fails: Thinking expectation is a possible outcome, not a long-run average
  - Correct: It is completely acceptable for expectation to be a non-integer or value not in the sample space of $X$

## Cheatsheet

| Concept | Formula | Exam Note |
| --- | --- | --- |
| Valid PMF | $0 \leq P(X=x) \leq 1$, $\sum P(X=x) = 1$ | Check both conditions |
| Expectation | $E[X] = \sum x P(X=x)$ | Weighted average of outcomes |
| Variance | $\text{Var}(X) = E[X^2] - (E[X])^2$ | Use this formula for exams |
| $E[X^2]$ | $E[X^2] = \sum x^2 P(X=x)$ | Intermediate step for variance |
| Linear Expectation | $E[aX + b] = aE[X] + b$ | Always holds for any constants |
| Linear Variance | $\text{Var}(aX + b) = a^2 \text{Var}(X)$ | Constant $b$ does not change variance |

## What's next

This sub-topic lays the foundation for all named discrete probability distributions you will study next in IB AA SL, including the binomial distribution. The expectation and variance rules you learned here apply directly to these distributions, and you can use them to derive the standard formulas for named distributions. These concepts also form the basis for statistical inference, where you use sample statistics to estimate unknown population parameters like the true population mean. Mastery of these calculation methods is required for almost all probability questions on both Paper 1 and Paper 2 of the IB AA SL exam.

- [Binomial probability distribution](https://www.owlsprep.com/study/ib-math-aa-sl-u4-binomial-probability-distribution/)
- [Normal probability distribution](https://www.owlsprep.com/study/ib-math-aa-sl-u4-normal-probability-distribution/)
- [Calculus](https://www.owlsprep.com/study/ib-math-aa-sl-u5-overview/)

---

From [OwlsPrep](https://www.owlsprep.com) — free study guides for A-Level, IB, AP and IGCSE, written against the official syllabus. Canonical page: https://www.owlsprep.com/study/ib-math-aa-sl-u4-discrete-probability-distributions-expectation-and/
