Introduction VI – Continuous Random Variables

Welcome to the power of Continuous Random Variables

Discrete Random Variables were our entry into the real world of probability. They enabled us to model a random variable and to do our first real calculations. We learned how to summarise a distribution in just one number, the mean, and how we can improve our summary if we also include the variance or standard deviation. Nonetheless there is a huge problem with discrete random variables. They just allow us to have a discrete set of outcomes. What can we do if the set isn’t discrete? If the set isn’t discrete, like time, we use continuous random variables.

A continuous random variable can have a continuous number of outcomes. Time is continuous and therefore a random variable that models the early arrival of someone in minutes is also continuous.

Ranges like [0, 1], [a, b,], [0, $\infty$) or ($-\infty , \infty$) describe the range of values a continuous random variable can take.

Definition:

A random variable is continuous if it has a function f(x) such that for any c $\le$ d we have: $P(c \le X \le d) = \int _{ c }^{ d }{ f(x)dx }$

f(x) is here the probability density function (PDF) and is not to be confused with the probability mass function (PMF), as the PDF doesn’t give any probability. The probability of X is defined by the integral of the PDF and is therefore the probability that X is in the range of c, d if c $\le$ d.

Probability Density Function (PDF)

The PDF follows three basic rules:

1. f(x) is not the probability, it’s the density
2. 0 $\le$ f(x)
3. $\int _{ -\infty }^{ \infty }{ f(x)dx=1 }$ where $-\infty$ is the lower end of the defined range and $\infty$ is the upper end of the defined range.

Cumulative Distribution Function (CDF)

The  CDF is here the same as for discrete random variables.

$F(a)=P(X\le a)=\int_{ -\infty }^{ a }{ f(x)dx }$

A special case is that: $F\prime (X)=f(x)$

Expected Value

If X is a continuous random variable on range [a, b] and f(x) is PDF, the expected Value of X is then: $E(X)=\int_{ a }^{ b }{ xf(x)dx }$

We basically just replace the sum from discrete random variables with an integral.

The expected value for continuous random variables has the same properties as for discrete random variables.

Variance

The Variance is the same as for discrete random variables.

$Var(X)=E((X-\mu)^{ 2 })$

Manipulating Continuous Random Variables

We sometimes have to manipulate continuous random variables to get what we want. We do this by changing variables. The trick here is that f(x)dx gives the probability and not f(x).

Example: X ~ U(0,2); “X follows a uniform distribution on range [0,2]”; f(x)=$\frac { 1 }{ 2 }$;  $F_{ X }{ (x) }=\frac { x }{ 2 }$; $Y=X^{ 2 }$

$y=x^{ 2 }\Rightarrow x=sqrt{ y }$
$y=x^{ 2 }\Rightarrow dy=2xdx\Rightarrow dx=\frac{ dy }{ 2x }\Rightarrow dx=\frac{ dy }{ 2\sqrt { y } }$
$f_{ X }{ (x) }dx=\frac { dx }{ 2 }=\frac { dy }{ 4\sqrt { y } }=f_{Y}{ (y) }dy \Rightarrow f_{Y}{ (y) }=\frac{ 1 }{ 4 \sqrt { y } }$