0% found this document useful (0 votes)
13 views153 pages

Continuous Random Variables Explained

The document is a comprehensive module on Continuous Random Variables, covering key concepts such as Probability Density Function (PDF), Expected Value, Variance, and various special distributions including Uniform, Exponential, Normal, and Gamma distributions. It includes solved problems, practice questions, and discussions on mixed random variables. The content is aimed at providing a foundational understanding of continuous random variables and their properties.

Uploaded by

JANVI Patel
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views153 pages

Continuous Random Variables Explained

The document is a comprehensive module on Continuous Random Variables, covering key concepts such as Probability Density Function (PDF), Expected Value, Variance, and various special distributions including Uniform, Exponential, Normal, and Gamma distributions. It includes solved problems, practice questions, and discussions on mixed random variables. The content is aimed at providing a foundational understanding of continuous random variables and their properties.

Uploaded by

JANVI Patel
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Module-3

Continuous Random Variable

Naveen Kumar

Assistant Professor
SVNIT, Surat

October 11, 2025

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 1 / 155


Table of Contents
1 Introduction
2 Probability Density Function (PDF)
3 Expected Value and Variance
4 Variance
5 Functions of Continuous Random Variables
6 Solved Problems
7 Special Distribution
Uniform Distribution
Exponential Distribution
Normal (Gaussian Distribution)
Gamma Distribution
8 Practice Questions
9 Mixed Random Variable
Using the Delta Function
Problems on Mixed Random Variable
Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 2 / 155
Table of Contents
1 Introduction
2 Probability Density Function (PDF)
3 Expected Value and Variance
4 Variance
5 Functions of Continuous Random Variables
6 Solved Problems
7 Special Distribution
Uniform Distribution
Exponential Distribution
Normal (Gaussian Distribution)
Gamma Distribution
8 Practice Questions
9 Mixed Random Variable
Using the Delta Function
Problems on Mixed Random Variable
Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 3 / 155
Discrete vs Continuous Random Variables

Discrete Random Variables: Take countable values.


Continuous Random Variables: Have a range in the form of an
interval or union of intervals on the real line.
For any x ∈ R, P(X = x) = 0 for continuous random variables.
Continuous and discrete random variables are analogous:
Replace sums with integrals.
Replace PMFs with PDFs.
We will also discuss mixed random variables (combinations of discrete
and continuous).

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 4 / 155


Example Problem

Problem
I choose a real number uniformly at random in the interval [a, b], and call
it X . By uniformly at random, we mean all intervals in [a, b] that have the
same length must have the same probability.

Task: Find the cumulative distribution function (CDF) of X .

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 5 / 155


Solution

Step 1: Probability of an interval


Since P(X ∈ [a, b]) = 1, uniformity implies
x2 − x1
P(X ∈ [x1 , x2 ]) = , a ≤ x1 ≤ x2 ≤ b.
b−a

Step 2: CDF definition


By definition, FX (x) = P(X ≤ x), hence


0, x < a,


x − a
FX (x) = , a ≤ x ≤ b,

 b−a


1, x > b.

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 6 / 155


Solution (Cont’d)

For continuous random variables, it does not matter if we use “<” or “≤”, since

P(X < a) = P(X ≤ a),

as each individual point has probability zero.

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 7 / 155


CDF of Continuous Random Variables

Key Point:
The CDF of a continuous random variable is a continuous function
without jumps, as P(X = x) = 0 for all x.
Definition:
A random variable X with CDF FX (x) is continuous if FX (x) is a
continuous function for all x ∈ R.

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 8 / 155


Table of Contents
1 Introduction
2 Probability Density Function (PDF)
3 Expected Value and Variance
4 Variance
5 Functions of Continuous Random Variables
6 Solved Problems
7 Special Distribution
Uniform Distribution
Exponential Distribution
Normal (Gaussian Distribution)
Gamma Distribution
8 Practice Questions
9 Mixed Random Variable
Using the Delta Function
Problems on Mixed Random Variable
Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 9 / 155
Probability Density Function (PDF)

For continuous random variables, the PMF does not apply because
P(X = x) = 0 for all x ∈ R.
Instead, we define the probability density function (PDF) as the
density of probability per unit length.
Definition of PDF:
P(x < X ≤ x + ∆)
fX (x) = lim+ .
∆→0 ∆
Alternatively, using the CDF:

dFX (x)
fX (x) = = FX′ (x) (if FX (x) is differentiable).
dx
The PDF gives the probability density at point x.

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 10 / 155


PDF of Uniform Distribution

Consider a random variable X uniformly distributed over [a, b].


The CDF is: 
0,
 x <a
x−a
FX (x) = , a≤x ≤b
 b−a
1, x >b

The PDF is derived by differentiating the CDF:


