anyone would help me in a basic example?
a fair coin is tossed, n times. X is the number of Head and Y is the number of Tails. what is the COV(X,Y).
anyone would help me in a basic example?
a fair coin is tossed, n times. X is the number of Head and Y is the number of Tails. what is the COV(X,Y).
Copyright © 2021 JogjaFile Inc.
$$ X+Y = n $$ therefore $$ E(Y) = E(n) - E(X) = n - E(x) $$ now we have $$ \mathrm{Cov}(X,Y) = E\left[(X-E(X))(Y-E(Y))\right] $$
but we know that $$ Y-E(Y) = n-X - \left(n-E(x)\right)= -X + E(X) = -(X-E(X)) $$ thus $$ \mathrm{Cov}(X,Y) = E\left[(X-E(X))\cdot -(X-E(X))\right] = -E\left[(X-E(X))^2\right] = -\mathrm{Var}(X) = -np(1-p) $$ so you are right with $\mathrm{Cov}(X,Y) = -\dfrac{n}{4}$