Let $X$ be the number of heads showing, and let $Y$ be the number of tails showing. Compute $Cov(X, Y)$ and $Corr(X, Y)$.

1.4k Views Asked by At

Suppose you flip four fair coins. Let $X$ be the number of heads showing, and let $Y$ be the number of tails showing. Compute $Cov(X, Y)$ and $Corr(X, Y)$.

Although it is not stated, it is clear that $X,Y$ are Binomial to $n=4, \theta=1/2$.

Thus we know that variance of a binom dist is $n\theta(1-\theta)=1$ in our case.

We also know that the expectation of a binom dist is $n\theta=2$ in our case.

Thus, our formula becomes:

$cov(X,Y)=E(XY)-E(X)E(Y)=E(XY)-(2)(2)$

How do I calculate $E(X)E(Y)$?

Can I treat $X$ and $Y$ as independent?

2

There are 2 best solutions below

0
On BEST ANSWER

$E(X)=E(Y)=2$ as you computed. $E(X^2)=E(Y^2)=5$, so $Var(X)=Var(Y)=1$ and $E(XY)=E(X(4-X))=4E(X)-E(X^2)=3$, so $Cov(X,Y)=-1$ and $Cor(X,Y)=-1$.

2
On

How do I calculate $E(X)E(Y)$?

You just did. You likely mean $E(XY)$.

Can I treat $X$ and $Y$ as independent?

No, they are clearly very dependent, and indeed $Y=4-X$ is a linear relation, so you immediately know the correlation coefficent.

You might use $\mathsf E(XY)=\mathsf E(4X-X^2)$, so $\mathsf {Cov}(X,Y)=\mathsf E(4X-X^2)-\mathsf E(X)(\mathsf E(4-X)$

In short: $$\mathsf Cov(X,Y)~{=\mathsf Cov(X,4-X) \\= -\mathsf Var(X)}$$

And you know the variance of a binomially distributed random variable.

From this you can calculate the correlation coefficient, if feel the you need to.