« Back to Subchapter

Statistics bridge ยท Further Mathematics 9231

0.6 Continuous random variables

๐Ÿ“˜ Notes

Use area and integration to find probabilities, averages and percentiles for measurements.

6 sections3 worked examples4 practice questions

By the end of this lesson

  • Check and normalise a probability density function.
  • Calculate interval probabilities and percentiles.
  • Find the mean, variance and standard deviation by integration.
  • Handle a simple density with an infinite support.

Before you begin: Integrate powers of x using definite integrals.; Rearrange equations and work with exact fractions.; Recall expectation and variance for a discrete random variable..

1. Probability is an area

A continuous model describes a measurement that can take any value in an interval, such as time or length. Its probability density function, written $f(x)$, shows how probability is distributed. The support is the set of possible values in the model; the density is zero outside it.

Key formula

Conditions for a valid density

\[f(x)\geq 0,\qquad \int_{\text{whole support}}f(x)\,\mathrm{d}x=1\]

Check nonnegativity throughout the support as well as total area. Both conditions are necessary.

A density height is not a probability. For example, a rectangle of height $2$ and width $0.5$ has area $1$, so it can define a valid density. If $X$ is measured in seconds, its density has units of inverse seconds; multiplying height by width produces a dimensionless probability.

Key formula

Probability between two values

\[\operatorname{P}(a<X<b)=\int_a^b f(x)\,\mathrm{d}x\]

Integrate only where the interval meets the support. For a continuous variable, $\operatorname{P}(X=a)=0$, so including a single endpoint does not change the answer.

2. Find the constant before the probability

If a density contains an unknown constant, use total probability $1$ to find it. Then substitute the constant into the density before calculating other areas. Sketching the support first helps you choose sensible integration limits.

Worked example

A rising density

The density is $f(x)=kx$ for $0<x<2$ and zero elsewhere. Find $k$ and $\operatorname{P}(0.5<X<1.5)$.

  1. Set the area over the entire support equal to one.

    \[\int_0^2 kx\,\mathrm{d}x=k\left[\frac{x^2}{2}\right]_0^2=2k=1\]
  2. Hence $k=\frac12$. The resulting density is nonnegative throughout its support.

  3. Integrate this density over the requested interval.

    \[\operatorname{P}(0.5<X<1.5)=\left[\frac{x^2}{4}\right]_{0.5}^{1.5}=\frac{2.25-0.25}{4}=\frac12\]
Answer. The normalising constant is $k=\frac12$ and the probability is $0.5$.
Continuous density diagramContinuous density diagram
For $f(x)=x/2$ on $0<x<2$, the shaded area between $0.5$ and $1.5$ is $0.5$. The total triangular area is $1$.

3. Mean and variance of a continuous model

Expectation uses the same weighting idea as a discrete distribution, with integration replacing summation. The mean is the long-run average of observations from the model. First calculate the two moments below, and then subtract the square of the mean.

Key formula

Continuous moments

\[\operatorname{E}(X)=\int xf(x)\,\mathrm{d}x,\qquad \operatorname{E}(X^2)=\int x^2f(x)\,\mathrm{d}x\]

Both integrals are over the whole support, and the moments must exist.

Key formula

Variance and standard deviation

\[\operatorname{Var}(X)=\operatorname{E}(X^2)-[\operatorname{E}(X)]^2,\qquad \operatorname{SD}(X)=\sqrt{\operatorname{Var}(X)}\]

Variance has squared measurement units. Standard deviation has the same units as $X$.

Worked example

Moments of the rising density

For $f(x)=x/2$ on $0<x<2$, find the mean, variance and standard deviation.

  1. Multiply the density by x for the first moment.

    \[\operatorname{E}(X)=\int_0^2\frac{x^2}{2}\,\mathrm{d}x=\left[\frac{x^3}{6}\right]_0^2=\frac43\]
  2. Multiply the density by x squared for the second moment.

    \[\operatorname{E}(X^2)=\int_0^2\frac{x^3}{2}\,\mathrm{d}x=\left[\frac{x^4}{8}\right]_0^2=2\]
  3. Subtract using exact fractions.

    \[\operatorname{Var}(X)=2-\left(\frac43\right)^2=\frac29,\qquad \operatorname{SD}(X)=\frac{\sqrt2}{3}\]
Answer. Mean $=\frac43$, variance $=\frac29$ and standard deviation $\approx0.471$. The mean lies within the support and the variance is positive.

4. Medians and percentiles divide the area

The median $m$ has half the probability to its left. More generally, a percentile is a value below which a specified proportion of the distribution lies. These are statements about area, so the median need not be halfway between the support endpoints.

Key formula

Find a percentile

\[\int_{\text{lower support limit}}^{q}f(x)\,\mathrm{d}x=p\]

For a median use $p=0.5$; for the upper quartile use $p=0.75$. Select a solution within the support.

