Probability Density Functions
Probability Density Functions
Recall that continuous random variables have uncountably many possible values (think
of intervals of real numbers). Just as for discrete random variables, we can talk about
probabilities for continuous random variables using density functions.
Definition 4.1.14.1.1
4. P(a≤X≤b)=∫baf(x)dxP(a≤X≤b)=∫baf(x)dx
The first three conditions in the definition state the properties necessary for a function
to be a valid pdf for a continuous random variable. The fourth condition tells us how
to use a pdf to calculate probabilities for continuous random variables, which are given
by integrals the continuous analog to sums.
Example 4.1.14.1.1
Let the random variable XX denote the time a person waits for an elevator to arrive.
Suppose the longest one would need to wait for the elevator is 2 minutes, so that the
possible values of XX (in minutes) are given by the interval [0,2][0,2]. A possible pdf
for XX is given by
f(x)=⎧⎩⎨⎪⎪x,2−x,0,for 0≤x≤1for 1<x≤2otherwisef(x)={x,for 0≤x≤12−x,f
or 1<x≤20,otherwise
The graph of ff is given below, and we verify that ff satisfies the first three conditions
in Definition 4.1.1:
1. From the graph, it is clear that f(x)≥0f(x)≥0, for all x∈Rx∈R.
2. Since there are no holes, jumps, asymptotes, we see that f(x)f(x) is (piecewise)
continuous.
3. Finally we compute:
∫−∞∞f(x)dx=∫02xdx=∫01xdx+∫02(2−x)dx=1∫−∞∞f(x)dx=∫02xdx=∫01x
dx+∫02(2−x)dx=1
So, if we wish to calculate the probability that a person waits less than 30 seconds (or
0.5 minutes) for the elevator to arrive, then we calculate the following probability using
the pdf and the fourth property in Definition 4.1.1:
P(0≤X≤0.5)=∫00.5f(x)dx=∫00.5xdx=0.125P(0≤X≤0.5)=∫00.5f(x)dx=∫00.5xdx=
0.125
Note that, unlike discrete random variables, continuous random variables have zero
point probabilities, i.e., the probability that a continuous random variable equals a
single value is always given by 0. Formally, this follows from properties of integrals:
P(X=a)=P(a≤X≤a)=∫aaf(x)dx=0.P(X=a)=P(a≤X≤a)=∫aaf(x)dx=0.
P(a≤X≤b)=P(a<X<b)=P(a≤X<b)=P(a<X≤b)=∫abf(x)dxP(a≤X≤b)=P(a<X<
b)=P(a≤X<b)=P(a<X≤b)=∫abf(x)dx
F(x)=P(X≤x)=∫−∞xf(t)dt,for x∈R.F(x)=P(X≤x)=∫−∞xf(t)dt,for x∈R.
In other words, the cdf for a continuous random variable is found by integrating the
pdf. Note that the Fundamental Theorem of Calculus implies that the pdf of a
continuous random variable can be found by differentiating the cdf. This relationship
between the pdf and cdf for a continuous random variable is incredibly useful.
f(x)=ddx[F(x)]f(x)=ddx[F(x)]
Example 4.1.24.1.2
Continuing in the context of Example 4.1.1, we find the corresponding cdf. First, let's
find the cdf at two possible values of XX, x=0.5x=0.5 and x=1.5x=1.5:
F(0.5)F(1.5)=∫−∞0.5f(t)dt=∫00.5tdt=t22∣∣∣0.50=0.125=∫−∞1.5f(t)dt=∫01tdt+∫11.5
(2−t)dt=t22∣∣∣10+(2t−t22)∣∣∣1.51=0.5+(1.875−1.5)=0.875F(0.5)=∫−∞0.5f(t)dt
=∫00.5tdt=t22|00.5=0.125F(1.5)=∫−∞1.5f(t)dt=∫01tdt+∫11.5(2−t)dt=t22|
01+(2t−t22)|11.5=0.5+(1.875−1.5)=0.875
for x<0:F(x)for 0≤x≤1:F(x)for 1<x≤2:F(x)for x>2:F(x)=∫−∞x0dt=0=∫0xtdt=
t22∣∣∣x0=x22=∫01tdt+∫1x(2−t)dt=t22∣∣∣10+(2t−t22)∣∣∣x1=0.5+(2x−x22)−(2−
0.5)=2x−x22−1=∫−∞xf(t)dt=1for x<0:F(x)=∫−∞x0dt=0for 0≤x≤1:F(x)=∫0xtd
t=t22|0x=x22for 1<x≤2:F(x)=∫01tdt+∫1x(2−t)dt=t22|01+(2t−t22)|
1x=0.5+(2x−x22)−(2−0.5)=2x−x22−1for x>2:F(x)=∫−∞xf(t)dt=1
Putting this altogether, we write FF as a piecewise function and Figure 2 gives its
graph:
F(x)=⎧⎩⎨⎪⎪⎪⎪⎪⎪⎪⎪⎪⎪0,x22,2x−x22−1,1,for x<0for 0≤x≤1for 1<x≤
2for x>2F(x)={0,for x<0x22,for 0≤x≤12x−x22−1,for 1<x≤21,for x>2
Figure 2: Graph of cdf in Example 4.2.1
Recall that the graph of the cdf for a discrete random variable is always a step function.
Looking at Figure 2 above, we note that the cdf for a continuous random variable is
always a continuous function.
Percentiles of a Distribution
Definition 4.1.24.1.2
F(πp)=P(X≤πp)=p.F(πp)=P(X≤πp)=p.
Special Cases: There are a few values of pp for which the corresponding percentile
has a special name.
Example 4.1.34.1.3
Continuing in the context of Example 4.1.2, we find the median and quartiles.
π2.252=0.25⇒Q1=π.25=0.5−−
−√≈0.707π.2522=0.25⇒Q1=π.25=0.5≈0.707
1st quartile: find Q3=π.75Q3=π.75, such that F(π.75)=0.75F(π.75)=0.75.
Again, use the graph of the cdf: