Let . I’ll show how to calculate . The main purpose of doing this is to illustrate the little trick of reducing complexity of problems by decomposing a complicated random variable into simple ones.
Let , then $$ So, \begin{align} Cov(X_i,X_j) &= Cov(\sum_{l=1}^n Y_{li}, \sum_{m=1}^n Y_{mj})\nonumber\newline &= \sum_{l=1}^n\sum_{m=1}^n Cov(Y_{li}, Y_{mj})\nonumber\newline &= \sum_{m=1}^n Cov(Y_{mi}, Y_{mj})\nonumber\newline &= nCov(Y_{1i}, Y_{1j}) = n(EY_{1i}Y_{1j} - EY_{1i}EY_{1j})\nonumber\newline &= -np_ip_j\nonumber\newline \end{align}