Introduction to continuous random variables
In Year 12 Mathematical Methods (Queensland, QCAA), a continuous random variable \(X\) is described by a probability density function \(f(x)\). It must satisfy \(f(x)\ge 0\) everywhere and enclose total area \(1\). A probability is an area: \(P(a\le X\le b)=\int_a^b f(x)\,dx\). A single value has probability \(0\), and the simplest example is the continuous uniform distribution.
A continuous random variable \(X\) can take any value in an interval (a length, a time, a temperature), so we cannot list its outcomes. Instead its behaviour is captured by a probability density function \(f(x)\): a curve whose area gives probability.
For \(f(x)\) to be a valid density it must meet two conditions: \(f(x)\ge 0\) for all \(x\) (probabilities are never negative), and the total area under the graph is \(1\), i.e. \(\int_{-\infty}^{\infty} f(x)\,dx=1\). Often the density is given on a finite interval (the support) and is \(0\) elsewhere.
The probability that \(X\) lies between \(a\) and \(b\) is the area under \(f\) there, \(P(a\le X\le b)=\int_a^b f(x)\,dx\). Because a single point has zero width, \(P(X=c)=0\); so \(\le\) and \(<\) give the same probability. The continuous uniform distribution has a constant density \(f(x)=\dfrac{1}{b-a}\) on \([a,b]\).
Conditions for a probability density function:
A probability is an area under the density:
The complement (total area is \(1\)):
How to work with a continuous random variable
- Check it is a density. Confirm \(f(x)\ge 0\) on its support and that the total area is \(1\) (integrate over the support).
- Find an unknown \(k\). Set the total area to \(1\): \(\int f(x)\,dx=1\) over the support, then solve for \(k\).
- Read a probability as an area. \(P(a\le X\le b)=\int_a^b f(x)\,dx\). For \(P(X\le b)\) integrate from the left end of the support; a single value contributes nothing, so \(\le\) and \(<\) agree.
- Use the complement. \(P(X>a)=1-P(X\le a)\), which is often quicker than integrating the far tail.
Set the total area to \(1\).
| \(\displaystyle\int_0^2 k\,x\,dx\) | \(=\) | \(k\Big[\dfrac{x^2}{2}\Big]_0^2=2k\) |
| \(2k\) | \(=\) | \(1\) |
| \(k\) | \(=\) | \(\dfrac{1}{2}\) |
So \(f(x)=\dfrac{1}{2}x\) on \([0,2]\).
The probability is width \(\times\) constant height.
| \(P(3\le X\le 5)\) | \(=\) | \((5-3)\times\dfrac{1}{5}\) |
| \(=\) | \(\dfrac{2}{5}=0.4\) |
No integration needed for a uniform density.
Integrate the density from \(0\) to \(1\).
| \(P(X\le 1)\) | \(=\) | \(\displaystyle\int_0^1 \dfrac{3}{8}x^2\,dx\) |
| \(=\) | \(\dfrac{3}{8}\Big[\dfrac{x^3}{3}\Big]_0^1=\dfrac{1}{8}\) |
So \(P(X\le 1)=0.125\).
A single value has zero area; then use the complement.
| \(P(X=1)\) | \(=\) | \(\displaystyle\int_1^1 f(x)\,dx=0\) |
| \(P(X>1)\) | \(=\) | \(1-P(X\le 1)\) |
| \(=\) | \(1-0.125=0.875\) |
So \(P(X=1)=0\) and \(P(X>1)=0.875\).
Common pitfalls
Frequently asked questions
What conditions make f(x) a probability density function?
\(f(x)\ge 0\) for every \(x\), and the total area under \(y=f(x)\) is \(1\), i.e. \(\int_{-\infty}^{\infty} f(x)\,dx=1\).
How do you find an unknown constant k in a density?
Set the total area to \(1\): integrate \(f(x)\) over its support, put the result equal to \(1\), and solve for \(k\). E.g. \(f=kx\) on \([0,2]\) gives \(2k=1\), so \(k=\tfrac12\).
How do you find P(a ≤ X ≤ b)?
It is the area under the density between \(a\) and \(b\): \(P(a\le X\le b)=\int_a^b f(x)\,dx\).
Why is P(X = c) = 0?
A probability is an area; the interval from \(c\) to \(c\) has zero width, so \(\int_c^c f(x)\,dx=0\). Hence \(\le\) and \(<\) give the same probability.
How do you find P(X > a) quickly?
Use the complement: \(P(X>a)=1-P(X\le a)\), since the total area is \(1\).
What is the continuous uniform distribution?
A constant density \(f(x)=\dfrac{1}{b-a}\) on \([a,b]\). Its graph is a rectangle of area \(1\), so a probability is a width times the constant height.