Probability – Understanding the Hat Check Problem

expectationprobabilityprobability theoryrandom variables

The famous 'Hat Check Problem' goes like this, 'n' men enter the restaurant and put their hats at the reception. Each man gets a random hat back when going back after having dinner. The goal is to find the expected number of men who get their right hat back. To calculate the expected value from is definition, we have to compute the probability with which 'k' men would get their correct hat back.

enter image description here

How to compute this probablity? I know that this problem can be solved by using 'Linearity of Expectation' in a much simpler way, but i would like to know the way to compute this probablity.

Best Answer

This is an arch-typical example where expectation is much easier than distribution...

There are $n$ hats and each person picks a hat uniformly at random hence each gets their right hat back with probability $\frac1n$. Expectation is linear even when the random variables are dependent hence the mean of the total number of persons who get their right hat back is $n\times\frac1n=1$.