At a party N men throw their hats into the center of a room. The hats are mixed up and each man randomly selects one. Find the expected number of men who select their own hats.
Letting X denote the number of men that select their own hats, we can best compute E[X] by noting that
X=X1+X2+⋅⋅⋅+XNwhere
Xi={1,0,if the ith man selects his own hat otherwiseNow, because the ith man is equally likely to select any of the N hats, it follows that
P{Xi=1} = P{ith man selects his own hat} = N1
and so
E[Xi]=1P{Xi=1}+0P{Xi=0}=N1Hence, from Equation (2.11)
E[a1X1+a2X2+⋅⋅⋅+anXn]=a1E[X1]+a2E[X2]+⋅⋅⋅+anE[Xn] (2.11)
we obtain
E[X]=E[X1]+⋅⋅⋅+E[XN]=(N1)N=1Hence, no matter how many people are at the party, on the average exactly one of the men will select his own hat.