Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Course No: MTH F113: Probability and Statistics

Download as pdf or txt
Download as pdf or txt
You are on page 1of 80

BITS Pilani

Pilani Campus

Course No: MTH F113

Probability and Statistics


Joint Distributions
Sumanta Pasari
BITS Pilani
Pilani Campus sumanta.pasari@pilani.bits-pilani.ac.in
Let’s Watch…

https://www.youtube.com/watch?v=Qfs_mvpA-vQ&t=112s

3 BITS Pilani, Pilani Campus


Step-by-Step
1. Data Analysis
• Collection, classification, interpretation and analysis of data
• Visualization using charts and graphs
• Measurement of central tendency and dispersion

2. Probability
• Probability axioms and rules
• Important probability distributions
• Joint distributions; moments, correlation

3. Statistics
• Sample statistics
any change?
• Parameter estimation
• Testing of hypothesis

4 BITS Pilani, Pilani Campus


What is Probability?

5 BITS Pilani, Pilani Campus


Discrete Distributions

Gambler’s fallacy…
Poop by a bird…

Expectation and Moments


Missed flight…
6 BITS Pilani, Pilani Campus
Continuous Distribution

7 BITS Pilani, Pilani Campus


Joint Distributions

Single Random Variable (Univariate)

Discrete Continuous

Two Dimensional Random variables (Bivariate)

Discrete Continuous
8 BITS Pilani, Pilani Campus
Joint Distributions
 When two or more random variables are involved in a random experiment
 Toss a coin twice; S = {HH, HT, TH, TT};
• Let X and Y be random variables associated with the first and second tossing. If ‘head’
appears, then associated RV is 1, otherwise 0. Events are {(X=0, Y=0), (X=0, Y=1), (X=1,
Y=0), (X=1, Y=1)} . Can you find out what is P(X=i, Y=j), i=0,1, j= 0,1?
• Let X denote the number of ‘heads’ and Y denote the number of ‘tails’. Notice that
X+Y=2. Then possible events are {(X=0, Y=2), (X=1, Y=1), (X=2, Y=0)} . Can you find out
what is P(X=1, Y=1)? Note that in this example, events like (X=0, Y=0), (X=0, Y=1), (X=1,
Y=0), (X=1, Y=2), (X=2, Y=1), (X=2, Y=2) are impossible events, as X +Y =2.
 Two balls are selected at random from a box that contains 3 blue balls, 2 red balls and 3
green balls. If X is the number of blue balls and Y is the number of red balls selected, find
P(X=1, Y=1), P(X+Y≤1).
 Similarly, let X and Y be random variables associated with the height and weight of a
group of students. Find P(150≤X≤180, 50≤Y≤80).

9 BITS Pilani, Pilani Campus


Joint Distributions

Bivariate distribution occurs when we observe two


nondeterministic quantities, one followed by another.

For example : Record the atmospheric temperature


T in Celsius followed by atmospheric pressure P in
pounds per square foot at a random place and time.
This gives two dimensional r.v. (T, P).
n-dimensional random variable  we observe n
nondeterministic quantities in sequence.
10 BITS Pilani, Pilani Campus
Discrete Joint Density

• Let X and Y be discrete RV associated with a random experiment. Then the


ordered pair (X,Y) is called two-dimensional discrete RV.
• The joint pdf for (X,Y) is f XY  x, y   P  X  x and Y  y 

Necessary and sufficient condition for a function to be a discrete joint density:


(i) f XY ( x, y )  0   x, y   2

(ii)  f
all x all y
XY ( x, y )  1

• For any region A in the xy plane, the probability of A is defined as


P( A)   f XY ( x, y)   x, y   A

11 BITS Pilani, Pilani Campus


Marginal Density of Discrete RVs

• From a known joint density f(x,y) for discrete RVs (X,Y), it is easy to find out their
respective density functions.
(i) The marginal density for X , denoted by f X  x  , is given by
f X  x   P  X  x    f XY ( x, y )
all y

(ii) The marginal density for Y , denoted by fY  y  , is given by


fY  y   P Y  y    f XY ( x, y )
all x

Ex.5.1. For a discrete random variable  X , Y  , P  X  i, Y  j   0, i, j  1, 0,1


