# Hat Matching Problem - which sample points belong to $A_k$ where $k^{th}$ guest goes home with their own hat, $k = 1,2,…,n$?

Guests throw their hats into a pile, and when they leave they pick up a random hat. $A_k$ is the event that the $k^{th}$ guest goes home with their own hat, $k=1,2,...,n$.

Describe a sample space first then calculate the probability of $A_k$ occurring by finding which of the sample points belong to $A_k$...I'm not sure how to do this it's kind of confusing. I read up on derangements but am still in the dark.

• The sample space $\Omega$ contains all possible outcomes of a random experiment, which is, here, guests picking at random their hats from a pile. So, what are the outcomes? – Samrat Mukhopadhyay Mar 12 '15 at 13:17
• Also, I think you want to say that $A_k$ is the event that the $k$ th guest takes his hat to home. – Samrat Mukhopadhyay Mar 12 '15 at 13:18
• @SamratMukhopadhyay Yeah sorry, I've corrected that now. All the possible outcomes is like n! isn't it...? There are n guests and hats, so n! ways in which the hats can be ordered between the guests. But I don't get how to calculate which sample points belong to A_k. There is a 1/n chance for the first person to get his hat for k=1, then for k=2 guest 2 has a 1/n-1 chance provided person 1 didn't take their hat, which is 1/n, so probability for k=2 is 1/n-1 multiplied by 1/n which is 1/n(n-1)...I don't know where I'm going with this though :/ – Wolverine Mar 12 '15 at 16:02

As you point out in your comment above, the sample space is the set consisting of all possible arrangements of hats with guests. The size of this set is therefore $n!$.
For the event $A_k$, the $k^{th}$ hat must be with the $k^{th}$ guest but the remaining $n-1$ hats can be arranged in any order. There are $(n-1)!$ such arrangements so this is the size of set $A_k$.
Since all outcomes in $\Omega$ are equally likely,
$$P(A_k) = \dfrac{|A_k|}{|\Omega |} = \dfrac{(n-1)!}{n!} = \dfrac{1}{n}.$$