Skip to content
M
hscscience Maths Adv · Y12
0/100daily goal
0
0
0 due
0
L1 · 0 XP
KJ
Your weak spots
Insights load after your first practice round.
Module 5 · L11 of 15 ~35 min ⚡ +95 XP available

Introduction to Random Variables

A discrete random variable counts: heads in ten coin flips, the sum of two dice. A continuous random variable measures: a student's height, the time until the next bus. This distinction is the foundation of all distributional theory — master it here before tackling the normal and binomial distributions that follow.

Today's hook — You measure a student's height: could it be exactly 170 cm — not 170.000001 or 169.999999, but exactly 170? For a continuous variable the probability of any single value is literally zero. That idea rewires how all of statistics works.
0/5QUESTS
Worksheets

Practise this lesson

Three printable worksheets that build from foundations to mastery — or build your own from any module’s questions.

01
Recall — your gut answer first
+5 XP warm-up

Is the height of a randomly selected student discrete or continuous? What about their shoe size? Without looking ahead — explain your reasoning for each.

auto-saved
02
The two core ideas
+5 XP to read

Every random variable in this course falls into one of two camps. Lock these down first — everything else in Module 5 spins out of them.

A discrete random variable takes countable values (usually integers). A continuous random variable can take any value in an interval — uncountably many possibilities.

DISCRETE 0,1,2… CONTINUOUS any value counts vs measures
$p(x) = P(X = x) \quad \text{and} \quad \sum p(x) = 1$
Discrete → countable
You can list every possible value: number of heads, sum of dice, goals in a match.
Continuous → measured
Height, time, volume — values fill a whole interval with no gaps between them.
Key difference
For continuous variables $P(X = x) = 0$. Only probabilities over intervals are non-zero.
03
What you'll master
Know

Key facts

  • Discrete: countable values; Continuous: uncountable (measured)
  • $p(x) = P(X = x)$ with $0 \leq p(x) \leq 1$ and $\sum p(x) = 1$
  • $F(x) = P(X \leq x)$ is the cumulative distribution function
Understand

Concepts

  • The difference between discrete and continuous random variables
  • How the CDF accumulates probability from the left
  • Why probability at a single point is zero for continuous variables
Can do

Skills

  • Classify variables as discrete or continuous
  • Construct and verify a probability function
  • Calculate probabilities using the CDF and complement rule
04
Key terms
Random variableA numerical quantity whose value depends on the outcome of a random experiment.
Discrete r.v.Takes only countable, distinct values — usually integers.
Continuous r.v.Can take any value in an interval — uncountably many possibilities.
Probability function$p(x) = P(X = x)$; requires $0 \leq p(x) \leq 1$ and $\sum p(x) = 1$.
CDF$F(x) = P(X \leq x)$ — accumulates probability up to and including $x$.
Complement rule$P(X > x) = 1 - F(x)$.
05
Discrete and Continuous Random Variables
core concept

A random variable $X$ is a numerical quantity whose value depends on the outcome of a random experiment.

Random Experiment Roll two dice Toss 10 coins maps to Random Variable X X = sum of dice X = number of heads values 2, 3, …, 12 0, 1, …, 10 Discrete Countable values (integers) Continuous Any value in a range e.g. height, time, weight

A random variable maps outcomes to numerical values — discrete (countable) or continuous (any value in a range).

Discrete random variables can take only countable, distinct values — usually integers.

  • Number of heads in 10 coin flips: $X \in \{0, 1, 2, \dots, 10\}$
  • Sum of two dice: $X \in \{2, 3, 4, \dots, 12\}$
  • Number of defective items in a batch: $X \in \{0, 1, 2, \dots, n\}$

Continuous random variables can take any value in an interval — uncountably many possibilities.

  • Height of a student: $X \in (0, 3)$ metres
  • Time until the next bus: $X \in (0, \infty)$ minutes
  • Volume of liquid in a bottle: $X \in (0, 1000)$ mL

The critical difference: For a discrete variable, $P(X = x)$ can be positive. For a continuous variable, $P(X = x) = 0$ for any specific value — we can only talk about $P(a < X < b)$.

What about shoe size? Shoe size takes specific countable values (6, 6.5, 7, 7.5, …), so it is technically discrete — though with many possible values, it is sometimes treated as continuous in practice.