1 1 1
except P  X  0, Y  1  , P  X  1, Y  1  , P  X  1, Y  1  .
3 3 3
(i) Find the joint density for  X , Y  and (ii) marginal densities for X and Y .

12 BITS Pilani, Pilani Campus


Examples: Discrete Joint Distribution

Sol (Ex.5.1). We represent pdf and marginal densities in a tabular form.


X=x -1 0 1 marginal Y 1 3; x  0

f X  x   2 3; x  1
Y=y f(y)
-1 0 0 1/3 1/3  0; e.w

0 0 0 0 0
1 0 1/3 1/3 2/3 1 3; y  1

marginal X 0 1/3 2/3 Total Sum fY  y    2 3; y  1
 0; e.w
f(x) 1.0 
x2  y
HW.5.1. For  X , Y  , f XY  x, y   P  X  x, Y  y   ; x  0,1, 2,3; y  0,1.
32
Find the marginal densities f X  x  and fY  y  .
x2  y xy
HW.5.2. Verify whether (a) f XY  x, y   ; x  1, 2; y  0,1 (b) f XY  x, y   ; x, y  0,1
16 12
can define discrte pdfs.
13 BITS Pilani, Pilani Campus
Examples: Discrete Joint Distribution

Ex.5.2. Two balls are selected at random from a box that contains 3 blue balls, 2 red
balls and 3 green balls. If X is the number of blue balls and Y is the number of red balls
selected, find pdf for (X,Y) and marginal pdfs. What is P(X+Y≤1)?
X=x 0 1 2 marginal Y
Y=y f(y) Formula used here:
0 3/28 9/28 3/28 15/28  3 2  3 
1 6/28 6/28 0 12/28    
f  x, y        
x y 2 - x - y
2 1/28 0 0 1/28 8
marginal X 10/28 15/28 3/28 Total Sum  
 2
f(x) 1.0

First we find out the events  x, y  such that x+y  1


P  X  Y  1  f  0, 0   f  0,1  f (1, 0)  3 28  6 28  9 28  9 14

14 BITS Pilani, Pilani Campus


Joint Density for Continuous RVs

• Let X and Y be continuous RV associated with a random experiment. Then


the ordered pair (X,Y) is called two-dimensional continuous RV.
Necessary and sufficient condition for f(x,y) to be a continuous joint density
(i) f XY ( x, y )  0,   x, y   2
 
(ii) 
 
f XY ( x, y )dydx  1

b d
The probability is computed as (i) P  a  X  b, c  Y  d     f XY ( x, y )dydx
y y a c

d (ii) D  2
, P( A)   f ( x, y )dA
D D D

c x
x
a b 15 BITS Pilani, Pilani Campus
Joint Density for Continuous RVs
Note: In one dimensional continuous case, the probabilities
correspond to areas under density curve while in the case of
2-D, they corresponds to volumes under density surfaces.

Z
z  f XY ( x, y )

Probability of
The event R
Y (in XY-plane)
is this volume.

R
X
P[ R]   f XY ( x, y )dA
R 16 BITS Pilani, Pilani Campus
Marginal Density of Continuous RVs

• From a known joint density f(x,y) for continuous RVs (X,Y), it is easy to find out
their respective density functions.

(i) The marginal density for X , denoted by f X  x  , is given by



fX  x   f XY ( x, y )dy


(ii) The marginal density for Y , denoted by fY  y  , is given by



fY  y    f XY ( x, y )dx


Remarks:
(i) The marginal densities are also density functions (Verify!)
(ii) Thus, f X  x  and fY  y  will follow the properties of density functions
17 BITS Pilani, Pilani Campus
For n-dimensional RV

• The concept can be extended in an analogous


manner to n dimensions.
• The joint density fX1…Xn(x1,…,xn) is a function of n
random variables.
• Replicate the definition.

18
BITS Pilani, Pilani Campus
Independent Random Variables

Let  X , Y  be a two-dimensional RV with joint density f XY


and marginal densities f X , fY , respectively.

X and Y are independent if and only if


f XY  x, y   f X  x  fY  y  for all x and y

19 BITS Pilani, Pilani Campus


Independent Random Variables

In general for n RVs,


