Post · 5 min read· pp. 217–220
Video Available 
To determine the distribution of a discrete random variable we can either provide its PMF or CDF. For
continuous random variables, the CDF is well-defined so we can provide the CDF. However, the PMF does
not work for continuous random variables, because for a continuous random variable P(X=x)=0 for all
x∈R. Instead, we can usually define the probability density function (PDF). The PDF is the
density of probability rather than the probability mass. The concept is very similar to mass density
in physics: its unit is probability per unit length. To get a feeling for PDF, consider a continuous
random variable X and define the function fX(x) as follows (wherever the limit exists):
fX(x)=Δ→0+limΔP(x<X≤x+Δ).
The function
fX(x) gives us the probability density at point
x. It is the limit of the probability
of the interval
(x,x+Δ] divided by the length of the interval as the length of the interval goes
to $0$. Remember that
P(x<X≤x+Δ)=FX(x+Δ)−FX(x).
So, we conclude that
| |
|---|
| fX(x)=Δ→0limΔFX(x+Δ)−FX(x) |
| =dxdFX(x)=FX′(x),if FX(x) is differentiable at x. |
Thus, we have the following definition for the PDF of continuous random variables:
Definition
Consider a continuous random variable X with an absolutely continuous CDF FX(x). The function fX(x) defined by
fX(x)=dxdFX(x)=FX′(x),if FX(x) is differentiable at x
is called the probability density function (PDF) of
X.
Let us find the PDF of the uniform random variable X discussed in
Example 4.1. This random
variable is said to have Uniform(a,b) distribution. The CDF of X is given in Equation 4.1. By taking the
derivative, we obtain
\begin{equation}
f_X(x) = \left{
\begin{array}{l l}
\frac{1}{b-a} & \quad a < x < b\
0 & \quad x < a \textrm{ or } x > b
\end{array} \right.
\end{equation}
Note that the CDF is not differentiable at points a and b. Nevertheless, as we will discuss later on,
this is not important. Figure 4.2 shows the PDF of X. As we see, the value of the PDF is constant in the
interval from a to b. That is why we say X is uniformly distributed over [a,b].

Fig.4.2 - PDF for a continuous random variable uniformly distributed over [a,b].
The uniform distribution is the simplest continuous random variable you can imagine. For other types
of continuous random variables the PDF is non-uniform. Note that for small values of δ we can write
P(x<X≤x+δ)≈fX(x)δ.
Thus, if
fX(x1)>fX(x2), we can say
P(x1<X≤x1+δ)>P(x2<X≤x2+δ), i.e., the value
of
X is more likely to be around
x1 than
x2. This is another way of interpreting the PDF.
Since the PDF is the derivative of the CDF, the CDF can be obtained from PDF by integration (assuming absolute continuity):
FX(x)=∫−∞xfX(u)du.
Also, we have
P(a<X≤b)=FX(b)−FX(a)=∫abfX(u)du.
In particular, if we integrate over the entire real line, we must get $1$, i.e.,
∫−∞∞fX(u)du=1.
That is, the area under the PDF curve must be equal to one. We can see that this holds for the uniform
distribution since the area under the curve in Figure 4.2 is one. Note that
fX(x) is density of
probability, so it must be larger than or equal to zero, but it can be larger than $1$. Let us
summarize the properties of the PDF.
Consider a continuous random variable X with PDF fX(x). We have
- fX(x)≥0 for all x∈R.
- ∫−∞∞fX(u)du=1.
- P(a<X≤b)=FX(b)−FX(a)=∫abfX(u)du.
- More generally, for a set A, P(X∈A)=∫AfX(u)du.
In the last item above, the set A must satisfy some mild conditions which are almost always satisfied
in practice. An example of set A could be a union of some disjoint intervals. For example, if
you want to find P(X∈[0,1]∪[3,4]), you can write
P(X∈[0,1]∪[3,4])=∫01fX(u)du+∫34fX(u)du.
Let us look at an example to practice the above concepts.
Example
Let X be a continuous random variable with the following PDF
\begin{equation}
\nonumber f_X(x) = \left{
\begin{array}{l l}
ce^{-x} & \quad x \geq 0\
0 & \quad \text{otherwise}
\end{array} \right.
\end{equation}
where c is a positive constant.
- Find c.
- Find the CDF of X, FX(x).
- Find P(1<X<3).
- Solution
To find c, we can use Property 2 above, in particular
| |
|---|
| $1$ | =∫−∞∞fX(u)du |
| =∫0∞ce−udu |
| =c[−e−x]0∞ |
| =c. |
Thus, we must have c=1.
To find the CDF of X, we use FX(x)=∫−∞xfX(u)du, so for x<0, we
obtain FX(x)=0. For x≥0, we have
FX(x)=∫0xe−udu=1−e−x.
Thus,
\begin{equation}
\nonumber F_X(x) = \left{
\begin{array}{l l}
1-e^{-x} & \quad x\geq 0\
0 & \quad \text{otherwise}
\end{array} \right.
\end{equation}
We can find P(1<X<3) using either the CDF or the PDF. If we use the CDF,
we have
P(1<X<3)=FX(3)−FX(1)=[1−e−3]−[1−e−1]=e−1−e−3.
Equivalently, we can use the PDF. We have
| |
|---|
| P(1<X<3) | =∫13fX(t)dt |
| =∫13e−tdt |
| =e−1−e−3. |
Range
The range of a random variable X is the set of possible values of the random variable. If X is a
continuous random variable, we can define the range of X as the set of real numbers x for which
the PDF is larger than zero, i.e,
RX={x∣fX(x)>0}.
The set
RX defined here might not exactly show all possible values of
X, but the difference is
practically unimportant.