calculate expected value of the product of two non independent random variables I've got two independent bernoulli distributed random variables $X$ and $Y$ with parameter $\frac{1}{2}$. Based on those I define two new random variables 
$X' = X + Y , E(X') = 1$
$Y' = |X - Y|, E(Y') = \sum_{x=0}^1\sum_{y=0}^1|x-y|*P(X=x)*P(Y=y) = \frac{1}{2}$ 
How can I calculate E(X'Y')? As X' and Y' and not independent (e.g. it is impossible for Y' to assume 1 if X' is 0) I must not use the sum of all possible outcomes multiplied with their likelihood as I did for $E(Y')$ but I cannot find another formula to calculate the expected value.
 A: Someone else can answer more authoritatively for the general case, but for a small experiment such as this one can we build up all possible values of $X' \cdot Y'$ from the four possible outcomes of $(X,Y)$?
$$
\begin{array}{l|l|l|l|l}
(X,Y) & X' & Y' & X' \cdot Y' & P(\ \ ) \\
\hline
(0,0) & 0 & 0 & 0 & \frac{1}{4} \\
(0,1) & 1 & 1 & 1 & \frac{1}{4} \\
(1,0) & 1 & 1 & 1 & \frac{1}{4} \\
(1,1) & 2 & 0 & 0 & \frac{1}{4}
\end{array}
$$
So $P(X'Y'=0) = P(X'Y'=1) = \frac{1}{2}$ and $E(X'Y') = 0 \cdot \frac{1}{2} + 1 \cdot \frac{1}{2} = \frac{1}{2}$.
A: For general dependent variables with finite variance, $E((X'-E(X'))(Y'-E(Y')))$ could be anything between $-\sqrt{E((X'-E(X'))^2) E((Y'-E(Y'))^2)}$ and $\sqrt{E(X'^2) E(Y'^2)}$. The fact that this must hold follows from the Cauchy-Schwarz inequality, while the fact that any value can be attained can be proven by construction.
So there is no general solution; you must find the joint distribution function and calculate the expectation directly. In this particular case you have a discrete variable that takes on at most $4$ values (one for each possible pair $(X,Y)$). So this is not too hard to do (tau_cetian has already done it).
