# Math Help - Expectation -1

1. ## Expectation -1

Let X and Y be two independent indicator random variables, with
P(X=1)=p and P(Y=1)=r. Find E[(X-Y)^2] in terms of p and r.

2. Originally Posted by Yan
Let X and Y be two independent indicator random variables, with
P(X=1)=p and P(Y=1)=r. Find E[(X-Y)^2] in terms of p and r.
Pr(X = 1) = p and Pr(X = 0) = 1 - p.
Pr(Y = 1) = r and Pr(Y = 0) = 1 - r.

$E[(X - Y)^2] = E[X^2 - 2XY + Y^2] = E[X^2] + E[Y^2] - 2 E[XY]$.

E(X) = (1)(p) + (0)(1-p) = p.
E(Y) = r.
E(XY) = (1)(pr) + (0)(1 - pr) = pr.