CHAPTER 03-Random Variable
CHAPTER 03-Random Variable
2020 1
2020 2
2020 3
2020 4
For discrete random variable
2020 5
2020 6
X
2020 7
X
2020 8
2020 9
Continuous Random Variable Distributions
For a continuous random variable X we have a function f, called the probability density
function (pdf). Every probability density function must satisfy
X X
2020 10
X
2020 11
2020 12
2020 13
2020 14
Discrete Random variable Example
Example: An urn contains 7 balls, numbered from 1 to 7. Two balls are selected
randomly from the urn. Let Random variable X be the difference of the numbers (that
is, the largest number minus the smallest number) of the selected balls. Find the
probability distribution or PMF of X, CDF and its mean, variance and standard
deviation.
2020 15
Step II: find random variable X (difference of highest to lowest value)
Step III. Find PMF (or probability distribution for discrete random variable)
2020 16
Mean value or Expected of discrete random variable X
2020 17
2020 18
Continuous
2020 19
2020 20
2020 21
2020 22
2020 23
2020 24
• A Gaussian random variable is one whose probability density function can be
written in the general form
11/21/2021 25
Special Distribution:
Continuous Probability Distributions
UNIFORM DISTRIBUTION
PDF CDF
2020 26
EXPONENTIAL DISTRIBUTION
PDF CDF
Applications: To model navigation and pilot errors, speech, and image processing.
Cauchy Distribution
Application: A Cauchy distribution is a good indicator of how sensitive the tests are to heavy-
tail departures from normality.
2020 28
2020 29
Two Random Variables
In many applications, it is very important to study two or more
random variable defined on the same sample space.
In this lecture, we will consider only two random variables and
this concept can be extended to three or more random variables.
Let Ω be the sample space of a random experiment and let X and
Y be two random variables.
Then, the pair (X, Y) is called a two dimensional random variable
if each of X and Y associates a real number with every element of
Ω.
Thus, a two dimensional random variable (X, Y) is a function that
assigns a point (x, y) in the xy-plane to each possible outcome ω
in the sample space.
2020 30
Example: 1
Consider the experiment of tossing a coin twice. The sample space is
Let X denotes the number of heads obtained in the first toss and Y denote the number of
heads in the second toss. Then
The range space of RXY is {(1,1), (1,0), (0,1), (0,0)} which is finite and so (X, Y) is a two-
dimensional discrete random variables.
31
Example 2
Consider an experiment of tossing a fair coin twice. Let (X, Y) be a bivariate r.v.,
where X is the number of heads that occurs in the two tosses and Y is the
number of tails that occurs in the two tosses.
(a) What is the range Rx of X, Ry of Y?
(b) Find and sketch the range Rxy of (X, Y).
(c) Find P(X = 2, Y = 0), P(X = 0, Y = 2), and P(X = 1, Y = 1).
The sample space S of the experiment is S = {HH, HT, TH, TT)
(a) Rx, = (0, 1,2) , RY, = (0, 1,2)
(b) RXY = ((2, O), (1, I), (0, 2)) which is sketched in Fig. 3-2.
(c) Since the coin is fair, we have
P(X = 2, Y = 0) = P(HH} = 1/4
P(X = 0, Y = 2) = P{TT) = 1/4
P(X= 1, Y = 1)= P{HT, TH} = 1/2
32
The Joint Cumulative Distribution Function
The joint CDF of two random variables X and Y denoted by
FXY(x, y) is a function defined by:
FXY ( x, y ) P[ X ( ) x and Y ( ) y ]
FXY ( x, y ) P( X x, Y y )
where x and y are arbitrary real numbers.
Properties of the Joint CDF, FXY(x, y):
i. 0 FXY ( x, y ) 1
ii. lim FXY ( x, y ) FXY (, ) 1
x
y
vii. P ( x1 X x2 , y1 Y y2 ) FXY ( x2 , y2 )
34
The Joint Probability Density Function
2 FXY ( x, y )
f XY ( x, y )
xy
FXY ( x, y )
y x
f XY ( x, y )dxdy
- -
35
The Joint Probability Density Function Cont’d…..
1. f XY ( x, y ) 0
2.
- -
f XY ( x, y )dxdy 1
y2 x2
3. P( x1 X x2 , y1 Y y2 ) f XY ( x, y )dxdy
y1 x1
36
The Joint Probability Mass Function
FXY ( x, y ) PXY ( xi , y j )
xi x y j y
37
Condition Distributions
i. Conditional Probability Density Functions
If X and Y are two continuous random variables with joint
pdf fXY(x, y), then the conditional pdf of Y given that X=x is
defined by:
f XY ( x, y )
fY / X ( y / x) , f X ( x) 0
f X ( x)
Similarly, the conditional pdf of X given that Y=y is defined
by:
f XY ( x, y )
f X / Y ( x / y) , fY ( y ) 0
fY ( y )
38
Condition Distributions Cont’d……
ii. Conditional Probability Mass Functions
If X and Y are two discrete random variables with joint pmf
PXY(xi , yj), then the conditional pmf of X given that Y=yj is
defined by:
PXY ( xi , y j )
PX / Y ( xi / y j ) , PY ( y j ) 0
PY ( y j )
Similarly, the conditional pmf of Y given that X=xi is
defined by:
PXY ( xi , y j )
PY / X ( y j / xi ) , PX ( xi ) 0
PX ( xi )
39
Marginal Statistics of Two Random Variables
40
Marginal Statistics of Two Random Variables Cont’d…..
P( X xi ) PX ( xi ) PXY ( xi , yi )
yj
P(Y y j ) PY ( y j ) PXY ( xi , yi )
xi
41
Independence of Two Random Variables
If two random variables X and Y are independent, then
i. from the joint cdf
FXY ( x, y ) FX ( x) FY ( y )
f XY ( x, y ) f X ( x) fY ( y )
PXY ( xi , y j ) PX ( xi ) PY ( y j )
42
Examples on Two Random Variables
Example-1:
The joint pdf of two continuous random variables X and Y is
given by:
kxy , 0 x 1, 0 y 1
f XY ( x, y )
0 , otherwise
where k is a constant.
a. Find the value of k .
b. Find the marginal pdf of X and Y .
c. Are X and Y independent?
d. Find P( X Y 1)
e. Find the conditiona l pdf of X and Y .
43
Examples on Two Random Variables Cont’d……
Solution:
1 1
a.
-
f XY ( x, y )dxdy 1
0 0 kxydxdy 1
1 x2 1
k y 1
0
2 0
k 1 y 2 1 k
ydy k 1
2 0 4 0 4
k 4
44
Examples on Two Random Variables Cont’d……
Solution:
y2
1
f X ( x) 4 x 2 x
2 0
2 x , 0 x 1
f X ( x)
0, otherwise
45
Examples on Two Random Variables Cont’d……
Solution:
x2 1
fY ( y ) 4 y 2 y
2 0
2 y , 0 y 1
fY ( y )
0, otherwise
46
Examples on Two Random Variables Cont’d……
Solution:
c. f XY ( x, y ) f X ( x) fY ( y )
X and Y are independent
1 1 y 1 x2 1
d . P( X Y 1) 4 xydxdy 4 y dy
0 0 0
2 0
4 y[1 / 2(1 y ) ]dy 2( y 2 y 2 y 3 )dy
1 1
2
0 0
2( y / 2 2 y / 3 y / 4) 1 / 6
2 3 4
P( X Y 1) 1 / 6
47
Examples on Two Random Variables Cont’d……
Solution:
2 y, 0 x 1, 0 y 1
fY / X ( y / x)
0, otherwise
48
Examples on Two Random Variables Cont’d……
Example-2:
The joint pdf of two continuous random variables X and Y is
given by:
0<y<1,
k , 0 y x 1
f X ( x) y<x<1
0, otherwise
where k is a constant.
a. Determine the value of k .
b. Find the marginal pdf of X and Y .
c. Are X and Y independent?
d. Find P(0 X 1 / 2)
e. Find the conditiona l pdf of X and Y .
49
Examples on Two Random Variables Cont’d……
Solution:
f XY ( x, y )dxdy 1 kdxdy 1
1 1
a.
- 0 y
1
k x 1
1
0 y
y 2 1 k
k (1 y )dy k y 1
1
0
2 0 2
k 2
50
Examples on Two Random Variables Cont’d……
Solution:
x
f X ( x) 2 y 2 x
0
2 x , 0 x 1
f X ( x)
0, otherwise
51
Examples on Two Random Variables Cont’d……
Solution:
1
fY ( y ) 2 x 2(1 y )
y
2(1 y ), 0 y 1
fY ( y )
0, otherwise
52
Examples on Two Random Variables Cont’d……
Solution:
c. f XY ( x, y ) f X ( x) fY ( y )
X and Y are not independent
d . P(0 X 1 / 2)
1/ 2 x
f XY ( x, y )dydx
0 0
1/ 2 x 1/ 2 x
2dydx (2 y ) dx
0 0 0 0
1/ 2 1/ 2
2 xdx x 1/ 4 2
0 0
P(0 X 1 / 2) 1 / 4
53
Examples on Two Random Variables Cont’d……
Solution:
54
Examples on Two Random Variables Cont’d……
Solution:
55
Examples on Two Random Variables Cont’d……
Example-3:
The joint pmf of two discrete random variables X and Y is given
by:
k (2 xi y j ) , xi 1, 2; y 1, 2
PXY ( xi , y j )
0 , otherwise
where k is a constant.
a. Find the value of k .
b. Find the marginal pmf of X and Y .
c. Are X and Y independen t?
56
Examples on Two Random Variables Cont’d……
Solution:
a. P
xi yj
XY ( xi , y j ) 1
2 2
k (2 xi y j ) 1
xi 1 y j 1
k[(2 1) (2 2) (4 1) (4 2)] 1
18k 1
k 1 / 18
57
Examples on Two Random Variables Cont’d……
Solution:
b. Marginal pmf of X and Y
i. Marginal pmf of X
2
1
PX ( xi ) PXY ( xi , y j ) (2 xi y j )
yj y j 118
1 1
PX ( xi ) (2 xi 1) (2 xi 2)
18 18
1
(4 xi 3), xi 1, 2
PX ( xi ) 18
0, otherwise
58
Examples on Two Random Variables Cont’d……
Solution:
b. Marginal pmf of X and Y
ii. Marginal pmf of Y
2
1
PY ( y j ) PXY ( xi , y j ) (2 xi y j )
xi xi 1 18
1 1
PY ( y j ) (2 y j ) (4 y j )
18 18
1
(2 y j 6), y j 1, 2
PY ( y j ) 18
0, otherwise
59
Examples on Two Random Variables Cont’d……
Solution:
c. PXY ( xi , y j ) PX ( xi ) PY ( y j )
X and Y are not independent.
60
• Example : Air Conditioner Maintenance
– A company that services air conditioner units in
residences and office blocks is interested in how to
schedule its technicians in the most efficient
manner
– The random variable X, taking the values 1,2,3 and
4, is the service time in hours
– The random variable Y, taking the values 1,2 and 3,
is the number of air conditioner units
11/21/2021 61
Joint p.m.f
Y=
number
X=service time
p
i j
ij 0.12 0.18
of units
1 2 3 4 0.07 1.00
11/21/2021 62
2020 63
d) Find Mean and Variance of X
2020 64
2020 65
2020 66
(d) Find Mean and Variance of X.
2020 67
2020 68