In: Statistics and Probability
There are 2 white balls, 9 black balls and 29 green balls in a box. We draw a ball twice, without replacement. Let X and Y denote the number of white and black balls, respectively, among the drawn. Calculate Cov(X,Y).
Total number of balls = 2 + 9 + 29 = 40
First we determine the joint pmf of X,Y.
If X = 0, Y = 0 it implies both balls are green balls and the probability of this can be derived if we divide the number of ways of choosing 2 green balls out of 29 of them = 29C2 = 29! / (2!27!) = 406 by the total number of ways of choosing two balls out of 40 = 40C2 = 40! / (2!38!) = 780
So p(X = 0,Y = 0) = 406/780
If X = 1, Y = 0 it implies one ball is white and other is green and the probability of this can be derived if we divide the number of ways of choosing one ball white and other green = 2C1 x 29C1 = 2 x 29 = 58 by the total number of ways of choosing two balls out of 40 = 40C2 = 40! / (2!38!) = 780
So p(X = 1,Y = 0) = 58/780
If X = 0, Y = 1 it implies one ball is black and other is green and the probability of this can be derived if we divide the number of ways of choosing one ball black and other green = 9C1 x 29C1 = 9 x 29 = 261 by the total number of ways of choosing two balls out of 40 = 40C2 = 40! / (2!38!) = 780
So p(X = 0,Y = 1) = 261/780
If X = 1, Y = 1 it implies one ball is black and other is white and the probability of this can be derived if we divide the number of ways of choosing one ball black and other white = 9C1 x 2C1 = 9 x 2 = 18 by the total number of ways of choosing two balls out of 40 = 40C2 = 40! / (2!38!) = 780
So p(X = 1,Y = 1) = 18/780
If X = 2, Y = 0 it implies both balls are white and the probability of this can be derived if we divide the number of ways of choosing two balls white = 2C2 = 1 by the total number of ways of choosing two balls out of 40 = 40C2 = 40! / (2!38!) = 780
So p(X = 2,Y = 0) = 1/780
If X = 0, Y = 2 it implies both balls are black and the probability of this can be derived if we divide the number of ways of choosing two balls black = 9C2 = 36 by the total number of ways of choosing two balls out of 40 = 40C2 = 40! / (2!38!) = 780
So p(X = 0,Y = 2) = 36/780
Rest all cases have zero probability as X + Y <=2 always by the given conditions as it represents the number of white + black balls amongst 2 balls.
So,
E(XY) = (0*0)*p(X = 0,Y = 0) + (1*0)*p(X = 1,Y = 0) + (0*1)*p(X = 0,Y = 1) + (1*1)*p(X = 1,Y = 1) + (2*0)*p(X = 2,Y = 0) + (0*2)*p(X = 0,Y = 2) = (1*1)*p(X = 1,Y = 1) = 18/780
Now by law of total probabilities:
p(X = 0) = p(X = 0,Y = 0) + p(X = 0,Y = 1) + p(X = 0,Y = 2) = 406/780 + 261/780 + 36/780 = 703/780
p(X = 1) = p(X = 1,Y = 0) + p(X = 1,Y = 1) = 58/780 + 18/780 = /780
p(X = 2) = p(X = 2,Y = 0) = 1/780
So,
E(X) = 0*p(X = 0) + 1*p(X = 1) + 2*p(X = 2) = 76/780 + 2/780 = 78/780
p(Y = 0) = p(X = 0,Y = 0) + p(X = 1,Y = 0) + p(X = 2,Y = 0) = 406/780 + 58/780 + 1/780 = 465/780
p(Y = 1) = p(X = 0,Y = 1) + p(X = 1,Y = 1) = 261/780 + 18/780 = 279/780
p(Y = 2) = p(X = 0,Y = 2) = 36/780
So,
E(Y) = 0*p(Y = 0) + 1*p(Y = 1) + 2*p(Y = 2) = 279/780 + 72/780 = 351/780
So Cov(X,Y) = E(XY) - E(X)E(Y) = 18/780 - ((78/780)*(351/780)) = -0.02192307692
Thank you! Please rate positively if satisfied!