4.1 Probability Density Functions (PDFS) and Cumulative Distribution Functions (CDFS) For Continuous Random Variables
4.1 Probability Density Functions (PDFS) and Cumulative Distribution Functions (CDFS) For Continuous Random Variables
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 = 1
−∞ 0 0 0
4.1.1 https://stats.libretexts.org/@go/page/3265
Figure 1: Graph of pdf for X, f (x)
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:
0.5 0.5
0 0
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:
a
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:
b
−∞
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
4.1.2 https://stats.libretexts.org/@go/page/3265
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 2 1.5
t ∣ t ∣
F (1.5) = ∫ f (t) dt = ∫ t dt + ∫ (2 − t) dt = ∣ + (2t − )∣ = 0.5 + (1.875 − 1.5) = 0.875
2 ∣0 2 ∣
1
−∞ 0 1
Now we find F (x) more generally, working over the intervals that f (x) has different formulas:
x
−∞
x
2 x 2
t ∣ x
for 0 ≤ x ≤ 1 : F (x) = ∫ t dt = ∣ =
2 ∣0 2
0
1 x
2 1 2 x 2 2
t ∣ t ∣ x x
for 1 < x ≤ 2 : F (x) = ∫ t dt + ∫ (2 − t) dt = ∣ + (2t − ) ∣ = 0.5 + (2x − ) − (2 − 0.5) = 2x − −1
2 ∣0 2 ∣
1 2 2
0 1
−∞
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.
4.1.3 https://stats.libretexts.org/@go/page/3265
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 specifying a
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 2:
1 .25 .25
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 –
π 4 − √2
.75
2 π.75 − − 1 = 0.75 ⇒ (using Quadratic Formula) Q3 = π.75 = ≈ 1.293
2 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.
4.1.4 https://stats.libretexts.org/@go/page/3265