TITLE: Find E(XY) and covariance
QUESTION [5 upvotes]: I am given n independent Bernoulli trials, prob success = p. If X is # of successes, and Y is the number of failures, what is E(XY) and Cov(X,Y)? I was trying to use E(XY) - E(X)E(Y), the second component is easy, but I can't think of an easy way of finding E(XY) (maybe there isn't any?) Thanks!

REPLY [3 votes]: The number of successes and failures have to add up to $n$, i.e. $X+Y=n$, so you can write
$$E[XY] = E[X(n-X)] = E[nX - X^2] = nE[X] - E[X^2]$$
Does that help?