X 1 ,..., X n are indep iff
n
f X1 ... X n ( x1 ,..., xn )   f X i ( xi )
i 1

Here f X1 ... X n ( x1 ,..., xn ) is the joint density


and are f X i ( xi ) the marginal densities of X i .
20 BITS Pilani, Pilani Campus
Exercise 5.1 (From Book)

3. The joint density for (X,Y) is given by:


1
f XY ( x, y )  2 , x  1,2,3,..n
n
y  1,2,3,..n
and f XY ( x, y )  0 elsewhere.
(a) Verify that fXY(x,y) satisfies the
conditions necessary to be a density.
21 BITS Pilani, Pilani Campus
Exercise 5.1 (Q. 3)

(b) Find the marginal densities for X and Y


(c ) Are X and Y independent?

Sol:
1
for n  0, f XY ( x, y )  2  0,  x  1,..., n
n
and y  1,..., n; and equals 0 elsewhere.
also,
n n n
1 1

x 1 y 1 n
2
 
x 1 n
2
n 1
22 BITS Pilani, Pilani Campus
Exercise 5.1 (Q. 3)

n
1
(b) f X ( x)   2  1/ n, x  1, 2,...n
y 1 n

0 e.w.
n
1
fY ( y )   2  1/ n, y  1, 2,...n
x 1 n

0 e.w.
(c) The random variables X, Y are independent:

23 BITS Pilani, Pilani Campus


Exercise 5.1 (Q. 3)

1 1
f X ( x ) fY ( y ) 
n n
1
 2  f XY ( x , y )
n
for 1  x  n,1  y  n while
f XY ( x , y )  0  f X ( x ) fY ( y )
elsewhere.
24 BITS Pilani, Pilani Campus
Exercise 5.1 (Q. 4)

4. The joint density for (X,Y) is given by


2
f XY ( x, y )  ,1  y  x  n
n(n  1)
x, y integers n is a positive integer
(a)Verify that fXY(x,y) satisfies the conditions
necessary to be a density.
(b) Find the marginal densities for X and Y
25 BITS Pilani, Pilani Campus
Exercise 5.1 (Q. 4)

(c ) Are X and Y independent?


(d) Assume that n=5, use the density
to find
P[X  3 and Y  2]
Find also
P[X  3] and P[Y  2]
26 BITS Pilani, Pilani Campus
Exercise 5.1 (Q. 4)

Sol: for 1  y  x  n
2
Since f ( x, y )   0,
n( n  1)
as n is a +ve integer
and f ( x, y )  0 elsewhere.
n n
2
also, 
all ( x , y )
f ( x, y )   
y 1 x  y n( n  1)
n
2

n( n  1)
 (n  y  1)
y 1
27 BITS Pilani, Pilani Campus
Exercise 5.1 (Q. 4)
2
 {n  (n  1)  (n  2)  ...  1}  1
n(n  1)
x
b) f X ( x )   2
n ( n 1)
y 1

2x
 , x  1, 2,...n
n( n  1)

n
2( n  y  1)
fY ( y )  
x y
2
n ( n 1) 
n( n  1)
, y  1, 2,..n

28 BITS Pilani, Pilani Campus


Exercise 5.1 (Q. 4)

c) X and Y are not independen t

2 1 2(n  2  1)
f X (1) fY (2) 
n(n  1) n(n  1)
 0  f XY (1,2)

29 BITS Pilani, Pilani Campus


Exercise 5.1 (Q. 4)

d) when n  5,
2 3
2
P[X  3 and Y  2]  
y 1 x  y 5(6)
2 2
 
30 y1
(3  y  1)  1 / 3

3
2x 2 (2  4  6)
P[X  3]     2/5
x 1 5(6) 30 2
2 2
 
30 y1
(3  y  1)  1 / 3

30 BITS Pilani, Pilani Campus


Exercise 5.1 (Q. 4)

P[Y  2]
2
2(5  y  1) 2
  (5  4)  3 / 5
y 1 5(6) 30

31 BITS Pilani, Pilani Campus


Exercise 5.1 (Q. 9)

(9)An engineer is studying early morning


traffic pattern at a particular intersection.
The observation period begins at 5.30 a.m.
Let X denote the time of arrival of the first
vehicle from the north – south direction.
Let Y denote the first arrival time from the

