Currently, I am given 2 random variables, X and Y. X is given as Binomial (n,p) while Y = n - X. From here, I have worked out the following, $$E(X) = np$$ $$Var (X) = np(1-p)$$ $$E(Y) = n(1-p)$$ $$Var(Y) = np(1-p)$$
I am asked to find the covariance matrix of X and Y, with the matrix given as: $V_{ij} = $ cov($X_i,X_j$) = E[$(X_i - \mu_i)(X_j - \mu_j)$].
The answers provided to me show that the (1,1) entry is actually the variance of X, while the (2,2) entry is the variance of Y, which both work out to be the same. However, I cannot understand why this is so.
Also, the (1,2) and (2,1) entries will also work out to be the same. $V_{12} = V_{21} = E[(X - \mu_x)(Y - \mu_y)] = E[(X - np)(Y - n(1-p))] = -E(X-np)^2$ = -var(X)
Again, for this portion, I cannot work out the final two steps after substituting in the expectation of x and y.
Is there a simple formula or trick that I'm missing here?
$E(X_1-\mu_1)(X_1-\mu_1)=E(X_1^{2}+\mu_1^{2}-2\mu_1X_1)=EX_1^{2}+\mu_1^{2}-2\mu_1\mu_1$ by linearity of expectation and the fact that expectation of a constant is the constant itself. Hence $E(X_1-\mu_1)(X_1-\mu_1)=EX_1^{2}-(\mu_1)^{2}=EX_1^{2}-(EX_1)^{2}=var X_1$. Similarly handle the others.