0% found this document useful (0 votes)
5 views

Chapter 3

Uploaded by

mahideryehaimi
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Chapter 3

Uploaded by

mahideryehaimi
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 38

Chapter 3

Two Random Variables


Outline
 Introduction
 The Joint Cumulative Distribution Function
 The Joint Probability Density and Mass Functions
 Marginal Statistics
 Independence
 Conditional Distributions
 Correlation and Covariance

07/04/2024 1
Introduction
 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 vari-
able if each of X and Y associates a real number with every el-
ement 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 out-
come ω in the sample space.
07/04/2024 2
• Definition:- Let S be the sample space of a random experiment. Let X
and Y be two r.v.'s. Then the pair (X, Y) is called a bivariate r.v. (or two-di-
mensional random vector) if each of X and Y associates a real
number with every element of S.
Thus, the bivariate r.v. (X, Y) can be considered as a function that to each point c
in S assigns a point (x, y) in the plane (Fig. 3-1). The range space of the bi-
variate r.v. (X, Y) is denoted by Rxy, and defined by

07/04/2024 3
Example 1
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) , R, = (0, 1,2)
(b) RXY = ((2, O), (1, I), (0, 2)) which is sketched in Fig. 3-2.
(d) 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

07/04/2024 4
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 

iii. lim FXY ( x, y )  FXY (,)  0


x  
y  
07/04/2024 5
The Joint Cumulative Distribution Function Cont’d…

iv. lim FXY ( x, y )  FXY (, y )  0


x  

v. lim FXY ( x, y )  FXY ( x, )  0


y  

vi. P ( x1  X  x2 , Y  y )  FXY ( x2 , y )  FXY ( x1 , y )

vii. P ( X  x, y1  Y  y2 )  FXY ( x, y2 )  FXY ( x, y1 )

vii. P ( x1  X  x2 , y1  Y  y2 )  FXY ( x2 , y2 )

 FXY ( x2 , y1 )  FXY ( x1 , y2 )  FXY ( x1 , y1 )

07/04/2024 6
The Joint Probability Density Function

 The joint probability function (pdf) of two continuous random


variables X and Y is defined as:

 2 FXY ( x, y )
f XY ( x, y ) 
xy
 Thus, the joint cumulative distribution function (cdf) is given
by:

y x
FXY ( x, y )    f XY ( x, y )dxdy
- -

07/04/2024 7
The Joint Probability Density Function Cont’d…..

Properties of the Joint pdf, fXY(x, y):


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

07/04/2024 8
DISCRETE RANDOM VARIABLES :The Joint Probability Mass Func-
tion

 The joint probability mass function (pmf) of two discrete ran-


dom variables X and Y is defined as:
PXY ( xi , y j )  P ( X  xi , Y  y j )
 The joint cdf can be written as:

FXY ( x, y )    PXY ( xi , y j )
xi  x y j  y

Properties of the Joint pmf, PXY (xi , yj ):


1. 0  PXY ( xi , y j )  1
2.  P
xi yj
XY ( xi , y j )  1

07/04/2024 9
Marginal Statistics of Two Random Variables

 In the case of two or more random variables, the statistics of


each individual variable are called marginal statistics.
i. Marginal cdf of X and Y
FX ( x)  lim FXY ( x, y )  FXY ( x, )
y 

FY ( y )  lim FXY ( x, y )  FXY (, y )


x 

ii. Marginal pdf of X and Y



f X ( x)   f XY ( x, y )dy
-

f Y ( y )   f XY ( x, y )dx
-

07/04/2024 10
Marginal Statistics of Two Random Variables Cont’d…..

iii. Marginal pmf of X and Y

P ( X  xi )  PX ( xi )   PXY ( xi , yi )
yj

P (Y  y j )  PY ( y j )   PXY ( xi , yi )
xi

07/04/2024 11
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 )

ii. from the joint pdf

f XY ( x, y )  f X ( x) f Y ( y )

iii.from the joint pmf

PXY ( xi , y j )  PX ( xi ) PY ( y j )

07/04/2024 12
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 )

07/04/2024 13
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 de-
fined by:
PXY ( xi , y j )
PY / X ( y j / xi )  , PX ( xi )  0
PX ( xi )

07/04/2024 14
Correlation and Covariance
i. Correlation

R XY  Cor ( X , Y )  E ( XY )

ii. Covariance

 XY  Cov( X , Y )  E[( X   X )(Y  Y )]


  XY  Cov( X , Y )  E ( XY )  E ( X ) E (Y )
iii. Correlation Coefficient
Cov( X , Y )  XY
 XY  
 XY  XY
07/04/2024 15
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 conditional pdf of X and Y .
07/04/2024 16
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

07/04/2024 17
Examples on Two Random Variables Cont’d……

Solution:
b. Marginal pdf of X and Y
i. Marginal pdf of X
 1
f X ( x)   f XY ( x, y )dy   4 xydy
 0

 y2
1
 f X ( x)  4 x   2 x
 2 0
2 x , 0  x 1
 f X ( x)  
0, otherwise
07/04/2024 18
Examples on Two Random Variables Cont’d……

Solution:
b. Marginal pdf of X and Y
ii. Marginal pdf of Y
 1
fY ( y )   f XY ( x, y )dx   4 xydx
 0

 x2 1
 fY ( y )  4 y   2 y
 2 0
2 y , 0  y 1
 fY ( y )  
0, otherwise
07/04/2024 19
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
1 1
  4 y[1 / 2(1  y ) ]dy   2( y  2 y 2  y 3 )dy