32 BITS Pilani, Pilani Campus


Exercise 5.1 (Q. 9)

east – west direction. Time is measured in


fractions of an hour after 5.30 a.m. Assume
that density for (X,Y) is given by
1
f XY ( x, y)  , 0  y  x  1
x
(a)Verify that this is a valid density for a two
dimensional random variable.
33 BITS Pilani, Pilani Campus
Exercise 5.1 (Q. 9)
1 x 1
1
(a )   dy dx   (1 / x )[ y ] y 0  1
x

0 0
x 0

(b) Find P [ X  0.5 and Y  0.25]

Sol : P[ X  0.5 and Y  0.25]


0.25 0.5
1
 
0 y
x
dx dy  0.4233

34 BITS Pilani, Pilani Campus


Exercise 5.1 (Q. 9)

(d ) Find P[ X  0.5 and Y  0.5]


1 1
1
   dx dy  0.15345
0.5 y
x

35 BITS Pilani, Pilani Campus


Examples: Continuous Joint Densities

 2 xy
 x  ; 0  x  1, 0  y  2
Ex.5.3. Let f  x, y    3
 0 ; e.w.
 1
(i) Find P  X   (ii) P Y  X 
 2

36 BITS Pilani, Pilani Campus


Examples: Continuous Joint Densities

 1  2 xy 
1 2 1 2
Sol. (i) P  X      f  x, y  dydx     x   dydx
 2 12 0 12 0
3 
y 2 x 1
1
 2 xy 2
 2 2x 
1
2 3 x  5 2
  x y   dx    2 x   dx   x   
1 2
12
6  y 0 3  3 3  x 1 2 6

 2 xy 
1 x 1 x
(ii) P Y  X     f  x, y  dydx     x   dydx
0 0
0 0
3 
yx 1
1
 2 xy 
2
 3 x  1
 7x 
3
7 4
  x y   dx    x   dx    
0 
6  y 0 0
6  24  0 24

37 BITS Pilani, Pilani Campus


Examples: Continuous Joint Densities

k  6  x  y  ; 0  x  2, 2  y  4
HW5.3. Let f  x, y   
 0 ; e.w.
(i) Find k
(ii) Find f X  x  , fY  y 
(iii) P Y  3
(iv) P  X  1  Y  3
(v) P  X  1 Y  3

38 BITS Pilani, Pilani Campus


Examples: Continuous Joint Densities

2 4
Hint. (i)   f  x, y  dydx  1  k  1 8
0 2 y
4
(ii) f X  x    f  x, y  dy where 0  x  2; d
D
2
2 c
fY  y    f  x, y  dx where 2  y  4 x
0 a b
3
5
(iii) P Y  3   fY  y  dy  ,
2
8
1 3
3
(iv) P  X  1  Y  3    f  x, y  dydx 
0 2
8
P  X  1  Y  3
(v) P  X  1 Y  3 
3

P Y  3 5
39 BITS Pilani, Pilani Campus
Examples: Continuous Joint Densities

kx 2 y; 0  x  1, 0  y  1
HW5.4. If f  x, y    is a pdf,
 0 ; e.w.
(i) Find k  Sol. k  6 
(ii) Find f X  x  , fY  y 
 1 1
(iii) P  X  Y  (iv) P  X  Y  
 2 2

40 BITS Pilani, Pilani Campus


Examples: Continuous Joint Densities

k  3x  y  ; 1  x  3, 0  y  2
HW5.5. If f  x, y    is a pdf,
 0 ; e.w.
(i) Find k  Sol. k  1 28 
(ii) Find f X  x  , fY  y 
(iii) Are X and Y independent?

41 BITS Pilani, Pilani Campus


Examples: Continuous Joint Densities

k ; 0  x  1, 0  y  x
HW5.6. If f  x, y    is a pdf,
 0 ; e.w.
(i) Find k  Sol. k  2 
(ii) Find f X  x  , fY  y  .

42 BITS Pilani, Pilani Campus


Problem Solving

HW.5.7. For the following pdfs, check whether X and Y are independent
 x 1  3 y 2 
 ; 0  x  2, 0  y  1
