Continuous Random Variables I: Foundations
The ideas from discrete random variables now move from sums to integrals. This session develops the common language used by every continuous model: support, cumulative distribution functions, probability density functions, interval probabilities, expectation, variance, and the law of the unconscious statistician.
A density is not itself a probability. Probabilities are areas obtained by integrating the PDF, while the CDF records the accumulated probability up to a point. The uniform distribution provides a simple running model in which interval probabilities are proportional to interval length.
Key Concepts¶
- Support and the distinction between density and probability
- CDFs, PDFs, and interval probabilities
- Normalising a proposed density
- Expectation, variance, and LOTUS via integrals
- The continuous uniform distribution
Learning Objectives
- Validate a PDF and derive a CDF.
- Recover a PDF from a differentiable CDF.
- Calculate interval probabilities using either a PDF or a CDF.
- Calculate expectation and variance using integrals.
- Use and interpret a continuous uniform model.
Session Preparation:¶
Attempt the core exercises from Session 2 and review basic integration from the prerequisites.
Syllabus and input
- Continuous random variables and distributions
- Probability density functions
- Expected value and variance
- Uniform distribution
Existing course material
Exercises¶
Exercise 1 - Reading a CDF¶
Let \(T\) be the time in hours to complete a job, with
- Find \(P(T\le1)\).
- Find \(P(T>2)\).
- Find \(P(1\le T\le3)\).
- Find the PDF of \(T\).
Answer
The probabilities are \(1/16\), \(3/4\), and \(1/2\). Differentiating the CDF gives \(f_T(t)=t/8\) for \(0<t<4\), and zero otherwise. Values assigned to the PDF at the endpoints do not affect any probability.
Exercise 2 - From PDF to CDF¶
Let
- Determine \(c\).
- Derive the CDF on the complete real line.
- Find \(P(-1/2<X<1/2)\), \(E[X]\), and \(\operatorname{Var}(X)\).
Answer
Normalisation gives \(c=5/2\). The CDF is
Symmetry gives \(E[X]=0\). Moreover, \(P(-1/2<X<1/2)=1/32\) and \(\operatorname{Var}(X)=E[X^2]=5/7\).
Exercise 3 - A uniform delivery-time model¶
Suppose a delivery time \(X\), measured in minutes, is uniformly distributed on \([10,22]\).
- Write the PDF and CDF of \(X\).
- Find \(P(X\le15)\), \(P(12\le X\le18)\), and \(P(X=15)\).
- Find \(E[X]\) and \(\operatorname{Var}(X)\).
Answer
The density is \(1/12\) on \([10,22]\), and the CDF is \(0\) below 10, \((x-10)/12\) on \([10,22]\), and \(1\) above 22. The probabilities are \(5/12\), \(1/2\), and \(0\). The mean is \(16\) and the variance is \((22-10)^2/12=12\).
Exercise 4 - Exam-time model¶
The time \(X\), in hours, needed to complete an exam has density
- Find \(q\) and the CDF.
- Find the probabilities of finishing before one hour, between one and two hours, and after two hours.
- Find \(E[X]\) and \(\operatorname{Var}(X)\).
Answer
Normalisation gives \(q=2/27\). For \(0\le x\le3\),
with \(F(x)=0\) below 0 and \(F(x)=1\) above 3. The three probabilities are \(5/81\), \(23/81\), and \(53/81\). Finally, \(E[X]=13/6\), \(E[X^2]=51/10\), and \(\operatorname{Var}(X)=73/180\).
Exercise 5 - A symmetric polynomial density¶
Let
- Find \(c\).
- Derive the CDF on the complete real line.
- Find \(P(X\le1/2)\) and \(P(X>-1/4)\).
- Find \(E[X]\) and \(\operatorname{Var}(X)\), using symmetry where possible.
Answer
Normalisation gives \(c=3/4\). For \(-1\le x\le1\),
with \(F(x)=0\) below \(-1\) and \(F(x)=1\) above \(1\). The probabilities are \(27/32\) and \(175/256\). Symmetry gives \(E[X]=0\), and integration gives \(\operatorname{Var}(X)=E[X^2]=1/5\).
Exercise 6 - Finite and infinite expectations¶
For each density, verify that it integrates to one and determine \(E[X]\):
- \(f_1(x)=\frac14xe^{-x/2}\), for \(x>0\);
- \(f_2(x)=5x^{-2}\), for \(x>5\).
Explain why a valid probability distribution need not have a finite mean.
Answer
Both densities integrate to one. The first density is Gamma with shape 2 and scale 2, so \(E[X]=4\). For the second,
A finite total probability therefore does not guarantee a finite first moment.