(
1
, a<x <b
fX (x) = b−a
0, otherwise

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 11 / 155


PDF of Uniform Distribution

This is the PDF for the Uniform(a, b) distribution.

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 12 / 155


Properties of the PDF

The PDF is non-negative: fX (x) ≥ 0 for all x ∈ R.


The area under the PDF curve is 1:
Z ∞
fX (u)du = 1.
−∞

To find P(a < X ≤ b), integrate the PDF:


Z b
P(a < X ≤ b) = fX (u)du.
a

In general, for any set A, we have:


Z
P(X ∈ A) = fX (u)du.
A

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 13 / 155


Example: Finding the Constant c and the CDF

Given: A continuous random variable X with PDF:


(
ce −x , x ≥ 0
fX (x) =
0, otherwise

1 Find c
2 Find the CDF of X, FX (x)
3 Find P(1 < X < 3)

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 14 / 155


Solution: Finding the Constant c and the CDF
Find c
R∞
Using the property −∞ fX (u)du = 1, we compute:
Z ∞
∞
ce −u du = c −e −x 0 = c.

1=
0

Finding the CDF FX (x)


For x < 0, the CDF is FX (x) = 0.
For x ≥ 0, the CDF is given by:
Z x
FX (x) = e −u du = 1 − e −x .
0

Thus, the CDF is:


(
0, x <0
FX (x) = −x
1−e , x ≥0

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 15 / 155


Solution: Finding the Constant c and the CDF

Finding P(1 < X < 3)


Using the CDF:

P(1 < X < 3) = FX (3) − FX (1) = [1 − e −3 ] − [1 − e −1 ] = e −1 − e −3 .

Using the PDF:


Z 3 3
e −t dt = −e −t 1 = e −1 − e −3 .

P(1 < X < 3) =
1

Both methods give the same result.

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 16 / 155


Range of a Random Variable

The range of a random variable X is the set of possible values that X


can take.
If X is a continuous random variable, the range is defined as:

RX = {x | fX (x) > 0}

This is the set of real numbers x for which the PDF is greater than
zero.
Note: The set RX may not precisely capture all possible values of X ,
but the difference is practically insignificant.

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 17 / 155


Table of Contents
1 Introduction
2 Probability Density Function (PDF)
3 Expected Value and Variance
4 Variance
5 Functions of Continuous Random Variables
6 Solved Problems
7 Special Distribution
Uniform Distribution
Exponential Distribution
Normal (Gaussian Distribution)
Gamma Distribution
8 Practice Questions
9 Mixed Random Variable
Using the Delta Function
Problems on Mixed Random Variable
Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 18 / 155
Expected Value

The theory of continuous random variables is similar to that of


discrete random variables.
Summations → Integrals
PMFs → PDFs
Expected value of a discrete random variable:
X
E [X ] = xk PX (xk )
xk ∈RX

For a continuous random variable, replace sum with integral and PMF
with PDF: Z ∞
E [X ] = xfX (x) dx
−∞

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 19 / 155


Example 3

Find E[X] of Uniform(a, b)

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 20 / 155


Solution 3

(
1
fX (x) = b−a , a<x <b
0, otherwise

Expected value E [X ]:
Z ∞ Z b  
1 a+b
E [X ] = xfX (x) dx = x dx =
−∞ a b−a 2

Intuitive result: The mean is the midpoint of the interval [a, b].

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 21 / 155


Example 4

Find E[X] for


Let X have PDF:
(
2x, 0 ≤ x ≤ 1
fX (x) =
0, otherwise

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 22 / 155


Solution Example 4

Find E[X] for


Let X have PDF:
(
2x, 0 ≤ x ≤ 1
fX (x) =
0, otherwise

Expected value E [X ]:
Z 1
2
E [X ] = x · 2x dx =
0 3

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 23 / 155


Expected Value of a Function of a Continuous Random
Variable

Law of the unconscious statistician (LOTUS) for continuous random


variables: Z ∞
E [g (X )] = g (x)fX (x) dx
−∞
Expectation is linear:

E [aX + b] = aE [X ] + b

For any set of random variables X1 , X2 , . . . , Xn :

E [X1 + X2 + · · · + Xn ] = E [X1 ] + E [X2 ] + · · · + E [Xn ]

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 24 / 155


Example 5

Let X have PDF:


(
x + 12 , 0 ≤ x ≤ 1
fX (x) =
0, otherwise

Find E [X n ]

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 25 / 155


Solution Example 5

Let X have PDF:


(
x + 12 , 0 ≤ x ≤ 1
fX (x) =
0, otherwise

Using LOTUS:
Z 1  
n n 1 3n + 4
E [X ] = x x+ dx =
0 2 2(n + 1)(n + 2)

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 26 / 155


Table of Contents
1 Introduction
2 Probability Density Function (PDF)
3 Expected Value and Variance
4 Variance
5 Functions of Continuous Random Variables
6 Solved Problems
7 Special Distribution
Uniform Distribution
Exponential Distribution
Normal (Gaussian Distribution)
Gamma Distribution
8 Practice Questions
9 Mixed Random Variable
Using the Delta Function
Problems on Mixed Random Variable
Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 27 / 155
Variance Definition

Variance of a random variable X is defined as:

Var(X ) = E [(X − µX )2 ] = E [X 2 ] − (E [X ])2

For a continuous random variable, this becomes:


Z ∞ Z ∞
Var(X ) = (x − µX )2 fX (x) dx = x 2 fX (x) dx − µ2X
−∞ −∞

Remember that for a, b ∈ R, we always have:

Var(aX + b) = a2 Var(X )

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 28 / 155


Example Question

Let X be a continuous random variable with PDF:


(
3x −4 , x ≥ 1
fX (x) =
0, otherwise

Find the mean E [X ] and the variance Var(X ).

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 29 / 155


Example Solution

To find the mean E [X ]:


Z ∞ Z ∞  ∞
−4 3 3
E [X ] = xfX (x) dx = x · 3x dx = − x −2 =
−∞ 1 2 1 2

To find E [X 2 ]:
Z ∞ Z ∞ ∞
E [X 2 ] = x 2 fX (x) dx = x 2 · 3x −4 dx = −3x −1 1 = 3

−∞ 1

The variance:
 2
2 2 3 3
Var(X ) = E [X ] − (E [X ]) = 3 − =
2 4

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 30 / 155


Table of Contents
1 Introduction
2 Probability Density Function (PDF)
3 Expected Value and Variance
4 Variance
5 Functions of Continuous Random Variables
6 Solved Problems
7 Special Distribution
Uniform Distribution
Exponential Distribution
Normal (Gaussian Distribution)
Gamma Distribution
8 Practice Questions
9 Mixed Random Variable
Using the Delta Function
Problems on Mixed Random Variable
Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 31 / 155
Functions of Continuous Random Variables

If X is a continuous random variable and Y = g (X ) is a function of


X , then Y is also a random variable.
We can find the CDF and PDF of Y .
It is usually easier to start from the CDF and then derive the PDF by
differentiating the CDF.
Before differentiating, check that the CDF is continuous.
Note: A function of a continuous random variable may result in a
non-continuous random variable.

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 32 / 155


Example Question

Let X be a continuous random variable with PDF fX (x). Define


Y = g (X ) where g is a specified function.
Find the CDF and PDF of Y .
Example Solution
To find the CDF of Y , compute:

FY (y ) = P(Y ≤ y ) = P(g (X ) ≤ y )

Differentiate to find the PDF:


d
fY (y ) = FY (y )
dy

Ensure continuity of FY (y ) before differentiating.

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 33 / 155


Example-7

Let X be a Uniform(0,1) random variable, and let Y = e X .


Find:
The CDF of Y .
The PDF of Y .
E [Y ].

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 34 / 155


Example Solution: CDF of Y

Known CDF of X :

0
 for x < 0
FX (x) = x for 0 ≤ x ≤ 1

1 for x > 1

Range of Y : Since e x is increasing, RY = [1, e].


CDF of Y : 
0
 for y < 1
FY (y ) = ln y for 1 ≤ y < e

1 for y ≥ e

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 35 / 155


Example Solution: PDF of Y

The PDF of Y is obtained by differentiating the CDF:


(
1
′ for 1 ≤ y ≤ e
fY (y ) = FY (y ) = y
0 otherwise

Note: CDF is not technically differentiable at points 1 and e, but we


do not worry about this since this is a continuous random variable
and changing the PDF at a finite number of points does not change
probabilities.

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 36 / 155


Example Solution: Expected Value of Y

Using LOTUS:
Z 1 Z 1
X x
E [Y ] = E [e ] = e fX (x) dx = e x dx = e − 1.
0 0

Alternatively, using the PDF of Y :


Z e Z e
1
E [Y ] = yfY (y ) dy = y· dy = e − 1.
1 1 y

Either method yields the same result for E [Y ].

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 37 / 155


Example-8

Let X ∼ Uniform(−1, 1) and Y = X 2 .


Find the CDF and PDF of Y .

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 38 / 155


Example Solution: CDF of Y

First, note that the range of Y is RY = [0, 1].


We start with the CDF for y ∈ [0, 1]:
√ √
FY (y ) = P(Y ≤ y ) = P(X 2 ≤ y ) = P(− y ≤ X ≤ y ).

Since X ∼ Uniform(−1, 1):


√ √ √
y − (− y ) 2 y √
FY (y ) = = = y.
1 − (−1) 2

Thus, the CDF of Y is:



0
 for y < 0,

FY (y ) = y for 0 ≤ y ≤ 1,

1 for y > 1.

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 39 / 155


Example Solution: PDF of Y

The CDF is a continuous function, so we can find the PDF by


differentiating FY (y ):
(
1
d √ for 0 < y ≤ 1,
fY (y ) = FY (y ) = 2 y
dy 0 otherwise.

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 40 / 155


The Method of Transformations

We can find the distribution of a function of a continuous random


variable by starting with the CDF.
If Y = g (X ) and g satisfies certain properties, we can use the
method of transformations.
Properties of g :
g (x) is differentiable.
g (x) is a strictly increasing function (if x1 < x2 , then g (x1 ) < g (x2 )).

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 41 / 155


Finding the PDF of Y

Let X be a continuous random variable and Y = g (X ).


The PDF of Y can be found using:
( f (x )
X 1 dx1
g ′ (x1 ) = fX (x1 ). dy if g (x1 ) = y ,
fY (y ) =
0 if g (x) = y does not have a solution.

Since g is strictly increasing, its inverse g −1 is well defined. Here


x1 = g −1 (y ).

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 42 / 155


Differentiating to Find the PDF

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 43 / 155


Theorem for Strictly Monotonic Functions

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 44 / 155


Example-9

Let X be a continuous random variable with PDF:


(
4x 3 0 < x ≤ 1
fX (x) =
0 otherwise

1
Let Y = X. Find fY (y ).

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 45 / 155


Solution

First note that RY = [1, ∞).


1
The function g (x) = x is strictly decreasing and differentiable on
(0, 1].
Therefore, we can use the formula:
fX (x1 )
fY (y ) =
g ′ (x1 )

where x1 = g −1 (y ) = y1 .

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 46 / 155


Solution (Continued)

fX (x1 ) 4x13 4
fY (y ) = ′
= = 4x15 = 5 .
|g (x1 )| −1 y
x12

(
4
y5
, y ≥1
fY (y ) =
0, otherwise

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 47 / 155


Theorem 4.1 can be extended to a more general case:
If g is not monotonic, it can often be divided into a finite number of
monotonic differentiable functions.
Figure Partitioning a function into monotonic parts.

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 48 / 155


Theorem 4.2

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 49 / 155


Example

Let X be a continuous random variable with PDF:


1 x2
fX (x) = √ e − 2 , for all x ∈ R

Let Y = X 2 . Find fY (y ).

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 50 / 155


Solution

The function g (x) = x 2 is:


Strictly decreasing on (−∞, 0)
Strictly increasing on (0, ∞)
Differentiable on both intervals with g ′ (x) = 2x
The range of Y is (0, ∞).
For y ∈ (0, ∞), the solutions are:
√ √
x1 = y, x2 = − y

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 51 / 155


Solution (Cont’d)

We can find fY (y ) using:

fX (x1 ) fX (x2 )
fY (y ) = +
|g ′ (x1 )| |g ′ (x2 )|

This gives: √ √
fX ( y ) fX (− y )
fY (y ) = √ + √
2 y | − 2 y|
Substituting the PDF:
1 y 1 y 1 y
fY (y ) = √ e− 2 + √ e− 2 = √ e− 2 , for y ∈ (0, ∞).
2 2πy 2 2πy 2πy

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 52 / 155


Table of Contents
1 Introduction
2 Probability Density Function (PDF)
3 Expected Value and Variance
4 Variance
5 Functions of Continuous Random Variables
6 Solved Problems
7 Special Distribution
Uniform Distribution
Exponential Distribution
Normal (Gaussian Distribution)
Gamma Distribution
8 Practice Questions
9 Mixed Random Variable
Using the Delta Function
Problems on Mixed Random Variable
Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 53 / 155
Solved Problems: Continuous Random Variables

Problem 1:
Let X be a random variable with PDF given by
(
cx 2 |x| ≤ 1
fX (x) =
0 otherwise

Find the constant c. Find E [X ] and Var(X ). Find P(X ≥ 12 ).

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 54 / 155


Solution to Problem 1
To find c, we use
Z ∞ Z 1
2
1= fX (u) du = cu 2 du = c.
−∞ −1 3
3
Thus, c = 2.
To find E [X ],
Z 1 Z 1
3
E [X ] = ufX (u) du = u 3 du = 0.
−1 2 −1
For Var(X ),
Z 1
3
Var(X ) = E [X 2 ] − (E [X ])2 = E [X 2 ] = u 2 fX (u) du = .
−1 5
To find P(X ≥ 12 ),
Z 1
1 3 7
P(X ≥ ) = x 2 dx = .
2 2 1 16
2

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 55 / 155


Problem 2

Problem 2:
Let X be a continuous random variable with PDF given by
1
fX (x) = e −|x| , for all x ∈ R.
2
If Y = X 2 , find the CDF of Y .

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 56 / 155


Solution to Problem 2

For y ∈ [0, ∞),



y
√ √
Z
2 1 −|x|
FY (y ) = P(Y ≤ y ) = P(X ≤ y ) = P(− y ≤ X ≤ y ) = √
e dx.
− y 2

Thus, ( √
1 − e− y y ≥0
FY (y ) =
0 otherwise

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 57 / 155


Problem 3

Problem 3:
Let X be a continuous random variable with PDF given by
(
4x 3 0 < x ≤ 1
fX (x) =
0 otherwise

Find P(X ≤ 23 |X > 31 ).

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 58 / 155


Solution to Problem 3
We have
2 1 P( 31 < X ≤ 32 )
P(X ≤ |X > ) = .
3 3 P(X > 13 )
Calculating P( 13 < X ≤ 23 ):
Z 2
1 2 3 316
P( < X ≤ ) = 4x 3 dx = .
3 3 1 81
3

Calculating P(X > 31 ):


Z 1
1 1 3 56
P(X > ) = 1 − P(X ≤ ) = 1 − 4x 3 dx = .
3 3 0 81
Thus,
316
2 1 81 79
P(X ≤ |X > ) = 56
= .
3 3 81
14
Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 59 / 155
Problem 4

Problem 4:
Let X be a continuous random variable with PDF given by
(
x 2 (2x + 3/2) 0 < x ≤ 1
fX (x) =
0 otherwise

2
If Y = X + 3, find Var(Y ).

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 60 / 155


Solution to Problem 4
First, note that
2 1
Var(Y ) = Var( + 3) = 4Var( ).
X X
2
We need to find Var( X1 ) = E [ X1 ] − (E [ X1 ])2 .
Using LOTUS, we have
Z 1
1 3 17
E[ ] = x(2x + ) dx = ,
X 0 2 12
2 Z 1
1 3 5
E[ ] = (2x + ) dx = .
X 0 2 2
Thus,  2
2 2 5 17 71
Var(X ) = E [X ] − (E [X ]) = − = .
2 12 144
So, we obtain
284
Var(Y ) = 4Var(X ) = .
144
Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 61 / 155
Table of Contents
1 Introduction
2 Probability Density Function (PDF)
3 Expected Value and Variance
4 Variance
5 Functions of Continuous Random Variables
6 Solved Problems
7 Special Distribution
Uniform Distribution
Exponential Distribution
Normal (Gaussian Distribution)
Gamma Distribution
8 Practice Questions
9 Mixed Random Variable
Using the Delta Function
Problems on Mixed Random Variable
Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 62 / 155
Uniform Distribution

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 63 / 155


Uniform Distribution
X ∼ Uniform(a, b), PDF is given by
(
1
b−a
for a < x < b
fX (x) =
0 otherwise

The CDF is: 


0,
 x <a
x−a
FX (x) = , a≤x ≤b
 b−a
1, x >b

Expected value
a+b
E [X ] = .
2
To find the variance, we can calculate E [X 2 ] using LOTUS:
Z ∞ Z b 
1

a2 + ab + b 2
E [X 2 ] = x 2 fX (x) dx = x2 dx = .
−∞ a b−a 3

Therefore, the variance is given by

(b − a)2
Var(X ) = E [X 2 ] − (E [X ])2 = .
12

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 64 / 155


Exponential Distribution

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 65 / 155


Introduction to Exponential Distribution

Definition: A continuous random variable X is said to have an


exponential distribution with parameter λ > 0 if its PDF is given by:
(
λe −λx x > 0
fX (x) =
0 otherwise

It is commonly used to model the time elapsed between events.

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 66 / 155


PDF Representation

Using Unit Step Function:

fX (x) = λe −λx u(x)

where u(x) is the unit step function defined as:


(
1 x ≥0
u(x) =
0 otherwise

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 67 / 155


CDF of Exponential Distribution

Cumulative Distribution Function (CDF):


Z x Z x
FX (x) = fX (t)dt = λe −λt dt
0 0

Calculation:
h ix
FX (x) = −e −λt
0
−λx
=1−e

Final CDF:
FX (x) = (1 − e −λx )u(x)

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 68 / 155


Expected Value of Exponential Distribution

Finding the Expected Value:


Z ∞ Z ∞
E [X ] = xfX (x)dx = xλe −λx dx
0 0

Using Integration by Parts:


Z ∞
E [X ] = xλe −λx dx
0
1 ∞ −y
Z
= ye dy (let y = λx)
λ 0
1  −y ∞
= −e (y + 1) 0
λ
1
= .
λ

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 69 / 155


Variance of Exponential Distribution

Finding Variance:

Var (X ) = E [X 2 ] − (E [X ])2

Finding E [X 2 ]: Z ∞
E [X 2 ] = x 2 λe −λx dx
0
Using Integration by Parts Again:
2
E [X 2 ] =
λ2
Variance Calculation:
 2
2 2 2 1 1
Var (X ) = E [X ] − (E [X ]) = 2 − = 2.
λ λ λ

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 70 / 155


Properties of Exponential Distribution

Memoryless Property:

P(X > x + a|X > a) = P(X > x)

Intuitive Explanation: The future waiting time does not depend on


how long you have already waited.
Proof:
P(X > x + a|X > a)
P(X >x+a,X >a) P(X >x+a)
= P(X >a) = P(X >a)

1−FX (x+a) e −λ(x+a)


= 1−FX (a) = e −λa

= e −λx = P(X > x)

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 71 / 155


Practical Applications

Modeling: Often used to model the time between events in a Poisson


process (e.g., arrival times, decay of radioactive particles).

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 72 / 155


Gaussian Distribution

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 73 / 155


Introduction to Normal Distribution

The normal distribution is by far the most important probability


distribution.
One of the main reasons for that is the Central Limit Theorem (CLT),
which states that if you add a large number of random variables, the
distribution of the sum will be approximately normal under certain
conditions.
The CLT is one of the most important results in probability because
many random variables in real life can be expressed as the sum of a
large number of random variables, and the distribution of the sum
should be normal.

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 74 / 155


Standard Normal Distribution
A continuous random variable Z is said to be a standard normal (standard
Gaussian) random variable, denoted by Z ∼ N(0, 1), if its probability
density function (PDF) is given by:
 2
1 z
fZ (z) = √ exp − , for all z ∈ R.
2π 2

The term √1 ensures that the area under the PDF is equal to 1.

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 75 / 155


Mean and Variance of Standard Normal Distribution

Let us find the mean and variance of the standard normal distribution.
First, we will use a useful fact:

R ∞: R → R. If g (u) is an odd function, i.e.,


Consider a function g (u)
g (−u) = −g (u), and 0 g (u)du < ∞, then:
Z ∞
g (u)du = 0.
−∞

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 76 / 155


Odd Function for Calculation

For our purpose, let:

u2

2k+1
g (u) = u exp − , k = 0, 1, 2, . . .
2
R∞
R ∞ < ∞. This is because
Then g (u) is an odd function. Also, 0 g (u)du
g (u) decays faster
R∞ than exp(−u), and since 0 exp(−u)du < ∞, we
conclude that 0 g (u)du < ∞.

Now, let Z be a standard normal random variable. Then we have:


Z ∞  2
2k+1 1 2k+1 u
E [Z ]= √ u exp − du = 0,
2π −∞ 2

for all k ∈ {0, 1, 2, . . . }.

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 77 / 155


Mean and Variance Results

Thus, we have shown that for a standard normal random variable Z :

E [Z ] = E [Z 3 ] = E [Z 5 ] = · · · = 0.

In particular, the standard normal distribution has zero mean. This is not
surprising since the PDF is symmetric around the origin. Therefore,
E [Z ] = 0.

Next, let’s find E [Z 2 ].

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 78 / 155


Calculation of E [Z 2 ]

To calculate E [Z 2 ], we use integration by parts:


Z ∞  2
2 1 2 u
E [Z ] = √ u exp − du.
2π −∞ 2

After performing the integration by parts, we get:

E [Z 2 ] = 1.

Thus, for a standard normal random variable Z :

Var(Z ) = 1.

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 79 / 155


Summary

A standard normal random variable Z ∼ N(0, 1):


PDF  2
1 z
fZ (z) = √ exp − , for all z ∈ R.
2π 2
Expected Value and Variance

E [Z ] = 0 and Var(Z ) = 1.

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 80 / 155


CDF of the Standard Normal Distribution

To find the cumulative distribution function (CDF) of the standard normal


distribution, we need to integrate the PDF. Specifically, we have:
Z z  2
1 u
FZ (z) = √ exp − du.
2π −∞ 2

This integral does not have a closed-form solution. However, due to the
importance of the normal distribution, the values of FZ (z) have been
tabulated, and many calculators and software packages provide this
function.

We denote the CDF of the standard normal distribution by Φ(x).

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 81 / 155


Standard Normal CDF: Φ(x)

The CDF of the standard normal distribution, Φ(x), is given by:


Z x  2
1 u
Φ(x) = P(Z ≤ x) = √ exp − du.
2π −∞ 2

The Φ(x) function is widely used in probability, as the CDF of any normal
random variable can be written in terms of it.
Figure 4.7: The Φ(x) function (CDF of the standard normal distribution).

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 82 / 155


Properties of the Φ(x) Function

Here are some properties of the Φ(x) function, which can be shown from
its definition:
limx→∞ Φ(x) = 1
limx→−∞ Φ(x) = 0
1
Φ(0) = 2
Φ(−x) = 1 − Φ(x), for all x ∈ R

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 83 / 155


Using Φ(x) in Practice

Due to the importance of the normal distribution, the values of the Φ(x)
function have been tabulated, and many software packages provide this
function.

For example, in MATLAB, you can use the command normcdf(x) to


compute Φ(x) for a given number x. The function norminv returns
Φ−1 (x).

More specifically, running x = norminv(y) will give the real number x


such that Φ(x) = y .

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 84 / 155


Normal Random Variables

Now that we have introduced the standard normal random variable, we


can obtain any normal random variable by scaling and shifting the
standard normal variable. In particular, define:

X = σZ + µ, where σ > 0.

Then:
E [X ] = σE [Z ] + µ = µ,
Var(X ) = σ 2 Var(Z ) = σ 2 .
We say that X is a normal random variable with mean µ and variance σ 2 ,
and we write X ∼ N(µ, σ 2 ).

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 85 / 155


Relationship Between Standard and Normal Random
Variables

If Z is a standard normal random variable and X = σZ + µ, then X is a


normal random variable with mean µ and variance σ 2 , i.e., X ∼ N(µ, σ 2 ).

Conversely, if X ∼ N(µ, σ 2 ), then the random variable defined by:

X −µ
Z=
σ
is a standard normal random variable, i.e., Z ∼ N(0, 1).

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 86 / 155


CDF of a Normal Random Variable

To find the CDF of X ∼ N(µ, σ 2 ), we can express it as follows:

FX (x) = P(X ≤ x)

= P(σZ + µ ≤ x) where Z ∼ N(0, 1)


 
x −µ
=P Z ≤
σ
 
x −µ
=Φ .
σ

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 87 / 155


PDF of a Normal Random Variable

To find the PDF of X , we take the derivative of the CDF FX (x):

d
fX (x) = FX (x)
dx
 
d x −µ
= Φ
dx σ
 
1 x −µ
= Φ′ (by the chain rule)
σ σ
 
1 x −µ
= fZ
σ σ
(x − µ)2
 
1
= √ exp − .
σ 2π 2σ 2

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 88 / 155


Summary of PDF and CDF of Normal Distribution

If X is a normal random variable with mean µ and variance σ 2 , i.e.,


X ∼ N(µ, σ 2 ), then:

(x − µ)2
 
1
fX (x) = √ exp − ,
σ 2π 2σ 2
 
x −µ
FX (x) = P(X ≤ x) = Φ ,
σ
   
b−µ a−µ
P(a < X ≤ b) = Φ −Φ .
σ σ

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 89 / 155


Figure: PDF of the normal distribution for different values of µ and σ.

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 90 / 155


Example Problem

Let X ∼ N(−5, 4). We are tasked with solving the following:


1. Find P(X < 0). 2. Find P(−7 < X < −3). 3. Find
P(X > −3 | X > −5).

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 91 / 155


Solution

Given X ∼ N(−5, 4), we know that µ = −5 and σ = 4 = 2.

Step 1: Find P(X < 0):


 
0 − (−5)
P(X < 0) = FX (0) = Φ = Φ(2.5) ≈ 0.99.
2

Step 2: Find P(−7 < X < −3):

P(−7 < X < −3) = FX (−3) − FX (−7)


   
−3 − (−5) −7 − (−5)
=Φ −Φ
2 2
= Φ(1) − Φ(−1)
= 2Φ(1) − 1 (since Φ(−x) = 1 − Φ(x))
≈ 0.68.
Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 92 / 155
Solution Continued

Step 3: Find P(X > −3 | X > −5):

P(X > −3, X > −5) P(X > −3)


P(X > −3 | X > −5) = = .
P(X > −5) P(X > −5)
 
−3 − (−5)
P(X > −3) = 1 − Φ = 1 − Φ(1),
2
 
−5 − (−5)
P(X > −5) = 1 − Φ = 1 − Φ(0).
2
1 − Φ(1) 0.1587
P(X > −3 | X > −5) = ≈ ≈ 0.32.
1 − Φ(0) 0.5

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 93 / 155


Theorem: Linear Transformation of a Normal Random
Variable

An important property of the normal distribution is that a linear


transformation of a normal random variable is also normally distributed.

Theorem: If X ∼ N(µX , σX2 ) and Y = aX + b, where a, b ∈ R, then


Y ∼ N(µY , σY2 ), where:

µY = aµX + b, σY2 = a2 σX2 .

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 94 / 155


Proof of Theorem

We can write X as:

X = σX Z + µ X where Z ∼ N(0, 1).

Now, for Y = aX + b:

Y = aX + b = a(σX Z + µX ) + b

= (aσX )Z + (aµX + b).


Therefore, Y ∼ N(aµX + b, a2 σX2 ).

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 95 / 155


Gamma Distribution

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 96 / 155


Gamma Distribution Overview

The gamma distribution is widely used due to its relation to the


exponential and normal distributions. We will cover its basic properties,
including:
The gamma function Γ(x).
PDF of the gamma distribution.
Connection between the gamma and exponential distributions.
Examples and properties.

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 97 / 155


Gamma Function

The gamma function Γ(x) is an extension of the factorial function for real
(and complex) numbers.

Γ(n) = (n − 1)!, n ∈ {1, 2, 3, . . . }.


More generally, for any positive real number α, we define:
Z ∞
Γ(α) = x α−1 e −x dx, α > 0.
0

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 98 / 155


Properties of the Gamma Function

Some important properties of the gamma function are:


R∞
Γ(1) = 0 e −x dx = 1.
R∞
Γ(α) = λα 0 y α−1 e −λy dy , for α, λ > 0.
Using integration by parts: Γ(α + 1) = αΓ(α), α > 0.
For positive integers n, Γ(n) = (n − 1)!.
 √
Γ 21 = π.

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 99 / 155


Example 1

7

Find Γ 2 .

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 100 / 155
Example 1

Find Γ 72 .


Solution: Using the recursive property Γ(α + 1) = αΓ(α):


   
7 5 5
Γ = Γ
2 2 2
 
5 3 3
= × Γ
2 2 2
 
5 3 1 1
= × × Γ
2 2 2 2
5 3 1 √ 15 √
= × × × π= π.
2 2 2 8

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 101 / 155
Example 2

Evaluate the following integral:


Z ∞
I = x 6 e −5x dx.
0

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 102 / 155
Example 2

Evaluate the following integral:


Z ∞
I = x 6 e −5x dx.
0

Solution: Using Property 2 with α = 7 and λ = 5, we have:

I = Γ(7)/57 = 6!/57 ≈ 0.0092.

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 103 / 155
Gamma Distribution PDF

A continuous random variable X is said to have a gamma distribution with


parameters α > 0 and λ > 0, denoted by X ∼ Gamma(α, λ), if its PDF is:
( α α−1 −λx
λ x e
Γ(α) , x > 0,
fX (x) =
0, otherwise.

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 104 / 155
Special Case: Exponential Distribution

If α = 1, we obtain the exponential distribution:


(
λe −λx , x > 0,
fX (x) =
0, otherwise.

Thus, Gamma(1, λ) = Exponential(λ).

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 105 / 155
Sum of Exponentials

More generally, if you sum n independent Exponential(λ) random


variables, then you get a Gamma(n, λ) random variable.
We will prove this result later using the moment generating function.

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 106 / 155
Example 3

Using the properties of the gamma function, show that the gamma PDF
integrates to 1. That is, show that for α, λ > 0:
Z ∞ α α−1 −λx
λ x e
dx = 1.
0 Γ(α)

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 107 / 155
Example 3

Using the properties of the gamma function, show that the gamma PDF
integrates to 1. That is, show that for α, λ > 0:
Z ∞ α α−1 −λx
λ x e
dx = 1.
0 Γ(α)

Solution:
∞ ∞
λα x α−1 e −λx λα
Z Z
dx = x α−1 e −λx dx
0 Γ(α) Γ(α) 0

λα
= · Γ(α)/λα = 1.
Γ(α)

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 108 / 155
Mean and Variance of Gamma Distribution

For X ∼ Gamma(α, λ), the mean and variance are:


α α
E[X ] = , Var(X ) = .
λ λ2

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 109 / 155
Table of Contents
1 Introduction
2 Probability Density Function (PDF)
3 Expected Value and Variance
4 Variance
5 Functions of Continuous Random Variables
6 Solved Problems
7 Special Distribution
Uniform Distribution
Exponential Distribution
Normal (Gaussian Distribution)
Gamma Distribution
8 Practice Questions
9 Mixed Random Variable
Using the Delta Function
Problems on Mixed Random Variable
Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 110 / 155
Practice Questions

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 111 / 155
Problem: Poisson Distribution Leading to Exponential

Problem: Suppose the number of customers arriving at a store obeys a


Poisson distribution with an average of λ customers per unit time. That
is, if Y is the number of customers arriving in an interval of length t, then
Y ∼ Poisson(λt). Suppose that the store opens at time t = 0. Let X be
the arrival time of the first customer. Show that X ∼ Exponential(λ).

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 112 / 155
Problem-1

Problem: Suppose the number of customers arriving at a store obeys a


Poisson distribution with an average of λ customers per unit time. That
is, if Y is the number of customers arriving in an interval of length t, then
Y ∼ Poisson(λt). Suppose that the store opens at time t = 0. Let X be
the arrival time of the first customer. Show that X ∼ Exponential(λ).
Solution:
(λt)0
P(X > t) = P(No arrival in [0, t]) = e −λt = e −λt .
0!
Thus, the CDF of X for x > 0 is given by:

FX (x) = 1 − P(X > x) = 1 − e −λx ,

which is the CDF of Exponential(λ). By the same argument, the time


between the first and second customers also has Exponential(λ)
distribution.
Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 113 / 155
Problem-2

Problem: Let Y ∼ Geometric(p), where p = λ∆. Define X = Y ∆, where


λ, ∆ > 0. Prove that for any x ∈ (0, ∞), we have:

lim FX (x) = 1 − e −λx .


∆→0

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 114 / 155
Problem-2 Solution
Problem: Let Y ∼ Geometric(p), where p = λ∆. Define X = Y ∆, where
λ, ∆ > 0. Prove that for any x ∈ (0, ∞), we have:
lim FX (x) = 1 − e −λx .
∆→0
Solution: If Y ∼ Geometric(p) and q = 1 − p, then:
n
X
P(Y ≤ n) = pq k−1 = 1 − (1 − p)n .
k=1
For any y ∈ (0, ∞), we can write:
P(Y ≤ y ) = 1 − (1 − p)⌊y ⌋ .
Since X = Y ∆, we have:
x x
FX (x) = P(X ≤ x) = P(Y ≤ ) = 1 − (1 − p)⌊ ∆ ⌋ .

Taking the limit:
x
lim FX (x) = 1 − lim (1 − λ∆)⌊ ∆ ⌋ = 1 − e −λx .
∆→0 ∆→0
Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 115 / 155
Problem 3

Problem: Let U ∼ Uniform(0, 1) and X = − ln(1 − U). Show that


X ∼ Exponential(1).

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 116 / 155
Problem 3 Solution

Problem: Let U ∼ Uniform(0, 1) and X = − ln(1 − U). Show that


X ∼ Exponential(1).
Solution: Since RU = (0, 1), we have RX = (0, ∞). For x ∈ (0, ∞), we
calculate the CDF of X :
 
1 x
FX (x) = P(X ≤ x) = P(− ln(1 − U) ≤ x) = P ≤e .
1−U

Thus, we get:
FX (x) = P(U ≤ 1 − e −x ) = 1 − e −x ,
which is the CDF of Exponential(1).

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 117 / 155
Problem 4

Let X ∼ N(2, 4) and Y = 3 − 2X .


Find P(X > 1):
Find P(−2 < Y < 1):
Find P(X > 2|Y < 1):

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 118 / 155
Solution Problem 4
Let X ∼ N(2, 4) and Y = 3 − 2X .
Find P(X > 1):
 
1−2
P(X > 1) = 1 − Φ = 1 − Φ(−0.5) = Φ(0.5) = 0.6915.
2
Find P(−2 < Y < 1): Since Y = 3 − 2X , we have Y ∼ N(−1, 16).
Therefore:
   
1 − (−1) −2 − (−1)
P(−2 < Y < 1) = Φ −Φ
4 4
= Φ(0.5) − Φ(−0.25) = 0.29.
Find P(X > 2|Y < 1):
P(X > 2)
P(X > 2|Y < 1) = P(X > 2|X > 1) =
P(X > 1)
1 − Φ(0)
= ≈ 0.72.
1 − Φ(−0.5)
Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 119 / 155
Problem-5

Let X ∼ N(0, σ 2 ). Find E |X |.

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 120 / 155
Expected Value of |X | for X ∼ N(0, σ 2 )
We can write X = σZ , where Z ∼ N(0, 1). Thus,
E |X | = σE |Z |.
We have Z ∞
1 2 /2
E |Z | = √ |t|e −t dt
2π −∞
Z ∞
2 2 /2
=√ te −t dt (integral of an even function)
2π 0

2 ∞ −t 2 /2
r Z
= te dt
π 0
r h i∞ r 2
2 −t 2 /2
= −e = .
π 0 π
Thus, we conclude r
2
E |X | = σE |Z | = σ .
π
Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 121 / 155
Table of Contents
1 Introduction
2 Probability Density Function (PDF)
3 Expected Value and Variance
4 Variance
5 Functions of Continuous Random Variables
6 Solved Problems
7 Special Distribution
Uniform Distribution
Exponential Distribution
Normal (Gaussian Distribution)
Gamma Distribution
8 Practice Questions
9 Mixed Random Variable
Using the Delta Function
Problems on Mixed Random Variable
Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 122 / 155
Mixed Random Variables

Mixed random variables are neither purely discrete nor continuous.


They consist of both continuous and discrete parts.
We can use tools which we have seen earlier to analyze them.

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 123 / 155
Example 4.14

Let X be a continuous random variable with the PDF:


(
2x 0 ≤ x ≤ 1
fX (x) =
0 otherwise

Define Y = g (X ) as: (
1
X 0≤X ≤ 2
Y = 1
2 X > 12
We aim to find the CDF of Y .

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 124 / 155
Solution

First, note that RX = [0, 1] and RY = [0, 12 ].


For y < 0, FY (y ) = 0, and for y > 12 , FY (y ) = 1.
The probability of the discrete part P(Y = 21 ) is:
  Z 1
1 1 3
P Y = = P(X > ) = 2x dx =
2 2 1 4
2

Ry
For 0 ≤ y < 21 , FY (y ) = P(Y ≤ y ) = 0 2x dx = y 2 .

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 125 / 155
CDF of Y

The cumulative distribution function (CDF) of Y is:



1
 y ≥ 12
FY (y ) = y 2 0 ≤ y < 12

0 otherwise

The CDF has a jump at y = 12 .


The probability of the jump is 43 , corresponding to P(Y = 12 ).
The CDF is continuous elsewhere.

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 126 / 155
CDF of Y

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 127 / 155
CDF Components

The CDF of Y can be written as:

FY (y ) = C (y ) + D(y )

Continuous part: 
1
4
 y ≥ 12
C (y ) = y 2 1
0≤y < 2

0 y <0

Discrete part: (
3 1
4 y≥ 2
D(y ) = 1
0 y< 2

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 128 / 155
Expected Value of Y

The expected value E [Y ] can be found by differentiating the


continuous part:
(
dC (y ) 2y 0 ≤ y ≤ 21
c(y ) = =
dy 0 otherwise

Then calculate E [Y ]:
Z 1/2
1 1 1 3 11
E [Y ] = y (2y ) dy + · P(Y = ) = + =
0 2 2 12 8 24

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 129 / 155
Find These

1 3

P 4 ≤Y ≤ 8
P(Y ≥ 14 )

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 130 / 155
1 3

Example 1: P 4 ≤Y ≤ 8

We can write:
       
1 3 3 1 1
P ≤Y ≤ = FY − FY +P Y =
4 8 8 4 4

Since P(Y = 1/4) = 0, we get:


   2  2
1 3 3 1 9 1 5
P ≤Y ≤ = − = − =
4 8 8 4 64 16 64

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 131 / 155
Example 2: P(Y ≥ 14 )

We calculate:
   2
1 1 1 1 15
P(Y ≥ ) = 1 − FY =1− =1− =
4 4 4 16 16

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 132 / 155
Using the Delta Function

Dirac delta function is used to analyze mixed random variables. Dirac


delta function is not a true function, but a generalized function.
Any random variable has a CDF, which can answer questions about
discrete, continuous, and mixed random variables.
The PDF is defined only for continuous random variables, while the
PMF is defined only for discrete random variables.
Using delta functions allows us to define the PDF for discrete and
mixed random variables, unifying the theory.

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 133 / 155
Dirac Delta Function
Issue: The PDF cannot be defined for a discrete random variable since its CDF
has jumps. If we could differentiate the CDF at jump points, we would be able to
define the PDF for discrete random variables.
Solution: Introduce the Dirac delta function.
The unit step function u(x) is defined as:
(
1 x ≥0
u(x) =
0 otherwise
Consider the function uα (x) for α > 0:

1
 x > α2
uα (x) = α1 (x + α2 ) − α2 ≤ x ≤ α
2
x < − α2

0

The function δα (x) is defined as the derivative of uα (x) where it exists:


(
1
duα (x) |x| < α2
δα (x) = = α
dx 0 |x| > α2

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 134 / 155
Dirac Delta Function

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 135 / 155
Dirac Delta Function (Cont.)

We define the delta ”function” δ(x) as:

δ(x) = lim δα (x)


α→0

Properties of δ(x):
δ(x) = 0 for x ̸= 0.
R∞
−∞ δ(x) dx = 1.
Symbolically, we can write:

du(x)
δ(x) =
dx
where u(x) is the unit step function.

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 136 / 155
Lemma: Properties of the Dirac Delta Function

Let g : R → R be a continuous function. We have the following property:


Z ∞
g (x)δ(x − x0 ) dx = g (x0 )
−∞

Proof:
R∞
Let I = limα→0 − x0 ) dx
−∞ g (x)δα (x
R x0 + α
By the Mean Value Theorem, x0 − α2 g (x) α1 dx = g (xα ) for some
2
xα ∈ (x0 − α2 , x0 + α2 )
Thus, I = limα→0 g (xα ) = g (x0 )

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 137 / 155
Delta Function in PDFs of Discrete and Mixed Random
Variables

Consider a discrete random variable X with range RX = {x1 , x2 , x3 , . . . }


and PMF PX (xk ). The CDF for X is given by:
X
FX (x) = PX (xk )u(x − xk )
xk ∈RX

By differentiating the CDF, we define the generalized PDF:


X
fX (x) = PX (xk )δ(x − xk )
xk ∈RX

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 138 / 155
Applications of Generalized PDF

The generalized PDF unifies the theory for all types of random
variables (discrete, continuous, and mixed).
If the PDF is a sum of delta functions, X is a discrete random
variable.
If the PDF has no delta functions, X is continuous.
If the PDF contains both, X is a mixed random variable.

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 139 / 155
Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 140 / 155
Example: CDF and PDF of a Mixed Random Variable

Let X be a random variable with the following CDF:



1 1 −x
 2 + 2 (1 − e ) x ≥ 1

FX (x) = 14 + 21 (1 − e −x ) 0 ≤ x < 1

0 x <0

What kind of random variable is X (discrete, continuous, or


mixed)?
Find the (generalized) PDF of X .
Find P(X > 0.5) using both the CDF and the PDF.
Find E [X ] and Var(X ).

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 141 / 155
Solution: Identifying the Random Variable Type

Let us first plot FX (x) to better understand the problem.

From the CDF, we can observe the following:


The CDF has jumps at x = 0 and x = 1.
The CDF increases continuously from x = 0 to x = 1 and also after
x = 1.
The CDF is neither a staircase function nor fully continuous,
indicating that X is a mixed random variable.

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 142 / 155
Finding the Generalized PDF

To find the PDF, differentiate the CDF. Be cautious at points of


discontinuity, where the PDF will have delta functions.
The CDF has two jumps at x = 0 and x = 1.
The size of both jumps is 14 , leading to two delta functions in the
PDF: 14 δ(x) + 14 δ(x − 1).
The continuous part of the CDF is given by 12 (1 − e −x ) for x > 0, so
the continuous part of the PDF is 21 e −x u(x).
Thus, the generalized PDF is:
1 1 1
fX (x) = δ(x) + δ(x − 1) + e −x u(x).
4 4 2

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 143 / 155
Calculating P(X > 0.5)

Using the CDF:


 
1 1 −0.5 1 1
P(X > 0.5) = 1−FX (0.5) = 1− + (1 − e ) = + e −0.5 ≈ 0.5533.
4 2 4 2

Using the PDF:


Z ∞ Z ∞ 
1 1 1
P(X > 0.5) = fX (x) dx = δ(x) + δ(x − 1) + e −x u(x) dx.
0.5 0.5 4 4 2

The integrals over the delta functions contribute 0, and we get:

1 1 ∞ −x
Z
1 1
P(X > 0.5) = 0 + + e dx = + e −0.5 ≈ 0.5533.
4 2 0.5 4 2

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 144 / 155
Finding E [X ]

To calculate the expected value:


Z ∞ Z ∞ 
1 1 1
E [X ] = xfX (x) dx = xδ(x) + xδ(x − 1) + xe −x u(x) dx.
−∞ −∞ 4 4 2

The first term contributes 0.


1
The second term contributes 4 × 1 = 14 .
The third term is the expected value of an Exponential(1) random
variable, which is 1.
1 1
Therefore, E [X ] = 4 + 2 × 1 = 34 .

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 145 / 155
Finding Var(X )

First, calculate E [X 2 ]:
Z ∞ Z ∞  
1 2 1 2 1 2 −x
E [X 2 ] = x 2 fX (x) dx = x δ(x) + x δ(x − 1) + x e u(x) d
−∞ −∞ 4 4 2

The first term contributes 0.


1
The second term contributes 4 × 1 = 14 .
The third term is E [X 2 ] for an Exponential(1) random variable, which
is 2.
Therefore, E [X 2 ] = 41 + 1
2 × 2 = 54 .
Finally, the variance is:
 2
2 5 2 3 11
Var(X ) = E [X ] − (E [X ]) = − = .
4 4 16

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 146 / 155
Generalized PDF of a Mixed Random Variable

The generalized PDF of a mixed random variable can be written as:


X
fX (x) = ak δ(x − xk ) + g (x),
k

where ak = P(X = xk ) and g (x) ≥ 0 does not contain any delta


functions. Furthermore:
Z ∞ X Z ∞
fX (x) dx = ak + g (x) dx = 1.
−∞ k −∞

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 147 / 155
Problem 2

Let X be a random variable with CDF




 1 x ≥ 1,


FX (x) = 1 + x 0 ≤ x < 1,


 2 2
0 x < 0.

a) Determine the type of X (discrete, continuous, or mixed).


b) Find the PDF fX (x).
c) Compute E (e X ).
d) Compute P(X = 0 | X ≤ 0.5).

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 148 / 155
Solution: Part (a) - Identifying Random Variable Type

The CDF has a jump at x = 0 of size 0.5 (from 0 to 12 ).


It is continuous elsewhere, with a linear increase between 0 and 1.
Therefore, X is a mixed random variable:
1 1
FX (x) = u(x) + FY (x),
2 2
where Y ∼ Uniform(0, 1).
Interpretation: Toss a fair coin.
Heads ⇒ X = 0.
Tails ⇒ X ∼ Uniform(0, 1).

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 149 / 155
Solution: Part (b) - Finding the PDF

Differentiate the CDF:


1 1
fX (x) = δ(x) + fY (x),
2 2
where (
1, 0 < x < 1,
fY (x) =
0, otherwise.

1 1
fX (x) = δ(x) + 1(0,1) (x) .
2 2
This confirms that X has a point mass at 0 and a continuous uniform part
on (0, 1).

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 150 / 155
Solution: Part (c) - Expected Value of e X
Using LOTUS:
Z ∞ Z Z 1
X x 1 x 1
E (e ) = e fX (x) dx = e δ(x)dx + e x dx.
−∞ 2 2 0

First integral: Z
1 1 1
e x δ(x)dx = e 0 = .
2 2 2
Second integral: Z 1
1 1
e x dx = (e − 1).
2 0 2
Total:
1 1 1
E (e X ) = + (e − 1) = e.
2 2 2
e
E (e X ) = .
2
Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 151 / 155
Solution: Part (d) - Conditional Probability
We want
P(X = 0, X ≤ 0.5) P(X = 0)
P(X = 0 | X ≤ 0.5) = = .
P(X ≤ 0.5) P(X ≤ 0.5)

1
P(X = 0) = .
2
For the denominator:
Z 0.5 Z 0.5
1 1 1 1 3
P(X ≤ 0.5) = fX (x)dx = + 1 dx = + = .
−∞ 2 2 0 2 4 4
Therefore,
1
2 2
P(X = 0 | X ≤ 0.5) = 3
= .
4
3

2
P(X = 0 | X ≤ 0.5) = .
3
Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 152 / 155
Thanks

Naveen Kumar (SVNIT, Surat) MFCS October 11, 2025 153 / 155

You might also like