(i) f  x, y    4

 0 ; e.w.
2; 0  x  1, 0  y  x
(ii) f  x, y   
 0 ; e.w.
6 x 2 y; 0  x  1, 0  y  1
(iii) f  x, y   
 0 ; e.w.
1
  6  x  y  ; 0  x  2, 2  y  4
(iv) f  x, y    8
 0 ; e.w.
43 BITS Pilani, Pilani Campus
Problem Solving

Ex. 5.4: Suppose that the two dimensional


continuous random variable (X,Y) has
joint pdf given by:

 xy
x  , 0  x  1,0  y  2
2
f ( x , y)   3

0, elsewhere
44 BITS Pilani, Pilani Campus
Sol.

Check that
 

 
 
f ( x, y )

2 1
xy
   (x  2
) dxdy
0 0
3
 1 45 BITS Pilani, Pilani Campus
Sol.

Let B={X+Y1}, compute P(B).


1 1 x
xy 65
P(B)  1    ( x  ) dy dx 
2

0 0
3 72
P[B]= 1-P(B), where
y
2

B = (X+Y<1}, Hence

x
1
46 BITS Pilani, Pilani Campus
Cumulative distribution function
Def: Let (X,Y) be a two dimensional random
variable. The cdf F of the two dimensional
random variable (X,Y) is defined by:

F(x, y)  P[X  x and Y  y]

Remark: Function of two variables and has a


number of properties analogous to one
dimensional random variable.
47 BITS Pilani, Pilani Campus
CDF and PDF
If F( x , y ) is the cdf of a two dimensional
random variable with joint pdf, f ( x , y ),
 2
then F( x , y )  f ( x , y ),
x y
wherever F is differentiable.

(a) FX ( x )  F( x ,  ) and FY ( y )  F(  , y )
(b) X and Y are independent
 F( x , y )  FX ( x )FY ( y )
48 BITS Pilani, Pilani Campus
Multinomial Law
Ex 5.5: A die is rolled 10 times in succession. Find the
probability of the occurrence of six 4 times, five twice,
10
10! 1
and all other faces once each. Ans:  
4! 2! 1!1!1! 1!  6 
Ex 5.6:
An urn contains N  N 1  N 2   N m balls; N i : i th color
With replacement, n  i1  i2   im balls are picked.
Find P  X1  i1 , X 2  i2 , , X m  im 
i1 i2 im
n!  N1   N2   Nm 
      N 
i1 ! i 2 ! i m !  N   N   
49 BITS Pilani, Pilani Campus
Book Exercise 5.1 (Q. 12)

Ex. 12: Items coming off an assembly line are


classified as being either non-defective, defective but
salvageable, or defective but non-salvageable. The
probabilities of observing items in each of these
categories are 0.90, 0.08 and 0.02 respectively. The
probabilities do not change from trial to trial. Twenty
items are randomly selected and classified. Let X1
denote the number of non-defective items, X2 the
number of non-defective but salvageable and X3 the
number of non-defective but non-salvageable items
obtained.
50 BITS Pilani, Pilani Campus
Exercise 5.1 (Q. 12)

(a)Find P[X1=15,X2=3,X3=2].
(b)Find the general formula for joint density of
(X1, X2, X3).
20!
Soln : ( a)  0.90   0.08   0.02 
15 3 2

 15! 3! 2!


n!
( b ) f  x1 , x 2 , x 3   n1 n2 n3
p1 p2 p3
n1 ! n2 ! n3 !
(This is called multinomial distribution).
51 BITS Pilani, Pilani Campus
Expectation
Let  X , Y  be a two-dimensional RV with joint density f XY
and marginal densities f X , fY , respectively.
Expectation of H  X , Y  , denoted by E  H  X , Y   , is given as
E  H  X , Y      H  x, y  f XY ( x, y ), if  X , Y  is discrete RV.
all x all y

provided   | H ( x, y ) | f
all x all y
XY ( x, y ) exists.

 
E  H  X , Y      H  x, y  f XY ( x, y )dydx, if  X , Y  is continuous RV
 
 
provided   | H ( x, y ) | f XY ( x, y ) dy dx exists
 