For $f(x)=x/2$ on $0<x<2$, the area to the left of $q$ is $q^2/4$. The median solves $m^2/4=1/2$, giving $m=\sqrt2$. The upper quartile solves $q^2/4=3/4$, giving $q=\sqrt3$. Both exceed $1$, which fits the greater density towards the right.

5. When the support continues indefinitely

An infinite integration limit means a limit of finite integrals. Replace infinity by a number $b$, integrate, and then let $b$ increase without bound. Total probability must converge to $1$. A valid density does not automatically have a finite mean or variance: those integrals need checking separately.

Worked example

An infinite tail

Let $f(x)=3/x^4$ for $x\geq1$ and zero elsewhere. Check the density and find $\operatorname{P}(X>2)$, the mean and the variance.

  1. The density is nonnegative for $x\geq1$. Its total area is

    \[\lim_{b\to\infty}\int_1^b3x^{-4}\,\mathrm{d}x=\lim_{b\to\infty}(1-b^{-3})=1\]
  2. For the tail probability, change the lower limit to two.

    \[\operatorname{P}(X>2)=\lim_{b\to\infty}\left(\frac18-b^{-3}\right)=\frac18\]
  3. Both moment integrals converge.

    \[\operatorname{E}(X)=\int_1^\infty3x^{-3}\,\mathrm{d}x=\frac32,\qquad \operatorname{E}(X^2)=\int_1^\infty3x^{-2}\,\mathrm{d}x=3\]
  4. Use the variance identity.

    \[\operatorname{Var}(X)=3-\left(\frac32\right)^2=\frac34\]
Answer. This is a valid density. Its tail probability is $\frac18$, mean $\frac32$ and variance $\frac34$.

6. A reliable calculation routine

  • Identify the support and set the density to zero elsewhere.
  • Normalise if necessary, then select the integral that matches the question.
  • Use exact fractions until the final numerical answer.
  • Check probabilities lie between zero and one, percentiles lie in the support, and variances are nonnegative.

Practice

Try each question before opening its worked solution.

Question 1

Let $f(x)=2x$ for $0<x<1$, zero elsewhere. Find (a) $\operatorname{P}(X>0.5)$ and (b) the median.

Show worked solution
  1. Integrate from the threshold to the upper support limit.

    \[\operatorname{P}(X>0.5)=\int_{0.5}^1 2x\,\mathrm{d}x=[x^2]_{0.5}^1=\frac34\]
  2. The median has area one half to its left.

    \[\int_0^m2x\,\mathrm{d}x=m^2=\frac12\]
Answer. (a) $\frac34$. (b) $m=1/\sqrt2\approx0.707$, taking the positive root within the support.

Question 2

A density is $f(x)=k(1+x)$ on $0<x<1$, zero elsewhere. Find $k$, the mean and the variance.

Show worked solution
  1. Normalise over the support.

    \[k\int_0^1(1+x)\,\mathrm{d}x=\frac{3k}{2}=1\quad\Rightarrow\quad k=\frac23\]
  2. Calculate both moments.

    \[\operatorname{E}(X)=\frac23\left(\frac12+\frac13\right)=\frac59,\qquad \operatorname{E}(X^2)=\frac23\left(\frac13+\frac14\right)=\frac7{18}\]
  3. Subtract the squared mean.

    \[\operatorname{Var}(X)=\frac7{18}-\frac{25}{81}=\frac{13}{162}\]
Answer. $k=\frac23$, mean $=\frac59$ and variance $=\frac{13}{162}$.

Question 3

A density equals $4$ on $1<x<1.25$ and zero elsewhere. Explain why it is valid, then find $\operatorname{P}(1.1<X<1.2)$ and the median.

Show worked solution
  1. The density is nonnegative and its total area is $4(1.25-1)=1$.

  2. The requested probability is the rectangle area $4(1.2-1.1)=0.4$.

  3. For the median, $4(m-1)=0.5$, so $m=1.125$.

Answer. The density is valid despite its height exceeding $1$. The probability is $0.4$ and the median is $1.125$.

Question 4

Let $f(x)=3x^2$ for $0<x<1$, zero elsewhere. Find the mean, variance and upper quartile.

Show worked solution
  1. Calculate the moments over the support.

    \[\operatorname{E}(X)=\int_0^1 3x^3\,\mathrm{d}x=\frac34,\qquad \operatorname{E}(X^2)=\int_0^1 3x^4\,\mathrm{d}x=\frac35\]
  2. Find the variance.

    \[\operatorname{Var}(X)=\frac35-\frac9{16}=\frac3{80}\]
  3. Set the area to the left of the upper quartile equal to 0.75.

    \[\int_0^q3x^2\,\mathrm{d}x=q^3=\frac34\]
Answer. Mean $=\frac34$, variance $=\frac3{80}$ and upper quartile $q=(3/4)^{1/3}\approx0.909$.
Ready to move on?
Next lesson0.7 Normal distribution

Apply the same area interpretation to an important continuous model, then use standardisation to calculate its probabilities.