Why $P(X = x) = 0$ for continuous variables. A continuous variable can take infinitely many values in any interval. If each point had positive probability, the total would be infinite — violating the rule $\sum p(x) = 1$. Instead, probability "smears" over intervals: only areas under the density curve give non-zero probability.

A random variable $X$ maps random outcomes to numerical values; Discrete: countable values — $P(X = x)$ can be positive; use a probability function

Pause — copy the key distinction: discrete random variables have $P(X = x) > 0$ for countable values (e.g., number of heads); continuous random variables have $P(X = x) = 0$ for any specific value — only $P(a < X < b)$ is non-zero — into your book.

Did you get this? True or false: for a continuous random variable, $P(X = 3.7)$ can be a positive number.

06
The Probability Function for Discrete Variables
core concept

We just saw that a discrete random variable assigns positive probability to each countable outcome. That raises a question: what rules must those probabilities satisfy — and how do we find an unknown constant $k$ in a PMF? This card answers it → the two axioms $0 \leq p(x) \leq 1$ and $\sum p(x) = 1$, and using the sum condition to solve for $k$.

The probability function (PMF) gives the probability that $X$ takes each possible value: $p(x) = P(X = x)$.

$$p(x) = P(X = x), \qquad 0 \leq p(x) \leq 1, \qquad \sum_{\text{all } x} p(x) = 1$$

Finding the constant $k$: A biased die has $P(X = x) = kx$ for $x = 1, 2, 3, 4, 5, 6$.

Use $\sum p(x) = 1$: $k(1 + 2 + 3 + 4 + 5 + 6) = 1$, so $21k = 1$, giving $k = \dfrac{1}{21}$.

Verification: $\dfrac{1}{21} + \dfrac{2}{21} + \dots + \dfrac{6}{21} = \dfrac{21}{21} = 1$ ✓

PROBLEM 1 · FIND k

A discrete random variable $X$ has $p(1) = 0.1$, $p(2) = 0.2$, $p(3) = 0.3$, $p(4) = 0.25$, $p(5) = k$. Find $k$.

1
$0.1 + 0.2 + 0.3 + 0.25 + k = 1$
All probabilities must sum to 1.
PROBLEM 2 · CDF PROBABILITIES

Using the same $X$ (with $k = 0.15$), find: (a) $P(X \leq 3)$, (b) $P(X > 3)$, (c) $P(2 \leq X \leq 4)$.

1
$P(X \leq 3) = p(1)+p(2)+p(3) = 0.1+0.2+0.3 = 0.6$
Add all probabilities up to and including $x = 3$.
PROBLEM 3 · CONDITIONAL PROBABILITY

Using the same $X$, find $P(X = 3 \mid X \geq 3)$.

1
$P(X \geq 3) = p(3)+p(4)+p(5) = 0.3+0.25+0.15 = 0.7$
Find the denominator — probability of the condition.

Probability function: $p(x) = P(X = x)$; every value in $[0, 1]$ and all values sum to 1; Finding $k$: set $\sum p(x) = 1$ and solve

Pause — copy the PMF definition $p(x) = P(X = x)$, the two validity conditions ($0 \leq p(x) \leq 1$ and $\sum p(x) = 1$), and the method for finding $k$ (set sum equal to 1 and solve) into your book.

Quick check: A probability function has $p(1) = 0.3$, $p(2) = 0.5$, $p(3) = 0.2$. What is $F(2) = P(X \leq 2)$?

07
The Cumulative Distribution Function (CDF)
core concept
$$F(x) = P(X \leq x) = \sum_{t \leq x} p(t)$$

We just saw the PMF gives individual-value probabilities with $\sum p(x) = 1$. That raises a question: exams often ask for $P(X \leq 4)$ or $P(2 \leq X \leq 5)$ — how do we accumulate probabilities and compute these efficiently? This card answers it → the CDF $F(x) = P(X \leq x)$, which accumulates probabilities as a staircase and lets us compute interval probabilities via $F(b) - F(a)$.