52 BITS Pilani, Pilani Campus
Expectation: Properties
(a) E  c   c; c constant
(b) E  aX  bY  c   aE  X   bE Y   c
(c)E[a0  a1 X 1  ...  an X n ]
 a0  a1 E[ X 1 ]  ...  an E[ X n ]

If two random variables X and Y are independent,


E  XY   E  X  E Y  Verify!
53 BITS Pilani, Pilani Campus
Proof (for continuous case)
 
E  XY     xy f XY ( x, y ) dxdy
 
 
   xy
 
f X ( x) f Y ( y ) dxdy

  
 x

f X ( x)

yf Y ( y ) dy dx  x

f X ( x) E[Y ] dx


 E[Y ]  x f X ( x) dx  E[ X ] E[Y ]

54 BITS Pilani, Pilani Campus
Mean and Variance
Let  X , Y  be a two-dimensional RV with joint density f XY and marginal densities
f X , fY , respectively.
 X  E  X    xf XY ( x, y )   xf X ( x), if  X , Y  is discrete RV.
all x all y x

Y  E Y     yf XY ( x, y )   yfY ( y ), if  X , Y  is discrete RV.


all x all y y
  
X  E  X     xf XY ( x, y )dydx   xf X ( x)dx, if  X , Y  is continuous RV
  
  
Y  E Y     yf XY ( x, y )dydx   yf Y ( y )dy, if  X , Y  is continuous RV
  

Similarly,
 X2  E  X   x      x   X  f XY ( x, y )    x   X  f X ( x);  X , Y  discrete
2 2 2

all x all y x
  
 X2  E  X   x      x  X    x  X  f X ( x)dx;  X , Y  continuous
2 2 2
f XY ( x, y )dydx 
  

55 BITS Pilani, Pilani Campus


Examples
HW5.8. For a discrete random variable  X , Y  , P  X  i, Y  j   0, i, j  1, 0,1
1 1 1
except P  X  0, Y  1  , P  X  1, Y  1  , P  X  1, Y  1  .
3 3 3
Find E  X  , E Y  , E  X  3Y  ,Var  X  , Var Y  , Var  7 X  9 

HW5.9. Two balls are selected at random from a box that contains
3 blue balls, 2 red balls and 3 green balls. If X is the number of blue
balls and Y is the number of red balls selected, then
Find (i) f  x, y  (ii) f X  x  , fY  y  , (iii) E  X  , E  X 2  , E Y  , E Y 2 
, E  XY  (iv) Var  2 X  , Var  2Y  5 

56 BITS Pilani, Pilani Campus


Examples

k ; 0  y  x  1
HW5.10. f  x, y   
0 ; e.w.
Find (i) k (ii) f X  x  , fY  y  ,
(iii) E  X  , E  X 2
 , E Y  , E Y  , E  XY 
2

(iv) Var  X  , Var Y  , Var  XY  5 

57 BITS Pilani, Pilani Campus


Variance Properties
Ex.5.7. Show that Var  X  Y   Var  X   Var Y  ,in general
Sol. Var  X  Y   E  X  Y   X  Y  
 2

 
 E   X   X   Y  Y   
 2

 
 E  X   X   Y  Y   2  X   X Y  Y  
 2 2

 
 E  X   X   E Y  Y   2 E  X   X Y  Y  
2 2

 Var  X   Var Y  .
Here E  X   X Y  Y   is called the covariance.
58 BITS Pilani, Pilani Campus
Covariance
• It is a measure (absolute) of how much two variables
change together; e.g., height and weight, income-
expenditure, age-blood pressure, advertisement-sales,
demand-supply, fertilizer-yield.
• If two variables tend to show similar behaviour, then the
covariance is positive, otherwise negative.
• The sign of the covariance shows the tendency in the linear
relationship between the variables.
• The magnitude of covariance does not really produce a
fruitful meaning.

59 BITS Pilani, Pilani Campus


Covariance
Covariance provides a measure of joint variability.

If X , Y tend to show similar behaviour, then


the covariance is +ve, else it is -ve.

Let X , Y be RVs with means  X , Y , respectively.


Cov  X , Y   E  X  Y Y  Y  
 E  XY   E  X  E Y 
