Hat Problem

'n' people go to a party and drop off their hats to a hat-check person.When the party is over, a different hat-check person is on duty and returns then hats randomly back to each person. What is the expected number of people who get back their hats?

This problem is a classic example of a derangement problem, where the goal is to find how many people receive their own hat when hats are returned at random. Let's walk through the reasoning step by step to find the expected number of people who get back their own hats.

Key Points:

  • We have nn people.
  • Each person has dropped off their hat with a hat-check person.
  • The hats are returned randomly.

We need to calculate the expected number of people who will get their own hat back.

Solution Outline:

Let XiX_i be an indicator random variable for each person ii, where:

Xi={1if person i gets their own hat back,0otherwise.X_i = \begin{cases} 1 & \text{if person } i \text{ gets their own hat back}, \\ 0 & \text{otherwise}. \end{cases}

Thus, the total number of people who get their own hats back is the sum of all these indicator variables:

X=X1+X2++XnX = X_1 + X_2 + \dots + X_n

Now, we want to find the expected value of XX, i.e., E[X]\mathbb{E}[X]

Step 1: Calculate the Expected Value of XiX_i

Since XiX_i

is an indicator random variable, the expected value of 
XiX_i is simply the probability that person ii gets their own hat back:

E[Xi]=P(person i gets their own hat)\mathbb{E}[X_i] = \mathbb{P}(\text{person } i \text{ gets their own hat})

When the hats are returned randomly, the probability that any person gets their own hat is 
1n\frac{1}{n}, because there are nn hats and each one is equally likely to be returned to any person.

Thus, for any ii:

E[Xi]=1n\mathbb{E}[X_i] = \frac{1}{n}

Step 2: Calculate the Expected Value of XX

Since X=X1+X2++XnX = X_1 + X_2 + \dots + X_n, we can use the linearity of expectation:

E[X]=E[X1]+E[X2]++E[Xn]\mathbb{E}[X] = \mathbb{E}[X_1] + \mathbb{E}[X_2] + \dots + \mathbb{E}[X_n]

Each E[Xi]=1n\mathbb{E}[X_i] = \frac{1}{n}    so:

E[X]=n×1n=1\mathbb{E}[X] = n \times \frac{1}{n} = 1

Conclusion:

The expected number of people who get their own hats back is 1, regardless of how many people are at the party.

This result might be surprising, but it reflects the fact that, on average, only one person is expected to get their own hat back in this random hat-return scenario.


Comments

Popular posts from this blog

Algorithmic Thinking with Python UCEST 105- KTU First Semester BTech Course 2024 scheme notes pdf - Dr Binu V P 9847390760

Heuristic Method

Problem-Solving Strategies