A fair pair of coins

Two independent fair coins. Find P(both heads)\mathbb{P}(\text{both heads}) and E[XY]\mathbb{E}[XY] if a head is coded 11 and a tail 00.

Each head has probability 1/21/2, so both heads have probability 1/41/4. That event is {XY=1}\{XY=1\}, and XYXY is 00 otherwise, so E[XY]=1/4\mathbb{E}[XY]=1/4. This equals E[X]E[Y]=(1/2)×(1/2)\mathbb{E}[X]\mathbb{E}[Y]=(1/2)\times(1/2).