60 BITS Pilani, Pilani Campus
Covariance Properties
(i) If two random variables X and Y are independent, then Cov  X , Y   0
(ii) Cov  X , Y   Cov Y , X 
(iii) Cov  X , X   Var  X 
(iv) Cov  cX , Y   c Cov  X , Y  , c is a constant
(v) Cov  a  bX , Y   b Cov  X , Y 
(vi)Cov  a  bX , c  dY   bd Cov  X , Y 
  n 2
(vii)Var  a0   ai X i    ai Var[ X i ]  2 ai a j Cov  X i , X j 
n

 i 1  i 1 i j

 n
 n 2
(viii)Var  a0   ai X i    ai Var[ X i ],if X 1 ,..., X n are independent
 i 1  i 1
61 BITS Pilani, Pilani Campus
Remark on Covariance
If X and Y are independent, then Cov  X , Y   0,
but the converse is NOT true.
Let X be uniformly distributed in  1,1
and let Y  X . 2

Now Cov  X , Y   E  XY   E  X  E Y 
 EX 3
  E  X  E X 
2

0
62 BITS Pilani, Pilani Campus
Problem Solving
Ex.5.8. Let X , Y be independent RVs with means 1,  3, and variances
4, 5, respectively. Then, find E  5 X  3Y  9  ,Var  2 X  4Y  5  , Var  X  2 
Hint. E  5 X  3Y  9   5 E  X   3E Y   9  5  15  9  19
Var  2 X  4Y  5   22 Var  X   42 Var Y  , as X , Y are independent
Var  X  2   Var  X   4

kxy; 0  x  1, 0  y  x
HW5.11. Let f  x, y   
 0 ; e.w.
(i) Find k , E  X 2  , E Y 2  , E  XY  (ii) Var  X  , Var Y  (iii) Cov  X , Y 

63 BITS Pilani, Pilani Campus


Problem Solving
 x
1; x  1 and y 
HW5.12. f  x, y    2

 0 ; e.w.
Show that Cov  X , Y   0, but X , Y are not independent.

HW5.13. Let Cov  X , Y   K . Then, show that


Cov  aX  bY , cX  dY   0, if ac x2   ad  bc  K  bd y2  0.

64 BITS Pilani, Pilani Campus


Note

Sec 5.3 to be covered later. In Sec. 5.4, only


conditional densities will be discussed.

65 BITS Pilani, Pilani Campus


Conditional Density Functions
Let  X , Y  be a RV with joint density f XY and marginal densities f X , fY
(i) The conditional density for X given Y  y, denoted by f X y , is given by
f XY  x, y 
fX y  x  ; fY  y   0
fY  y 
(ii) The conditional density for Y given X  x, denoted by fY x , is given by
f XY  x, y 
fY x  y   ; fX  x  0
fX  x
Remarks:
(i) The conditional densities f X y and fY x are also density functions

66 BITS Pilani, Pilani Campus


Conditional Density Functions
Let  X , Y  : RV, joint pdf f XY , and marginal densities
f X , fY , respectively.

Notice that whenever X and Y are independent,


f X y  x   f X  x  and fY x  y   fY  y 

67 BITS Pilani, Pilani Campus


Examples: Conditional Density

 x 1  3 y 2 
    
Ex.5.9 f  x, y    4
; 0 x 2, 0 y 1

 0 ; e.w.
(i) Find f X  x  , fY  y  , f X y , fY x
(ii) Evaluate P 1 4  X  1 2 Y  1 3 .

68 BITS Pilani, Pilani Campus


Examples: Conditional Density
1
x 1  3 y 2  x
Sol. (i) f X  x    dy  , 0  x  2;
0
4 2
x 1  3 y 2 
(If y0  [0,1], then
1 3y
2 2
fY  y    dx  ,0  y 1 fY (y 0 )  0
0
4 2
f XY  x, y0  x hence the conditional
f X y0  x    ,0  x  2
fY  y0  2 density f X |y0 (x) is
f XY  x0 , y  1 3y2 undefined for any x.)
fY x0  y    ,0  y 1
f X  x0  2
12 12

(ii) P 1 4  X  1 2 Y  1 3 
x 3
 f X Y 1 3  x  dx   dx 
14 14
2 64
69 BITS Pilani, Pilani Campus
Examples: Conditional Density

