4.1 - Probability Density Functions (PDFS) and Cumulative Distribution Functions (CDFS) For Continuous Random Variables - Statistics LibreTexts
4.1 - Probability Density Functions (PDFS) and Cumulative Distribution Functions (CDFS) For Continuous Random Variables - Statistics LibreTexts
Definition 4.1.1
The probability density function (pdf), denoted f , of a continuous random variable X satisfies the following:
1. f (x) ≥ 0 , for all x ∈ R
2. f is piecewise continuous
∞
3. ∫ f (x) dx = 1
−∞
a
4. P (a ≤ X ≤ b) = ∫ f (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.1
Let the random variable X 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 X (in minutes) are given by the interval [0, 2] .
A possible pdf for X is given by
⎧ x,
⎪
for 0 ≤ x ≤ 1
The graph of f is given below, and we verify that f satisfies the first three conditions in Definition 4.1.1:
1. From the graph, it is clear that f (x) ≥ 0 , for all x ∈ R .
2. Since there are no holes, jumps, asymptotes, we see that f (x) is (piecewise) continuous.
3. Finally we compute:
∞ 2 1 2
∫ f (x) dx = ∫ x dx = ∫ x dx + ∫ (2 − x) dx
−∞ 0 0 0
= 1
0.5 0.5
P (0 ≤ X ≤ 0.5) = ∫ f (x) dx = ∫ x dx
0 0
= 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) = ∫ f (x) dx = 0.
Informally, if we realize that probability for a continuous random variable is given by areas under pdf's, then,
since there is no area in a line, there is no probability assigned to a random variable taking on a single value. This
does not mean that a continuous random variable will never equal a single value, only that we do not assign any
probability to single values for the random variable. For this reason, we only talk about the probability of a
continuous random variable taking a value in an INTERVAL, not at a point. And whether or not the endpoints of the
interval are included does not affect the probability. In fact, the following probabilities are all equal:
P (a ≤ X ≤ b) = P (a < X < b)
dx
−∞
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) = ∫ f (t) dt
−∞
By the Fundamental Theorem of Calculus, the pdf can be found by differentiating the cdf:
d
f (x) = [F (x)]
dx
Example 4.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 X , x = 0.5 and x = 1.5 :
0.5 0.5
2 0.5
t ∣
F (0.5) = ∫ f (t) dt = ∫ t dt = ∣ = 0.125
2 ∣0
−∞ 0
1.5 1 1.5
2 1
t ∣
F (1.5) = ∫ f (t) dt = ∫ t dt + ∫ (2 − t) dt = ∣
2 ∣0
−∞ 0 1
2 1.5
t ∣
+ (2t − )∣ = 0.5 + (1.875 − 1.5)
2 ∣
1
= 0.875
Now we find F (x) more generally, working over the intervals that f (x) has different formulas:
x
x
x
2 x −∞ 2
t ∣ x
for 0 ≤ x ≤ 1 : F (x) = ∫ t dt = ∣ = x
2 ∣0 2
0
for 0 ≤ x ≤ 1 : F (x)
1 =x ∫ t dt =
2 1
t ∣
for 1 < x ≤ 2 : F (x) = ∫ t dt + ∫ (2 − t) dt = ∣
0 2 ∣0
0 1
1
2 x 2
t ∣ x
+ (2t − ) ∣ = 0.5 + (2x − )
2 ∣1 2
for 1 < x ≤ 2 : F (x) = ∫ t dt
2
x
− (2 − 0.5) = 2x − −1
0
2
x
2
t
for x > 2 : F (x) = ∫ f (t) dt = 1
+ (2t − )
−∞ 2
Putting this altogether, we write F as a piecewise function and Figure 2 gives its graph:
⎧ 0, for x < 0
⎪
⎪
⎪
⎪ x2
⎪ , for 0 ≤ x ≤ 1
2
F (x) = ⎨
2
x
⎪ 2x − − 1, for 1 < x ≤ 2
⎪
⎪ 2
⎪
⎩
⎪
1, for x > 2
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.2
The (100p)th percentile (0 ≤ p ≤ 1 ) of a probability distribution with cdf F is the value π such that p
F (πp ) = P (X ≤ πp ) = p.
To find the percentile π of a continuous random variable, which is a possible value of the random variable, we are
p
πp
∫ f (t)dt = p
−∞
Special Cases: There are a few values of p for which the corresponding percentile has a special name.
Median or 50 percentile: π = μ = Q , separates probability (area under pdf) into two equal halves
th
.5 2
1st Quartile or 25 percentile: π = Q , separates 1 quarter (25%) of probability (area) from the rest
th
.25 1
st
3rd Quartile or 75 percentile: π = Q , separates 3 quarter (75%) of probability (area) from the rest
th
.75 3
rd
Example 4.1.3
Continuing in the context of Example 4.1.2, we find the median and quartiles.
median: find π , such that F (π ) = 0.5 ⇒ π = 1 (from graph in Figure 1)
.5 .5 .5
1st quartile: find Q = π , such that F (π ) = 0.25 . For this, we use the formula and the graph of the cdf in Figure
1 .25 .25
2:
2
π
.25 −
−−
= 0.25 ⇒ Q1 = π.25 = √0.5 ≈ 0.707
2
3rd quartile: find Q 3 = π.75 , such that F (π .75 ) = 0.75 . Again, use the graph of the cdf:
2
π
.75
2π.75 − − 1 = 0.75
2
This page titled 4.1: Probability Density Functions (PDFs) and Cumulative Distribution Functions (CDFs) for Continuous Random
Variables is shared under a not declared license and was authored, remixed, and/or curated by Kristin Kuter.