Why $E[X_iX_j] = P(X_i=1, X_j=1)$?

74 Views Asked by At

This is a probability problem.

At a party, n people put their hats and they handed in their own hats into a box.

After enjoying party, they picked up one of them.

\begin{align} X_iX_j&=\left\{ \begin{array}{ccc} 1 & \mbox{if the ith and jth party goers both select their own hats.}\\ 0 & otherwise. \end{array} \right. \end{align}

\begin{align} E[X_iX_j]&=P\{X_i=1, X_j=1\}\\ &=P(X_i=1)P(X_j=1|X_i=1)\\ &=\frac1n \frac1{n-1} \end{align}

In this process, I don't understand where and how $E[X_iX_j]=P\{X_i=1, X_j=1\}$ come into existence. Please give me some hints or explanation? thank you!

1

There are 1 best solutions below

3
On BEST ANSWER

Since $X_i,X_j$ take values in $\{0,1\}$, the product $X_iX_j$ is equal to $1$ if $X_i=X_j=1$, and 0 if at least one of the two is $0$.

So $$\begin{align}\mathbb{E}[ X_iX_j ] &= 1\cdot \mathbb{P}\{X_i=1\text{ and }X_j=1\}+ 0\cdot \mathbb{P}\{X_i=0\text{ or }X_j=0\} \\&= \mathbb{P}\{X_i=1\text{ and }X_j=1\}\end{align}$$ by definition of the expectation as $\mathbb{E}[Z]=\sum_{a} a \mathbb{P}\{Z=a\}$ (for $Z$ being a discrete random variable).