Post · 10 min read· pp. 264–270
Video Available

In this section, we will use the Dirac delta function to analyze mixed random variables. Technically speaking,
the Dirac delta function is not actually a function. It is what we may call a generalized function.
Nevertheless, its definition is intuitive and it simplifies dealing with probability distributions.
Remember that any random variable has a CDF. Thus, we can use the CDF to answer questions regarding discrete,
continuous, and mixed random variables. On the other hand, the PDF is defined only for continuous random
variables, while the PMF is defined only for discrete random variables. Using delta functions will allow
us to define the PDF for discrete and mixed random variables. Thus, it allows us to unify the theory of
discrete, continuous, and mixed random variables.
Dirac Delta Function
Remember, we cannot define the PDF for a discrete random variable because its CDF has jumps. If we could
somehow differentiate the CDF at jump points, we would be able to define the PDF for discrete random
variables as well. This is the idea behind our effort in this section. Here, we will introduce the
Dirac delta function and discuss its application to probability distributions. If you are less
interested in the derivations, you may directly jump to Definition 4.3 and continue from there.
Consider the unit step function u(x) defined by
\begin{equation}
\hspace{50pt}
u(x) = \left{
\begin{array}{l l}
1 & \quad x \geq 0 \
0 & \quad \text{otherwise}
\end{array} \right.
\hspace{50pt} (4.8)
\end{equation}
This function has a jump at x=0. Let us remove the jump and define, for any α>0, the function
uα as
\begin{equation}
\nonumber u_{\alpha}(x) = \left{
\begin{array}{l l}
1 & \quad x > \frac{\alpha}{2} \
\frac{1}{\alpha} (x+\frac{\alpha}{2}) & \quad -\frac{\alpha}{2} \leq x \leq \frac{\alpha}{2} \
0 & \quad x < -\frac{\alpha}{2}
\end{array} \right.
\end{equation}
The good thing about uα(x) is that it is a continuous function. Now let us define the
function δα(x) as the derivative of uα(x) wherever it exists.
\begin{equation}
\nonumber \delta_{\alpha}(x)=\frac{ d u_{\alpha}(x)}{dx} = \left{
\begin{array}{l l}
\frac{1}{\alpha} & \quad |x| < \frac{\alpha}{2} \
0 & \quad |x| > \frac{\alpha}{2}
\end{array} \right.
\end{equation}
Figure 4.10 shows these functions.

Fig.4.10 - Functions u(x),uα(x), and δα(x).
We notice the following relations:
δα(x)=dxduα(x),u(x)=a.e.α→0limuα(x)(4.9)
Now, we would like to define the
delta "function",
δ(x), as
δ(x)=α→0limδα(x)(4.10)
Note that as
α becomes smaller and smaller, the height of
δα(x) becomes larger
and larger and its width becomes smaller and smaller. Taking the limit, we obtain
\begin{equation}
\nonumber \delta(x) = \left{
\begin{array}{l l}
\infty & \quad x=0 \
0 & \quad \text{otherwise}
\end{array} \right.
\end{equation}
Combining Equations 4.9 and 4.10, we would like to symbolically write
δ(x)=dxdu(x).
Intuitively, when we are using the delta function, we have in mind
δα(x) with extremely small
α.
In particular, we would like to have the following definitions. Let
g:R↦R be
a continuous function. We define
∫−∞∞g(x)δ(x−x0)dx=α→0lim[∫−∞∞g(x)δα(x−x0)dx](4.11)
Then, we have the following lemma, which in fact is the most useful property of the delta function.
Lemma
Let g:R↦R be a continuous function. We have
∫−∞∞g(x)δ(x−x0)dx=g(x0).
Proof
Let I be the value of the above integral. Then, we have
| |
|---|
| I | =limα→0[∫−∞∞g(x)δα(x−x0)dx] |
| =limα→0[∫x0−2αx0+2ααg(x)dx]. |
By the mean value theorem in calculus, for any α>0, we have
∫x0−2αx0+2ααg(x)dx=ααg(xα)=g(xα),
for some
xα∈(x0−2α,x0+2α). Thus, we have
I=α→0limg(xα)=g(x0).
The last equality holds because
g(x) is a continuous function and
limα→0xα=x0.
For example, if we let g(x)=1 for all x∈R, we obtain
∫−∞∞δ(x)dx=1.
It is worth noting that the Dirac
δ function is not strictly speaking a valid function. The reason
is that there is no function that can satisfy both of the conditions
δ(x)=0( for x=0)and∫−∞∞δ(x)dx=1.
We can think of the delta function as a convenient notation for the integration condition 4.11. The delta function
can also be developed formally as a generalized function. Now, let us summarize properties of the delta function.
Definition : Properties of the delta function
We define the delta function δ(x) as an object with the following properties:
- $\delta(x) = \left{
\begin{array}{l l}
\infty & \quad x=0 \
0 & \quad \text{otherwise}
\end{array} \right.$
- δ(x)=dxdu(x), where u(x) is the unit step function (Equation 4.8);
- ∫−ϵϵδ(x)dx=1, for any ϵ>0;
- For any ϵ>0 and any function g(x) that is continuous over (x0−ϵ,x0+ϵ), we have
∫−∞∞g(x)δ(x−x0)dx=∫x0−ϵx0+ϵg(x)δ(x−x0)dx=g(x0).
Figure 4.11 shows how we represent the delta function. The delta function, δ(x), is shown by
an arrow at x=0. The height of the arrow is equal to $1$. If we want to represent $2\delta(x)$,
the height would be equal to $2$. In the figure, we also show the function δ(x−x0), which
is the shifted version of δ(x).

Fig.4.11 - Graphical representation of delta function.
Using the Delta Function in PDFs of Discrete and Mixed Random Variables
In this section, we will use the delta function to extend the definition of the PDF to discrete and
mixed random variables. Consider a discrete random variable X with range RX={x1,x2,x3,...}
and PMF PX(xk). Note that the CDF for X can be written as
FX(x)=xk∈RX∑PX(xk)u(x−xk).
Now that we have symbolically defined the derivative of the step function as the delta function,
we can write a PDF for
X by "differentiating" the CDF:
| |
|---|
| fX(x) | =dxdFX(x) |
| =∑xk∈RXPX(xk)dxdu(x−xk) |
| =∑xk∈RXPX(xk)δ(x−xk). |
We call this the generalized PDF.
For a discrete random variable X with range RX={x1,x2,x3,...} and PMF PX(xk), we define
the (generalized) probability density function (PDF) as
fX(x)=xk∈RX∑PX(xk)δ(x−xk).
Note that for any xk∈RX, the probability of X=xk is given by the coefficient of the
corresponding δ function, δ(x−xk).
It is useful to use the generalized PDF because all random variables have a generalized PDF, so we
can use the same formulas for discrete, continuous, and mixed random variables. If the (generalized)
PDF of a random variable can be written as the sum of delta functions, then X is a discrete random
variable. If the PDF does not include any delta functions, then X is a continuous random variable.
Finally, if the PDF has both delta functions and non-delta functions, then X is a mixed random variable.
Nevertheless, the formulas for probabilities, expectation and variance are the same for all kinds of
random variables.
To see how this works, we will consider the calculation of the expected value of a discrete random
variable. Remember that the expected value of a continuous random variable is given by
EX=∫−∞∞xfX(x)dx.
Now suppose that I have a discrete random variable
X. We can write
| | |
|---|
| EX | =∫−∞∞xfX(x)dx | |
| =∫−∞∞x∑xk∈RXPX(xk)δ(x−xk)dx | |
| =∑xk∈RXPX(xk)∫−∞∞xδ(x−xk)dx | |
| =∑xk∈RXxkPX(xk) | by the 4th property in Definition 4.3, |
which is the same as our original definition of expected value for discrete random variables. Let us
practice these concepts by looking at an example.
Example
Let X be a random variable with the following CDF:
\begin{equation}
\nonumber F_X(x) = \left{
\begin{array}{l l}
\frac{1}{2}+ \frac{1}{2}(1-e^{-x})& \quad x \geq 1\
\frac{1}{4}+ \frac{1}{2}(1-e^{-x})& \quad 0 \leq x < 1\
0 & \quad x < 0
\end{array} \right.
\end{equation}
- What kind of random variable is X (discrete, continuous, or mixed)?
- Find the (generalized) PDF of X.
- Find P(X>0.5), both using the CDF and using the PDF.
- Find EX and Var(X).
- Solution
Let us plot FX(x) to better understand the problem. Figure 4.12 shows FX(x). We
see that the CDF has two jumps, at x=0 and x=1. The CDF increases continuously from
x=0 to x=1 and also after x=1. Since the CDF is neither in the form of a staircase
function, nor is it continuous, we conclude that X is a mixed random variable.

Fig.4.11 - The CDF of X in Example 4.16.
To find the PDF, we need to differentiate the CDF. We must be careful about the points of
discontinuity. In particular, we have two jumps: one at x=0 and one at x=1. The size of
the jump for both points is equal to 41. Thus, the PDF has two delta functions:
41δ(x)+41δ(x−1). The continuous part of the CDF can be written
as 21(1−e−x), for x>0. Thus, we conclude
fX(x)=41δ(x)+41δ(x−1)+21e−xu(x).
Using the CDF, we have
| |
|---|
| P(X>0.5) | =1−FX(0.5) |
| =1−[41+21(1−e−x)] |
| =41+21e−0.5 |
| =0.5533 |
Using The PDF, we can write
| |
|---|
| P(X>0.5) | =∫0.5∞fX(x)dx |
| =∫0.5∞(41δ(x)+41δ(x−1)+21e−xu(x))dx |
| =0+41+21∫0.5∞e−xdx(using Property 3 in Definition 4.3) |
| =41+21e−0.5=0.5533 |
We have
| |
|---|
| EX | =∫−∞∞xfX(x)dx |
| =∫−∞∞(41xδ(x)+41xδ(x−1)+21xe−xu(x))dx |
| =41×0+41×1+21∫0∞xe−xdx(using Property 4 in Definition 4.3) |
| =41+21×1=43. |
Note that here $\int_{0}^{\infty} xe^{-x}dx $ is just the expected value of an Exponential(1)
random variable, which we know is equal to $1$.
| |
|---|
| EX2 | =∫−∞∞x2fX(x)dx |
| =∫−∞∞(41x2δ(x)+41x2δ(x−1)+21x2e−xu(x))dx |
| =41×0+41×1+21∫0∞x2e−xdx(using Property 4 in Definition 4.3) |
| =41+21×2=45. |
Again, note that $\int_{0}^{\infty} x^2e^{-x}dx $ is just EX2 for an Exponential(1) random
variable, which we know is equal to $2$. Thus,
| |
|---|
| Var(X) | =EX2−(EX)2 |
| =45−(43)2 |
| =1611. |
In general, we can make the following statement:
The (generalized) PDF of a mixed random variable can be written in the form
fX(x)=k∑akδ(x−xk)+g(x),
where
ak=P(X=xk), and
g(x)≥0 does not contain any delta functions. Furthermore, we have
∫−∞∞fX(x)dx=k∑ak+∫−∞∞g(x)dx=1.