Probability· Note 10

Continuous Random Variables

Year 2 · Semester ElulLast updated

Warning!

There be calculus within these pages. Yaarrrrghh!

Probability Density Function

Definition

If X is a continuous random variable, then X can assume any value within some interval (e.g. (1,4)(1,4), (−∞,π)(-\infty,\pi), etc) rather than a set of discrete values.
In this situation, PX(z)=0∣∀z∈RP_X(z)=0\mid\forall z\in\R, because an interval contains infinitely many points.
We can only speak of probabilities of X lying in some subinterval: P(a<X<b)P(a<X<b), P(X<b)P(X<b), P(X>a)P(X>a)

We use the probability density function of XX, denoted fXf_X, to calculate the probabilities of XX falling in any given interval.

How do we do this?

Example

Suppose X∈(1,6)X\in(1,6), and XX’s probability density function looks like this.
For the sake of example, let’s say we are looking for P(3<X<4)P(3<X<4). This value can be found by calculating the area under the graph in that given interval.

Applying principles from calculus, we know that the area is equal to ∫34fX(t)dt\int_3^4f_X(t)dt

Properties of Probability Density Functions
  1. fX≥0f_X≥0 always
  2. The total area under the graph of fXf_X is 1
    • ∫−∞∞fX(t)dt=1\int_{-\infty}^\infty f_X(t)dt=1

fXf_X has the property, for any a,b∈Ra,b\in\R:

P(a<X<b)=∫abfX(t)dtP(a<X<b)=\int_a^bf_X(t)dt
Is fXf_X a density function?

fX(x)={34(2x−x2)0<x<20otherwisef_X(x)=\begin{cases}\frac34(2x-x^2)&0<x<2\\0&otherwise\end{cases}

Is this a density function?

  1. fx≥0f_x≥0 always
  • Yes
  1. ∫−∞∞fx(t)dt=1\int_{-\infty}^\infty f_x(t)dt=1
  • ∫−∞∞fx(t)dt=∫0234(2x−x2)dx=34(x2−x33)∣02=34(4−83)=1\int_{-\infty}^\infty f_x(t)dt=\int_{0}^2 \frac34(2x-x^2)dx=\frac34(x^2-\frac{x^3}3)\Bigr|_0^2=\frac34(4-\frac83)=1
  • Yes

fXf_X is a density function.

Find P(1<X,23)P(1<X,\frac23)

Cumulative Distribution Function

Definition

The cumulative distribution function FXF_X (of a continuous random variable X) is defined as:

FX(a)=∫−∞af(t)dtF_X(a)=\int_{-\infty}^af(t)dt

This is the area under the graph up to aa.
By no coincidence, this is also P(X<a)P(X<a)

This function is useful because P(a<X<b)=FX(b)−FX(a)P(a<X<b)=F_X(b)-F_X(a).
It saves us from having to repeatedly calculate integrals at every step, by doing it once at the beginning.

Continuing from previous example

fX(x)={34(2x−x2)0<x<20otherwisef_X(x)=\begin{cases}\frac34(2x-x^2)&0<x<2\\0&otherwise\end{cases}
FX(x)={0x<0∫0x34(2t−t2)dt0<x<21x>2F_X(x)=\begin{cases}0&x<0\\\int_0^x\frac34(2t-t^2)dt&0<x<2\\1&x>2\end{cases}
That’s very nice and all, but we want to avoid repetitive integration, so we calculate it here:

∫0x34(2t−t2)dt=34(x2−x33)\int_0^x\frac34(2t-t^2)dt=\frac34(x^2-\frac{x^3}3)

Our final cumulative distribution function looks like this:

FX(x)={0x<034(x2−x33)0<x<21x>2F_X(x)=\begin{cases}0&x<0\\\frac34(x^2-\frac{x^3}3)&0<x<2\\1&x>2\end{cases}

So if we want to find P(1<X<23)P(1<X<\frac23), all we need to do is FX(23)−FX(1)F_X(\frac23)-F_X(1)

FX(23)−FX(1)=34(94−2729)−34(23)≈0.489F_X(\frac23)-F_X(1)=\frac34\left(\frac94-\frac{27}{29}\right)-\frac34\left(\frac23\right)\approx0.489

Properties of FX(x)F_X(x)

  1. FF is always increasing
  2. lim⁡x→∞F(x)=1\lim_{x\to\infty}F(x)=1
    • lim⁡x→−∞F(x)=0\lim_{x\to-\infty}F(x)=0
  • FF is always continuous, even if ff isn’t!

Expected Value of Continuous Random Variables

E[X]=∫−∞∞x⋅f(x)dxE[X]=\int_{-\infty}^\infty x\cdot f(x)dx

Properties of Expected Values

All the properties carry over from the Expected Value of discrete random variables.
E[g(X)]=∫−∞∞g(x)⋅f(x)dxE\left[g(X)\right]=\int_{-\infty}^\infty g(x)\cdot f(x)dx

Variance of Continuous Random Variables

Variance is defined the same way as for discrete random variables:

V(X)=E[X2]−μ2V(X)=E\left[X^2\right]-\mu^2

As with discrete random variables,

σ(X)=V(X)\sigma(X)=\sqrt{V(X)}

All properties of VV and σ\sigma carry also apply to continuous random variables.