0
$\begingroup$

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$
  • $\begingroup$ What you need is the joint distribution of $(X,Y)$. Then e.g. in discrete case $\mathbb EXY=\sum_{x,y}xyP(X=x,Y=y)$. If there is a PDF then $\mathbb EXY=\int xyf_X(x,y)dxdy$ (both under condition that the expectation exists, of course). In your example we are dealing with the ultimate counterpart of being independent. $\endgroup$ – drhab May 20 at 12:44
0
$\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$
  • $\begingroup$ What if X and Y are correlated but not mirrors of each other? For example throwing a die, where X is the case that 3 is received and Y is the case that 4 is received $\endgroup$ – EliT May 20 at 12:36
  • $\begingroup$ You mean $X$ is the number of $3$'s rolled in $n$ rolls and $Y$ similarly for $4$? $\endgroup$ – Minus One-Twelfth May 20 at 12:39
  • $\begingroup$ X represents the number of 3's, Y the number of 4's yes $\endgroup$ – EliT May 20 at 12:43
  • $\begingroup$ $\newcommand{\Cov}{\operatorname{Cov}}$In that case, we have $E[XY] = \left(n^2-n\right)\cdot \frac{1}{6}\cdot\frac{1}{6}$. This is a special case of the general fact that if $(X_1,\ldots, X_k)$ has a multinomial distribution with $n$ trials and success probabilities $p_1,\ldots , p_k$, then $E\left[X_i X_j\right] = \left(n^2-n\right)p_i p_j$. See e.g. here for a proof of this, and search up "multinomial distribution" online for more information about this distribution. $\endgroup$ – Minus One-Twelfth May 20 at 12:46
  • $\begingroup$ (Note in that link, their $r$ is my $n$ above, and their $n$ is my $k$ above. Also $k=6$ for standard dice rolls.) $\endgroup$ – Minus One-Twelfth May 20 at 12:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.