Properties of $F(x)$:

  • $0 \leq F(x) \leq 1$ for all $x$
  • $F(x)$ is non-decreasing (never goes down)
  • $\lim_{x \to -\infty} F(x) = 0$ and $\lim_{x \to +\infty} F(x) = 1$
  • $P(a < X \leq b) = F(b) - F(a)$

Example — biased die with $k = \frac{1}{21}$:

$x$123456
$p(x)$$\frac{1}{21}$$\frac{2}{21}$$\frac{3}{21}$$\frac{4}{21}$$\frac{5}{21}$$\frac{6}{21}$
$F(x)$$\frac{1}{21}$$\frac{3}{21}$$\frac{6}{21}$$\frac{10}{21}$$\frac{15}{21}$$\frac{21}{21}$

$F(4) = P(X \leq 4) = \dfrac{10}{21} \approx 0.476$.

Continuous variables and the CDF: For continuous variables, $P(X = x) = 0$ for every $x$. Instead, probability comes from a probability density function (PDF) $f(x)$, where:

  • $f(x) \geq 0$ and $\int_{-\infty}^{+\infty} f(x)\,dx = 1$
  • $P(a < X < b) = \int_a^b f(x)\,dx$ (area under the curve)
  • For continuous variables: $P(a < X < b) = P(a \leq X \leq b)$ since endpoints contribute zero

The CDF for continuous variables is a smooth S-curve (no jumps), unlike the step function for discrete variables.

Discrete vs continuous CDF at a glance. Discrete CDF: a staircase — jumps up by $p(x)$ at each value, flat between values. Continuous CDF: a smooth, increasing curve from 0 to 1 with no jumps anywhere. For the normal distribution coming in Lesson 12, the CDF is the famous S-shaped curve.

$F(x) = P(X \leq x)$ — accumulates probability from left up to $x$; Discrete CDF: staircase (jumps at each value of $X$)

Pause — copy the CDF definition $F(x) = P(X \leq x) = \sum_{t \leq x} p(t)$, the interval formula $P(a < X \leq b) = F(b) - F(a)$, and the staircase shape (discrete: jumps at each value; continuous: smooth S-curve) into your book.

Fill in the blank: The CDF of a discrete random variable is a because probability accumulates in at each possible value.

Trap 01
PMF value exceeds 1
Each individual probability $p(x)$ must satisfy $0 \leq p(x) \leq 1$. A value of $p(x) = 1.2$ makes the function immediately invalid — check this before summing.
Trap 02
Probabilities don't sum to 1
After finding $k$, always verify $\sum p(x) = 1$. A common slip is computing $\sum x^2$ instead of $\sum kx^2$ — substitute correctly before summing.
Trap 03
CDF subtraction direction
$P(a < X \leq b) = F(b) - F(a)$, not $F(a) - F(b)$. Always subtract the smaller CDF value from the larger. A negative probability is always wrong.

Odd one out: Three of these are valid probability function values; one is not. Which is the odd one out?

1

Classify each as discrete (D) or continuous (C): (a) number of passengers on a bus; (b) temperature at midday; (c) time to run 100 m; (d) number of goals scored.

2

$p(0) = 0.3$, $p(1) = 0.5$, $p(2) = 0.2$. Verify this is a valid PMF and find $F(1)$.

3

Find $k$ if $p(x) = kx^2$ for $x = 1, 2, 3$ is a probability function.

4

CDF: $F(1) = 0.2$, $F(2) = 0.5$, $F(3) = 0.8$, $F(4) = 1.0$. Find $p(2)$ and $p(3)$.

5

Explain why $P(3 < X < 5) = P(3 \leq X \leq 5)$ for a continuous random variable.

Match each term to its definition:

  • $p(x) = P(X = x)$
  • $F(x) = P(X \leq x)$
  • $P(X > x) = 1 - F(x)$
  • $\sum p(x) = 1$
  • validity condition
  • complement rule
  • cumulative distribution function
  • probability function
08
Revisit your thinking

Height is continuous — it can take any real number in a range (165.3 cm, 170.87 cm, …). Shoe size is discrete — it takes specific countable values (6, 6.5, 7, 7.5, …). You cannot buy size 7.234. The key is not how many values there are but whether they are countable (discrete) or form a continuum (continuous).

auto-saved
01
Multiple choice
+5 XP per correct · +25 XP all-correct

