3
Covariance
Note 16
(a) We have a bag of 5 red and 5 blue balls. We take two balls uniformly at random from the bag without
replacement. Let
X
1
and
X
2
be indicator random variables for the events of the first and second ball
being red, respectively. What is cov
(
X
1
,
X
2
)
? Recall that cov
(
X
,
Y
) =
E
[
XY
]

E
[
X
]
E
[
Y
]
.
(b) Now, we have two bags A and B, with 5 red and 5 blue balls each. Draw a ball uniformly at random
from A, record its color, and then place it in B. Then draw a ball uniformly at random from B and record
its color. Let
X
1
and
X
2
be indicator random variables for the events of the first and second draws being
red, respectively. What is cov
(
X
1
,
X
2
)
?
CS 70, Summer 2023, DIS 5C
2
1
ball
is
red
xi3xi:
2o
ball
is
blue
p
=
F
=
COV(X,,
X2)
=
ECX,
Xc]
ECX,3
E(X2]
E(X,]
=
I
FCX2)
=
I
by
symmetry
since
we
don't
know
what
first
ball
is
E(X,X2)
=
P(X,
=
11X2
=
1)
=
P(X,
=
1]P(Xz
=
1(X,
=
1)
=
I
=
COV(X,X2)
=
2

5
=

4
=

55
Yi3x::
.
.
e
COV(X,,
X2)
=
FCX,
X27ECX,7ECX2]
E(X,)
=
I
F(X)
=
=
+
I
=
I
by
symmetry,
50%
chance
of


I
redtred
blue+red
getting
+
or
1
E(X,Xz)
=
P(X,
=
11X2
=
1)
=
5.4
=
π
covIX,X2)
=

It
=
π

4
=
y