Chapter 2
Chapter 2
June 4, 2024
Introduction
A random variable X is a function that assigns a real number
X(ω) to each outcome ω in the sample space Ω of a random
experiment.
The sample space Ω is the domain of the random variable and
the set RX of all values taken on by X is the range of the random
variable.
Thus, RX is the subset of all real numbers.
A
X ( ) x
Re al Line
x B
June 4, 2024
Introduction Cont’d……
If X is a random variable, then {ω: X(ω)≤ x}={X≤ x} is an event
for every X in RX.
Example: Consider a random experiment of tossing a fair coin three
times. The sequence of heads and tails is noted and the sample
space Ω is given by:
{HHH , HHT , HTH , THH , THT , HTT , TTH , TTT}
June 4, 2024
The Cumulative Distribution Function
The cumulative distribution function (cdf) of a random variable
X is defined as the sum of probability of the event {X≤ x}.
FX ( x) P ( X x)
Properties of the cdf, FX(x):
The cdf has the following properties.
i. FX ( x) is a non - negative function, i.e.,
0 FX ( x) 1
ii. lim FX ( x) 1
x
iii. lim FX ( x) 0
x
June 4, 2024
The Cumulative Distribution Function Cont’d…..
v. P ( x1 X x2 ) FX ( x2 ) FX ( x1 )
vi. P ( X x) 1 FX ( x)
Example:
Find the cdf of the random variable X which is defined as the
number of heads in three tosses of a fair coin.
June 4, 2024
The Cumulative Distribution Function
Solution:
We know that X takes on only the values 0, 1, 2 and 3 with probabilities 1/8,
3/8, 3/8 and 1/8 respectively.
Thus, FX(x) is simply the sum of the probabilities of the outcomes from the
set {0, 1, 2, 3} that are less than or equal to x.
0, x 0
1 / 8, 0 x 1
FX ( x) 1 / 2, 1 x 2
7 / 8, 2 x 3
1, x3
June 4, 2024
Types of Random Variables
There are two basic types of random variables.
i. Continuous Random Variable
A continuous random variable is defined as a random variable
whose cdf, FX(x), is continuous every where and can be written as
an integral of some non-negative function f(x), i.e.,
FX ( x) f (u )du
June 4, 2024
The Probability Mass Function
The probability mass function (pmf) of a discrete random
variable X is defined as:
PX ( X xi ) PX ( xi ) FX ( xi ) FX ( xi 1 )
i. 0 PX ( xi ) 1, i 1, 2, .....
ii. PX ( x) 0, if x xi , i 1, 2, .....
iii. P i
X ( xi ) 1
June 4, 2024
Calculating the Cumulative Distribution Function
FX ( x) PX ( xi )U ( x xi )
xi x
June 4, 2024
Expected Value, Variance and Moments
i. Expected Value (Mean)
The expected value (mean) of a continuous random variable X,
denoted by μX or E(X), is defined as:
X E ( X ) xf X ( x)dx
June 4, 2024
Expected Value, Variance and Moments Cont’d…..
The variance of a discrete random variable X is given by:
2
X Var ( X ) ( xk X ) PX ( xk )
2
iii.Moments
The nth moment of a continuous random variable X is defined as:
E ( X ) x f X ( x)dx ,
n n
n 1
June 4, 2024
Expected Value, Variance and Moments Cont’d…..
E ( X ) xk PX ( xk ) ,
n
n 1
k
June 4, 2024
Some Special Distributions
where G ( x) e y / 2 dy
2
June 4, 2024
Some Special Distributions Cont’d……
The normal or Gaussian distribution is the most common continuous probability distribution.
f X (x )
x
Fig. Normal or Gaussian Distribution
June 4, 2024
Some Special Distributions Cont’d……
2. Uniform Distribution f X (x )
1
1 ba
, a xb x
f X ( x) b a a b
0, otherwise.
3. Exponential Distribution
Fig. Uniform Distribution
f X (x )
1
e x / , x 0,
f X ( x) x
0, otherwise. Fig. Exponential Distribution
June 4, 2024
Some Special Distributions Cont’d….
3. Poisson Distribution
k
P ( X k ) e , k 0,1,2, , .
k!
June 4, 2024
Random Variable Examples
Example-1:
The pdf of a continuous random variable is given by:
kx , 0 x 1
f X ( x)
0 , otherwise
where k is a constant.
a. Determine the value of k .
b. Find the corresponding cdf of X .
c. Find P(1 / 4 X 1)
d . Evaluate the mean and variance of X .
June 4, 2024
Random Variable Examples Cont’d……
Solution:
1
a.
f X ( x ) dx 1
0
kxdx 1
x2 1
k 1
2 0
k
1
2
k 2
2 x , 0 x 1
f X ( x)
0, otherwise
June 4, 2024
Random Variable Examples Cont’d……
Solution:
b. The cdf of X is given by :
x
FX ( x )
f X (u ) du
Case 1 : for x 0
FX ( x ) 0, since f X ( x ) 0, for x 0
Case 2 : for 0 x 1
x x x
FX ( x ) f X (u ) du 2udu u x2
2
0 0 0
June 4, 2024
Random Variable Examples Cont’d……
Solution:
Case 3 : for x 1
1 1 1
FX ( x ) f X (u ) du 2udu u 1
2
0 0 0
The cdf is given by
0, x0
2
FX ( x ) x , 0 x 1
1, x 1
June 4, 2024
Random Variable Examples Cont’d……
Solution:
c. P (1 / 4 X 1)
i. Using the pdf
1 1
P (1 / 4 X 1) f X ( x) dx 2 xdx
1/ 4 1/ 4
1
P (1 / 4 X 1) x 2
15 / 16
1/ 4
P (1 / 4 X 1) 15 / 16
ii. Using the cdf
P (1 / 4 X 1) FX (1) FX (1 / 4)
P (1 / 4 X 1) 1 (1 / 4) 2 15 / 16
P (1 / 4 X 1) 15 / 16
June 4, 2024
Random Variable Examples Cont’d……
Solution:
d. Mean and Variance
i. Mean
1 1
X E ( X ) xf X ( x)dx 2 x 2 dx
0 0
2 x3 1
X 2/3
3 0
ii. Variance
X 2 Var ( X ) E ( X 2 ) [ E ( X )]2
1 1
E ( X ) x f X ( x) dx 2 x 3 dx 1 / 2
2 2
0 0
X Var ( x) 1 / 2 ( 2 / 3) 2 1 / 18
2
June 4, 2024
Random Variable Examples Cont’d……..
Example-2:
Consider a discrete random variable X whose pmf is given by:
1 / 3 , xk 1, 0, 1
PX ( xk )
0 , otherwise
June 4, 2024
Random Variable Examples Cont’d……
Solution:
i. Mean
1
X E( X ) x
k 1
k PX ( xk ) 1 / 3(1 0 1) 0
ii. Variance
X 2 Var ( X ) E ( X 2 ) [ E ( X )]2
1
k X k
2
E( X )
2
x P ( x ) 1 / 3[( 1) 2
( 0) 2
(1) 2
] 2/3
k 1
X Var ( x) 2 / 3 (0) 2 2 / 3
2
June 4, 2024
Functions of a Random Variable
Let X be a continuous random variable with pdf fX(x) and suppose g(x) is a function of
the random variable X defined as:
Y g( X )
We can determine the cdf and pdf of Y in terms of that of X.
Consider some of the following functions.
aX b
sin X X2
1
Y g( X ) |X |
X
X
log X
eX | X | U ( x)
June 4, 2024
Functions of a Random Variable Cont’d…..
Steps to determine fY(y) from fX(x):
Method I:
1. Sketch the graph of Y=g(X) and determine the range space of Y.
2. Determine the cdf of Y using the following basic approach.
FY ( y ) P ( g ( X ) y ) P (Y y )
dFY ( y )
fY ( y )
dy
June 4, 2024
Functions of a Random Variable Cont’d…..
Method II:
1. Sketch the graph of Y=g(X) and determine the range space of Y.
2. If Y=g(X) is one to one function and has an inverse transformation x=g-1(y)=h(y), then the pdf of Y is given by:
3. Obtain Y=g(x) is not one-to-one function, then the pdf of Y can be obtained as follows.
i. Find the real roots of the function Y=g(x) and denote them by xi
dx dh( y )
fY ( y ) f X ( x) f X [h( y )]
dy dy
June 4, 2024
Functions of a Random Variable Cont’d…..
ii. Determine the derivative of function g(xi ) at every real root xi , i.e. ,
dxi
iii. Find the pdf of Y by using the following formula.
g ( xi )
dy
dxi
fY ( y ) f X ( xi ) g ( xi ) f X ( xi )
i dy i
June 4, 2024
Functions of Random Variables Examples
Examples:
1. Let Y aX b. Find fY ( y ).
2. Let Y X 2 . Find fY ( y ).
1
3. Let Y . Find fY ( y ).
X
4. The random variable X is uniform in the interval [ , ].
2 2
If Y tan X , determine the pdf of Y .
June 4, 2024
Assignment-II
where k is a constant.
Find :
a. the value of k .
b. the cdf of X .
c. P( X 1)
d . the mean and variance of X .
June 4, 2024
Assignment-II Cont’d…..
where k is a constant.
Determine :
a. the value of k .
b. the pdf of X .
c. the mean and variance of X .
June 4, 2024