2; 0  x  1,0  y  x
HW5.14. Let f  x, y    is a pdf,
 0 ; e.w.
(i) Find f X  x  , fY  y  , f X y , fY x and
(ii) evaluate P 1 4  X  3 4 Y  1 2  .

70 BITS Pilani, Pilani Campus


Examples: Conditional Density
Hint. (i) f X  x   2 x,0  x  1; fY  y   2 1  y  ,0  y  1
f XY  x, y  1
fX y  x   , y  x  1;
fY  y  1 y
f XY  x, y  1
fY x  y    ,0  y  x
fX  x x
Note that f X y is a function of x, as y is a constant. Similar is the case for fY x .
1 1 1
(ii) When y  1 2, f X y  x   ,  x  1, that is, f X Y 1 2  x   2;  x  1
1  1 2  2 2
34 34

P 1 4  X  3 4 Y  1 2  
1
 f X Y 1 2  x  dx   2dx 
14 12
2

71 BITS Pilani, Pilani Campus


Conditional Density Functions
HW5.15. For the following pdfs, use conditional density
functions to check whether X and Y are independent
 2 xy
 x  , 0  x  1, 0  y  2
(i) f  x, y    3
 0 ; e.w.
  
sin x sin y; 0  x  , 0  y 
(ii) f  x, y    2 2
 0 ; e.w.
6 x 2 y; 0  x  1, 0  y  1
(iii) f  x, y   
 0 ; e.w.
72 BITS Pilani, Pilani Campus
Exercise 5.4 (Q. 54, Page: 188)

An electronic device is designed to switch


house lights on and off at random times
after it has been activated. Assume that
the device is designed in such a way that
it will be switched on and off exactly once
in a 1-hour period.

BITS Pilani, Pilani Campus


Exercise 5.4 (Q. 54, Page: 188)

Let Y denote the time at which the lights


are turned on and X the time at which they
are turned off. Assume that the joint
density for (X,Y) is given by

f XY ( x, y)  8 xy , 0  y  x 1

BITS Pilani, Pilani Campus


Exercise 5.4 (Q. 54, Page: 188)

(g) Find the conditional distribution of X


given Y
(h) Find the probability that the lights will
be switched off within 45 minutes of
the system being activated given that
they were switched on 10 minutes
after the system was activated.

BITS Pilani, Pilani Campus


Exercise 5.4 (Q. 56, Page: 189)

Let X denote the number of “do loops” in a


Fortran program and Y the number of runs
needed to debug the program. Assume that
the joint density for (X,Y) is given as:
x/y 1 2 3 4

0 0.059 0.100 0.050 0.001


0.093 0.120 0.082 0.003
1
2 0.065 0.102 0.100 0.010
3 0.050 0.075 0.070 0.020
BITS Pilani, Pilani Campus
Exercise 5.4 (Q. 56, Page: 189)

(d) Find the probability that a randomly


selected program requires at least two runs
to debug given that it contains exactly one
“do loop”
0.205
P[Y  2 and X 1]
Sol: P[Y  2 | X  1]  
P[ X 1]  0.688
0.298
(This can also be evaluated using fY x )
P[Y  2 | X  1]   fY | X 1 ( y ).
y2
BITS Pilani, Pilani Campus
Problem Solving

HW 5.16: The joint density of X and Y is given:

 1  xy
 ye , 0  x  , 0  y  2
f ( x, y )   2

0 , elsewhere
(1) Find E[X|Y=1]. (also denoted by X|y=1)
(this is the conditional mean of f X | 1)
(2) Find P[X>2|Y=1].
BITS Pilani, Pilani Campus
Solution
 
1  xy 1
fY ( y )  

f ( x, y )dx   ye dx  ; 0  y  2
0
2 2
 f ( x,1) x
 e ; 0 x
Hence f X |Y 1 ( x)   fY (1)
 0;
 elsewhere

E[ X | Y  1]   xf

X |Y 1 ( x)dx (Evaluate)

BITS Pilani, Pilani Campus


Solution

P[ X  2 | Y  1]   f X |Y 1 ( x)dx
2

x
  e dx (evaluate)
2

BITS Pilani, Pilani Campus

You might also like