DP Math AA · HL · Statistics & Probability

AHL 4.14—Properties of discrete and continuous random variables

Get started
Notes Quiz

Introduction to Discrete and Continuous Random Variables

A random variable is a variable whose value is determined by the outcome of a random experiment. At HL, we study both discrete and continuous random variables in depth, including their measures of centre and spread, and how linear transformations affect them.

Discrete Random Variable: A random variable X that can take only a countable number of distinct values (e.g. 0, 1, 2, 3, ...). Each value has an associated probability P(X=xk​), and the sum of all probabilities equals 1: ∑k​P(X=xk​)=1

Continuous Random Variable: A random variable X that can take any value within a given interval (or union of intervals). It is described by a probability density function (PDF) rather than individual probabilities at each point.

Analogy

Think of a discrete random variable like rolling a die , you get one of a fixed set of outcomes. A continuous random variable is more like measuring the exact height of a student , it can take any value in a range, and the probability of any single exact value is zero.

Expected Value (Mean) of a Discrete Random Variable

Before studying variance, we need the expected value , the probability-weighted average of all possible values:

Expected Value of a Discrete Random Variable: E(X)=∑k​xk​P(X=xk​)
This is also called the mean and denoted μ.

Example

Example: A discrete random variable X has the following distribution:

x0123
P(X=x)0.20.30.40.1

E(X)=0(0.2)+1(0.3)+2(0.4)+3(0.1)=0+0.3+0.8+0.3=1.4

Mode and Median of a Discrete Random Variable

Mode (Discrete): The value of x with the highest probability P(X=x). It is the most likely outcome.

Median (Discrete): The value m such that P(X≤m)≥0.5 and P(X≥m)≥0.5. For small distributions, it is found by accumulating probabilities in order until the cumulative total first reaches or exceeds 0.5.

Example

Example: Using the distribution above:

x0123
P(X=x)0.20.30.40.1
Cumulative0.20.50.91.0

Mode: x=2 has the highest probability (0.4), so mode = 2.

Median: The cumulative probability first reaches 0.5 at x=1, so median = 1.

Variance of Discrete Random Variables

For a discrete random variable X with mean μ=E(X), the variance measures how spread out the values are around the mean.

Variance of a Discrete Random Variable: Var(X)=E[(X−μ)2]=∑k​(xk​−μ)2P(X=xk​)

In practice, the following equivalent formula is far more efficient for calculation:

Var(X)=E(X2)−[E(X)]2​

where E(X2)=∑k​xk2​P(X=xk​).

Note

This shortcut formula comes from expanding E[(X−μ)2]=E[X2−2μX+μ2]=E(X2)−2μE(X)+μ2=E(X2)−μ2. It is the form you should use in almost all exam calculations.

Example

Example: A discrete random variable X has the following distribution:

x1234
P(X=x)0.10.30.40.2

Step 1: Find E(X)
E(X)=1(0.1)+2(0.3)+3(0.4)+4(0.2)=0.1+0.6+1.2+0.8=2.7

Step 2: Find E(X2)
E(X2)=12(0.1)+22(0.3)+32(0.4)+42(0.2)=0.1+1.2+3.6+3.2=8.1

Step 3: Calculate Var(X)
Var(X)=8.1−(2.7)2=8.1−7.29=0.81

Standard deviation: σ=0.81​=0.9

Free preview

9 more sections in this topic

← Previous topicAHL 4.13—Bayes theorem
Koncepts

Learn it properly. Then practise like it's the real paper.

Start free

Features

  • Lessons
  • Past papers
  • Library
  • Homework Help
  • Duels

More

  • For parents
  • Compare
  • Plans & pricing
  • DP for students

Legal

  • Privacy
  • Terms
  • Account deletion

© 2026 Koncepts (product of PrepAiro, Inc). All rights reserved.
DP, IB, EE and TOK are terms of the International Baccalaureate Organization.

Made for IB DP students.