Hat Party!

Suppose you and 5 of your friends each brought a hat to a party. The hats are then put into a large box for a random-hat-draw. What is the probability that nobody selects his or her own hat?


The answer is 0.368.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

4 solutions

Dieuler Oliveira
Aug 3, 2014

The total of possibilities that each person can get their hat is P 6 = 6 ! = 720 P_{6}=6!=720 and the total of possibilities that nobody selects their own hat is: D 6 = 6 ! k = 0 6 ( 1 ) k k ! = 265 , D_{6}=6! \sum_{k=0}^{6}{\frac{(-1)^k}{k!}=265}, so the probability of each person get their wrong hat is: p = 265 720 0.368 . p=\frac{265}{720}\approx\boxed{0.368}. An easier way of calculating D n D_{n} , if you are allowed to use a calculator, is using the relation: D n = [ n ! e ] , D_{n}= \left[{\frac{n!}{e}}\right], then: D 6 = [ 6 ! e ] = [ 264.8732 ] = 265. D_{6}= \left[\frac{6!}{e}\right]=\left[{264.8732}\right]=265.

Sorry for being picky, but I just have a minor correction to suggest. Since we are actually dealing with 6 6 items there would be 265 265 derangements out of a total of 6 ! = 720 6! = 720 possible distributions of the hats. So the probability would then be p = 265 720 p = \frac{265}{720} , which does comes out to 0.368 0.368 to 3 decimal places, ( 44 120 = 0.367 \frac{44}{120} = 0.367 to 3 decimal places).

Brian Charlesworth - 6 years, 10 months ago

Log in to reply

Not picky! You are right! Actually if you round p 5 p_{5} properly, you going to find the same result. I've already fixed it! Thank you!

Dieuler Oliveira - 6 years, 10 months ago

Yeah, this is actually a classic problem (albeit a cool one). The limit as n approaches infinity is 1/e.

Steven Zheng - 6 years, 10 months ago

Log in to reply

How can we get this limit?

Wanchun Shen - 6 years, 8 months ago

I am unable to understand the logic behind the formula you used to find the number of possibilities that nobody gets their own hat. Can you please explain further? Thanks.

Aaryaman Gupta - 5 years, 8 months ago

Log in to reply

These are known as derangements .

Brian Charlesworth - 5 years, 8 months ago

Why isn't this a normal probability problem of the form: The first person has a chance of not picking his hat of 5/6, the second of 4/5 and so on..

5/6 * 4/5 * 3*4 * 2/3 * 1/2 = 0.166666

Why is this thinking wrong?

. . - 2 months, 3 weeks ago

Log in to reply

For example, if the first person picks the second personʻs hat, then the second person has a 5/5 chance to not pick their own hat, because the first person already picked it. And if the second person picks the third personʻs hat as well, the same thing happens.

Red Pizza - 2 weeks, 6 days ago
Satyen Nabar
Sep 28, 2014

This classic problem by Henry Ernest Dudeney has an interesting pattern which bears a mention. The successive solutions for any number of persons from one to eight ---

1= 0

2= 1

3= 2

4= 9

5= 44

6 = 265

7 = 1854

8= 14833

To get these numbers, multiply successively by 2, 3, 4, 5, etc.

When the multiplier is even, add 1; when odd, deduct 1. Thus, 3 × 1 - 1 = 2, 4 × 2 + 1 = 9; 5 × 9 - 1 = 44; and so on.

Or one can multiply the sum of the number of ways for n-1 and n-2 persons by n-1, and so get the solution for n persons.

Thus, 4(2 + 9) = 44; 5(9 + 44) = 265; and so on.

Anna Anant
Dec 27, 2014

Formula for Derangement of n objects is [n!/e] where [.] nearest integer. which is [720/2.7182818284590452353602874713527] = 265. Total possibilities of selecting hats by 6 people is 720. therefore 265/720 = 0.368

Bostang Palaguna
Apr 24, 2020

For this problem, use derangement.

d(n) = (n-1) [d(n-1) + d(n-2)]

with base case d(1) = 0 and d(2) = 1, we get d(6) = 5 x 53 = 165

so P = 165/ 6! = 0.368

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...