Expectation E(XY) of two dependent variables
If X and Y are 2 dependent variables, how does their combined expectation look? For example, if flipping a fair coin n times, with X representing the number of heads and Y representing the number of tails. How would I calculate E[XY], and what's the intuition behind it?
$\endgroup$ 11 Answer
$\begingroup$In your example of coin tosses, you actually have $Y=n-X$. So $E[XY]=E[X(n-X)]= nE[X] - E\left[X^2\right]$.
Since $X\sim \mathrm{Binomial}(n,p)$, where $p$ is the probability of heads on a single coin toss, you can calculate this by using the formula for $E[X]$ and $E\left[X^2\right]$ when $X$ has such distribution. (You can find the formula for $E\left[X^2\right]$ at Calculating the Second Moment of a Binomial Random Variable.)
$\endgroup$ 6