Pick your answer, then rate your confidence — that tells the system what to drill next. Each retry pulls a fresh mix from the bank.

02
Short answer
ApplyBand 43 marks

Q1. A discrete random variable $X$ has the following probability function:

$x$01234
$p(x)$0.050.20$k$0.300.15

(a) Find the value of $k$. (b) Find $P(X \leq 2)$. (c) Find $P(X > 2)$. (d) Find $P(X = 2 \mid X \geq 1)$. (3 marks)

auto-saved
ApplyBand 43 marks

Q2. The cumulative distribution function $F(x)$ for a discrete random variable is given by:

$x$12345
$F(x)$0.100.350.600.851.00

(a) Find $p(x)$ for each value of $x$. (b) Calculate $P(2 \leq X \leq 4)$. (c) Verify that $\sum p(x) = 1$. (d) Find the smallest value $x$ such that $F(x) \geq 0.5$. (3 marks)

auto-saved
AnalyseBand 53 marks

Q3. A lottery sells tickets numbered 1 to 100. You win $x$ dollars where $x$ is your ticket number. A student models the winnings with $p(x) = \dfrac{x}{5050}$ for $x = 1, 2, \dots, 100$. (a) Verify that this is a valid probability function. (b) Explain why the profit random variable (winnings minus $50 ticket cost) is technically different, and construct its PMF. (c) A critic argues: "Higher numbers are more likely — this lottery is unfair." Evaluate this claim mathematically. (3 marks)

auto-saved
Comprehensive answers (click to reveal)

Drill 1: (a) D; (b) C; (c) C; (d) D

Drill 2: Sum $= 0.3+0.5+0.2 = 1$ ✓. $F(1) = p(0)+p(1) = 0.3+0.5 = 0.8$.

Drill 3: $k(1+4+9) = 1$, so $14k = 1$, $k = \frac{1}{14}$.

Drill 4: $p(2) = F(2) - F(1) = 0.5 - 0.2 = 0.3$. $p(3) = F(3) - F(2) = 0.8 - 0.5 = 0.3$.

Drill 5: $P(X=3) = P(X=5) = 0$ for a continuous r.v., so adding/removing endpoints doesn't change the probability.

Q1 (3 marks): (a) $0.05+0.20+k+0.30+0.15=1$, so $k = 0.30$ [0.5]. (b) $P(X\leq2) = 0.05+0.20+0.30 = 0.55$ [0.5]. (c) $P(X>2) = 1-0.55 = 0.45$ [0.5]. (d) $P(X\geq1) = 1-0.05 = 0.95$. $P(X=2\mid X\geq1) = \frac{0.30}{0.95} = \frac{6}{19}\approx0.316$ [1+0.5].

Q2 (3 marks): (a) $p(1)=0.10$, $p(2)=0.25$, $p(3)=0.25$, $p(4)=0.25$, $p(5)=0.15$ [1]. (b) $F(4)-F(1) = 0.85-0.10 = 0.75$ [0.5]. (c) Sum $= 1.00$ ✓ [0.5]. (d) $F(2)=0.35 < 0.5$, $F(3)=0.60 \geq 0.5$, so smallest $x = 3$ [1].

Q3 (3 marks): (a) $\sum_{x=1}^{100}x = 5050$, so $\sum p(x) = 5050/5050 = 1$ ✓; each $p(x) = x/5050 \in (0,1)$ ✓ [1]. (b) Profit $Y = X-50$; $P_Y(y) = \frac{y+50}{5050}$ for $y=-49,\dots,50$ [0.5+0.5]. (c) Claim is correct: $p(100)/p(1) = 100$ — ticket 100 is 100× more likely. Problematic in practice due to market manipulation incentives [0.5+0.5].

01
Boss battle · The Probabilist
earn bronze · silver · gold

Five timed questions. Beat the boss to bank a tier — gold (90% + speed), silver (75%), or bronze (50%). Replays welcome.

Enter the arena
02
Science Jump · platform challenge

Climb platforms by answering random variable questions. Lighter alternative to the boss.

Mark lesson as complete

Tick when you've finished the practice and review.

🎓
Want help with Introduction to Random Variables?

Work through this topic 1-on-1 with an experienced HSC tutor.

Book a free session →