I'm stuck on proving that the product of two Bernoulli variables has expected value equal to the difference between the probability that the variables are the same and the probability that the variables are different.
$$E(XY)= P(X=Y) - P(X \neq Y)$$
I'm stuck on proving that the product of two Bernoulli variables has expected value equal to the difference between the probability that the variables are the same and the probability that the variables are different.
$$E(XY)= P(X=Y) - P(X \neq Y)$$