2
0 0

 2 ( y 2 / 2  2 y 3 / 3  y 4 / 4)  1 / 6
 P( X  Y  1)  1 / 6

07/04/2024 20
Examples on Two Random Variables Cont’d……

Solution:
e. Conditional pdf of X and Y
i. Conditional pdf of X
f XY ( x, y ) 4 xy
f X /Y ( x / y)    2x
fY ( y ) 2y

2 x, 0  x  1, 0  y  1
 f X /Y ( x / y)  
0, otherwise

07/04/2024 21
Examples on Two Random Variables Cont’d……

Solution:
e. Conditional pdf of X and Y

ii. Conditional pdf of Y

f XY ( x, y ) 4 xy
fY / X ( y / x)    2y
f X ( x) 2x

2 y, 0  x  1, 0  y  1
 fY / X ( y / x)  
0, otherwise

07/04/2024 22
Examples on Two Random Variables Cont’d……

Example-2:
The joint pdf of two continuous random variables X and Y is
given by:
k , 0  y  x  1
f X ( x)  
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 conditional pdf of X and Y .
07/04/2024 23
Examples on Two Random Variables Cont’d……

Solution:
  1 1
a.  
-  
f XY ( x, y )dxdy  1  
0  kdxdy  1
y

1
 k  x   1
1

0 y
1  y 2 1 k
 k  (1  y )dy  k  y     1
0
 2 0 2
k  2

07/04/2024 24
Examples on Two Random Variables Cont’d……

Solution:
b. Marginal pdf of X and Y
i. Marginal pdf of X
 x
f X ( x)   f XY ( x, y )dy   2dy
 0

x
 f X ( x)  2 y   2 x
0
2 x , 0  x 1
 f X ( x)  
0, otherwise
07/04/2024 25
Examples on Two Random Variables Cont’d……

Solution:
b. Marginal pdf of X and Y
ii. Marginal pdf of Y
 1
fY ( y )   f XY ( x, y )dx   2dx
 y

1
 fY ( y )  2 x   2(1  y )
y
2(1  y ), 0  y 1
 fY ( y )  
0, otherwise
07/04/2024 26
Examples on Two Random Variables Cont’d……

Solution:
c. f XY ( x, y )  f X ( x) fY ( y )
 X and Y are not independent
1/ 2 x
d . P(0  X  1 / 2)    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
07/04/2024 27
Examples on Two Random Variables Cont’d……

Solution:

e. Conditional pdf of X and Y


i. Conditional pdf of X
f XY ( x, y ) 2 1
f X /Y ( x / y)   
fY ( y ) 2(1  y ) (1  y )
 1
 , 0  y  x 1
 f X / Y ( x / y )  1  y
0, otherwise

07/04/2024 28
Examples on Two Random Variables Cont’d……

Solution:

e. Conditional pdf of X and Y


ii. Conditional pdf of Y
f XY ( x, y ) 2 1
fY / X ( y / x)   
f X ( x) 2x x
1
 , 0  y  x 1
 fY / X ( y / x)   x
0, otherwise

07/04/2024 29
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 independent?

07/04/2024 30
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
07/04/2024 31
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
07/04/2024 32
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
07/04/2024
33
Examples on Two Random Variables Cont’d……

Solution:

c. PXY ( xi , y j )  PX ( xi ) PY ( y j )
 X and Y are not independent.

07/04/2024 34
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 effi-
cient 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

X=service time • Joint p.m.f


Y=
numbe  p ij 0.12  0.18
r of 1 2 3 4 i j
units
   0.07  1.00
• Joint cumulative distribution function
1 0.12 0.08 0.07 0.05
F (2, 2)  p11  p12  p21  p22
2 0.08 0.15 0.21 0.13
 0.12  0.18  0.08  0.15
3 0.01 0.01 0.02 0.07  0.43
07/04/2024 35
– Marginal p.m.f of X
3
P ( X  1)   p1 j  0.12  0.08  0.01  0.21
j 1
– Marginal p.m.f of Y
4
P (Y  1)   pi1  0.12  0.08  0.07  0.05  0.32
i 1
– Marginal probability distribution of Y
P (Y  3)  p3  0.01  0.01  0.02  0.07  0.11
– Conditional distribution of X
p13 0.01
p1|Y 3  P ( X  1| Y  3)    0.091
p3 0.11

07/04/2024 36
Independence and Covariance
• Covariance

Cov( X , Y )  E (( X  E ( X ))(Y  E (Y )))


 E ( XY )  E ( X ) E (Y )

Cov( X , Y )  E (( X  E ( X ))(Y  E (Y )))


 E ( XY  XE (Y )  E ( X )Y  E ( X ) E (Y ))
 E ( XY )  E ( X ) E (Y )  E ( X ) E (Y )  E ( X ) E (Y )
 E ( XY )  E ( X ) E (Y )
– May take any positive or negative numbers.
– Independent random variables have a covariance of zero

07/04/2024 37
• Example (Air conditioner maintenance)

E ( X )  2.59, E (Y )  1.79
4 3
E ( XY )   ijpij
i 1 j 1

 (11 0.12)  (1 2  0.08)


   (4  3  0.07)  4.86
Cov( X , Y )  E ( XY )  E ( X ) E (Y )
 4.86  (2.59 1.79)  0.224
Var( X )  1.162, Var(Y )  0.384
Cov( X , Y )
Corr( X , Y ) 
Var( X )Var(Y )
0.224
  0.34
1.162  0.384
07/04/2024 38

You might also like