Question
Suppose n people throw their car keys in a hat and then each picks one key at random. SO what is the expected value of X , the number of people who gets back their own key.
SOLUTION
Lets denote for i th person, a random variable Xi.
If that person goes with his own key then Xi=1 and Xi=0 otherwise.
Here there are N people.
So P(Xi=1)= $ 1/n $
and so that P(Xi=0)= 1-(1/n)
so E[Xi]=$ 1*1/n + 0*(1-(1/n)) $
=$ 1/n $
Now we have X= X1+X2+X3+.....+Xn
So E[X]=E[X1]+E[X2]+E[X3]+.......+E[Xn]
=$ n*(1/n) $
=1