# Continuous Random Variables

> Measured data, histograms as areas, probability density functions, cumulative distribution, median, mean and variance.

From HSC Maths Advanced on WhizzNotes, free study notes for NSW students: https://whizznotes.com/mathematics-advanced/continuous-random-variables/. Updated 3 November 2026.
Year 11 and Year 12 boxes go deeper than the Year 10 text around them.

### Story time: The bus that is never on time
Amira's bus is due at 8:00 but can turn up any time up to 8:10. She asks, "What is the probability it comes at exactly 8:04?" Her teacher says the answer is zero.

That sounds wrong, but think about it: exactly 8:04 and 0.000 seconds is one point among infinitely many possible times. A better question is "What is the chance it comes **between** 8:04 and 8:06?" For measured quantities like time, height and mass, probability lives in **intervals**, and it is found as an **area**.

**In short:** A continuous random variable takes any value in a range, like a height or a time. Its probabilities are areas under a probability density function $f(x)$, with total area 1, so $P(a \leq X \leq b) = \int_a^b f(x)\,dx$.

## Starting point: Years 9 and 10

### Counted and measured data

- **Discrete** data is counted: goals scored, number of siblings. Only certain values are possible.
- **Continuous** data is measured: height, time, mass. Any value in a range is possible.

### Histograms for continuous data

Continuous data is grouped into classes such as $150 \leq h < 155$. A **histogram** has bars that touch, because the classes have no gaps between them.

| Height (cm) | 150 to 155 | 155 to 160 | 160 to 165 | 165 to 170 |
|---|---|---|---|---|
| Frequency | 4 | 10 | 12 | 4 |

There are 30 students. The **relative frequency** of 160 to 165 cm is $\dfrac{12}{30} = 0.4$.

### Probability as area

If you draw a relative frequency histogram where each bar's **area** is its relative frequency, the total area of all bars is 1. The chance a student is in a class equals the area of that bar.

### Key idea: Probability is area
For continuous data, the probability of landing in an interval is the area above that interval. The total area is always 1.

### Watch out: Bars touch
For continuous data, histogram bars touch. Gaps suggest the data is in separate categories.

**Mind map**

```text
Continuous random variables
  Measured data
    Any value in a range
    Probability of one exact value is 0
  Density function f(x)
    f(x) ≥ 0
    Total area 1
  Probability
    P(a ≤ X ≤ b) = area
    Integrate f from a to b
  Cumulative F(x)
    P(X ≤ x)
    Median: F(m) = 0.5
  Mean and variance
    μ = ∫ x f(x) dx
    Var = ∫ x² f(x) dx - μ²
```

### Year 11: Density curves and the uniform distribution
Make the classes narrower and narrower, and the tops of the bars smooth out into a curve called a **density curve**. The probability of an interval is the area under the curve.

Amira's bus is equally likely at any time from 0 to 10 minutes late. Its density curve is a flat line at height $\dfrac{1}{10}$, so the total area is $10 \times \dfrac{1}{10} = 1$. This is a **uniform distribution**.

$P(4 \leq T \leq 6) = 2 \times \dfrac{1}{10} = 0.2$.

### Year 12: Probability density functions
A **probability density function** (PDF) $f(x)$ has two rules:

$$f(x) \geq 0 \qquad \int_{-\infty}^{\infty} f(x)\,dx = 1$$

and probabilities are integrals:

$$P(a \leq X \leq b) = \int_a^b f(x)\,dx$$

Because a single point has no width, $P(X = a) = 0$, so $<$ and $\leq$ give the same answer.

*Diagram: Triangle-shaped density f of x equals x over 2 from 0 to 2, with the area from 0 to 1 shaded*
*The whole triangle has area 1. The shaded part, P(X ≤ 1), has area ¼.*

**Example.** $f(x) = \dfrac{x}{2}$ for $0 \leq x \leq 2$, and 0 elsewhere.

Check: $\displaystyle\int_0^2 \frac{x}{2}\,dx = \left[\frac{x^2}{4}\right]_0^2 = 1$.

$P(X \leq 1) = \left[\dfrac{x^2}{4}\right]_0^1 = \dfrac{1}{4}$.

**Cumulative distribution function.** $F(x) = P(X \leq x) = \displaystyle\int_{-\infty}^{x} f(t)\,dt$. Here $F(x) = \dfrac{x^2}{4}$ on $[0, 2]$. The **median** $m$ solves $F(m) = 0.5$: $m^2 = 2$, so $m = \sqrt{2} \approx 1.41$. Also $F'(x) = f(x)$.

**Mean and variance.**

$$\mu = \int x f(x)\,dx = \int_0^2 \frac{x^2}{2}\,dx = \frac{4}{3}$$

$$\text{Var}(X) = \int x^2 f(x)\,dx - \mu^2 = \int_0^2 \frac{x^3}{2}\,dx - \frac{16}{9} = 2 - \frac{16}{9} = \frac{2}{9}$$

**Is it a pdf?** Check both rules: $f(x) \geq 0$ everywhere on the domain, and the total area is 1. A function that dips below the axis, such as $\sin x$ on $[0, 2\pi]$, cannot be a pdf.

**Finding $k$ for other functions.** For $f(x) = k\sin x$ on $[0, \pi]$: $\displaystyle\int_0^{\pi} k\sin x\,dx = 2k = 1$, so $k = \frac{1}{2}$. For $f(x) = ke^{-x}$ on $[0, 2]$: $k(1 - e^{-2}) = 1$.

**Mode.** The mode is where $f(x)$ is highest. Find it by setting $f'(x) = 0$ (or at an endpoint). For $f(x) = \frac{3}{4}x(2 - x)$, the peak is at $x = 1$.

**Quartiles.** The first quartile $q$ solves $F(q) = 0.25$ and the third solves $F(q) = 0.75$. Any percentile works the same way: 60% of cases are done by the $t$ with $F(t) = 0.6$.

**A tail probability.** For waiting times with $f(t) = \frac{1}{2}e^{-t/2}$, $P(T > 4) = \displaystyle\int_4^{\infty} \frac{1}{2}e^{-t/2}\,dt = e^{-2} \approx 0.135$.

**Using a given derivative.** Some means need a result like $\dfrac{d}{dx}(x\sin x + \cos x) = x\cos x$, which means $\displaystyle\int x\cos x\,dx = x\sin x + \cos x + C$.

## Quick summary

- Discrete data is counted. Continuous data is measured.
- For continuous data, probability is the area over an interval. Total area is 1.
- A PDF has $f(x) \geq 0$ and total area 1. $P(a \leq X \leq b) = \displaystyle\int_a^b f(x)\,dx$.
- $P(X = a) = 0$ for a continuous variable.
- $F(x) = P(X \leq x)$. The median solves $F(m) = 0.5$. $\mu = \displaystyle\int x f(x)\,dx$.

## Quiz

Try these questions from the chapter quiz.

1. Which of these is continuous data?
   - A. number of pets
   - B. time to run 100 m
   - C. shoe size on a label
   - D. goals in a match
   - Answer: B. time to run 100 m. Time is measured and can take any value in a range.

2. Which of these is discrete data?
   - A. number of cars in a car park
   - B. mass of an apple
   - C. height of a tree
   - D. temperature
   - Answer: A. number of cars in a car park. Cars are counted.

3. In a histogram of continuous data, the bars:
   - A. have gaps between them
   - B. touch each other
   - C. must all be the same height
   - D. are drawn sideways
   - Answer: B. touch each other. The classes run into each other.

The whole chapter quiz is on the page, for signed-in students: https://whizznotes.com/mathematics-advanced/continuous-random-variables/#quiz
