Covariance from PMF chart

Suppose the joint PMF of X and Y is given by this chart:

Y↓X→12
−10.20.2
00.350.1
10.050.1

Find Cov[X,Y].

Solution

We need E[X] and E[Y] and E[XY].

E[X]=1⋅(0.2+0.35+0.05)+2⋅(0.2+0.1+0.1)≫≫1.4 E[Y]=−1⋅(0.2+0.2)+0⋅(0.35+0.1)+1⋅(0.05+0.1)≫≫−0.25 E[XY]=−1⋅(0.2)−2⋅(0.2)+0+1⋅(0.05)+2⋅(0.1)≫≫−0.35

Therefore:

Cov[X,Y]=E[XY]−E[X]E[Y]≫≫−0.35−(1.4)(−0.25)≫≫0

Variance of sum of indicators

An urn contains 3 red balls and 2 yellow balls.

Suppose 2 balls are drawn without replacement, and X counts the number of red balls drawn.

Find Var[X].

Solution

Let X1 indicate (one or zero) whether the first ball is red, and X2 indicate whether the second ball is red, so X=X1+X2.

Then X1X2 indicates whether both drawn balls are red; so it is Bernoulli with success probability 3524=310. Therefore E[X1X2]=310.

We also have E[X1]=E[X2]=35.

The variance sum rule gives:

Var[X]=Var[X1]+Var[X2]+2Cov[X1,X2]≫≫E[X12]−E[X1]2+E[X22]−E[X2]2+2(E[X1X2]−E[X1]E[X2])≫≫35−(35)2+35−(35)2+2(310−35⋅35)≫≫925