Saturday, February 20, 2010

That's not my hat ...

After a fun day at the Puzzlarian Picnic, several residents ended up at the Puzzlarian Tavern. At 2AM, the bartender had to ask the last six to leave. Chris, Cam, Knightmare, Karl, Ross and DualAspect had each worn a hat to the picnic that day. However, at 2AM, something had mysteriously blurred the vision of each one, and they could tell which hat each owned. Out of frustration, and the bartender's continuous requests that they go home, each grabbed a hat and left.

Not a single one of the guys grabbed his own hat.!


What is the probability of no one getting the right hat?

11 Comments:

Anonymous Anonymous said...

Not really sure about this one...

On the assumption there are only 6 hats all belonging to the jolly band of chaps,

((n-1)/n)to power of n

i can't find power arrow on my laptop!

=18625/46656 roughly 40% chance of all taking a wrong hat.

regards, curtis

February 20, 2010 4:07 PM  
Blogger Chris said...

This post has been removed by the author.

February 20, 2010 5:00 PM  
Blogger Chris said...

There are 256 ways (how do I know that^^?) that none of them get
the right hat. There are 6! ways that they could select the hats.
So the probability of none of them getting the right hat is:
256/6! ≈ 35.56%. If there were a very large number of hats, then the probability -> 1/e ≈ 36.788%

I'll explain the 256 later.

February 20, 2010 5:12 PM  
Blogger Chris said...

Curtis,. The power arror (caret) is SHIFT+6 on my keyboard.

February 20, 2010 5:16 PM  
Blogger Zaux said...

35.56% as stated by Chris

February 20, 2010 7:08 PM  
Blogger Chris said...

Where did the 256 come from (I don't hear anyone ask :)).

See "The Wrong Letter" for an explanation of the logic. There it's letters into the wrong envelopes, here it's hats on the wrong head (or should that be heads on the wrong hat :~)

If k is the number of hats (and owners) and f[k] is the number
of ways of getting it completely wrong, then f[k] satisfies the
recursion: f[k] = k*f[k-1] + (-1)^k.

Starting at f[1] = 0, we get f[2] = 1, f[3] = 2, f[4] = 9,
f[5] = 44, f[6] = 256, f[7] = 1854...

Also f[k] = k!(1/2! - 1/3! + ... (-)^k/k!).
NB e^x = 1 + x + x²/2! + x³/3!..., so 1/e = 1/2! - 1/3! +...
So, in the limit that k -> ∞, f[k] -> k!/e.

As the probability of no-one getting the right hat is f[k]/k!, this tends to 1/e as k -> ∞

February 20, 2010 9:23 PM  
Anonymous Anonymous said...

Perhaps I have erred, but I get a different result.

for 6 hats
720 total permutations

I find:
265 ways to match exactly 0
264 ways to match exactly 1
135 ways to match exactly 2
40 ways to match exactly 15
0 ways to match exactly 5
1 way to match exactly 6

265/720~=36.806%

Cam

February 20, 2010 10:06 PM  
Anonymous Anonymous said...

That's not my hat ...
6 hats with 6!=6*5*4*3*2*1=720 permutations

xCy= # combinations for x choose y= x!/(y!*(x-y)!)
hx(y)= # of permutations with exactly y right for x hats e.g. h1(0)= # of exactly 0 right for 1 hat=0

Start from simplest situation, and use an iterative approach...

1 hat
1!=1 permutations
h1(1)=# of permutations with exactly 1 right =1
h1(0)=# of permutations with exactly 0 right= 1-(1)=0

2 hats
2!=2*1=2 permutations
h2(2)=# of permutations with exactly 2 right= 2C2*h1(1)=1*1=1
h2(1)=# of permutations with exactly 1 right= 2C1*h1(0)=2*0=0
h2(0)=# of permutations with exactly 0 right=2-(1+0)=1

3 hats
3!=3*2*1=6 permutations
h3(3)=# of permutations with exactly 3 right= 3C3*h1(1)=1*1=1
h3(2)=# of permutations with exactly 2 right= 3C2*h1(0)=3*0=0
h3(1)=# of permutations with exactly 1 right= 3C1*h2(0)=3*1=3
h3(0)=# of permutations with exactly 0 right=6-(1+3)=2
4 hats
4!=4*3*2*1=24 permutations
h4(4)=# of permutations with exactly 4 right= 4C4*h1(1)=1*1=1
h4(3)=# of permutations with exactly 3 right= 4C3*h1(0)=4*0=0
h4(2)=# of permutations with exactly 2 right= 4C2*h2(0)=6*1=6
h4(1)=# of permutations with exactly 1 right=4C1*h3(0)=4*2=8
h4(0)=# of permutations with exactly 0 right=24-(1+0+6+8)=9

5 hats
5!=5*4*3*2*1=120 permutations
h5(5)=# of permutations with exactly 5 right= 5C5*h1(1)=1*1=1
h5(4)=# of permutations with exactly 4 right= 5C4*h1(0)=5*0=0
h5(3)=# of permutations with exactly 3 right= 5C3*h2(0)=10*1=10
h5(2)=# of permutations with exactly 2 right= 5C2*h3(0)=10*2=20
h5(1)=# of permutations with exactly 1 right=5C1*h4(0)=5*9=45
h5(0)=# of permutations with exactly 0 right=120-(1+0+10+20+45)=44

6 hats
6!=6*5*4*3*2*1=720 permutations
h6(6)=# of permutations with exactly 6 right= 6C6*h1(1)=1*1=1
h6(5)=# of permutations with exactly 5 right= 6C5*h1(0)= 6*0=0
h6(4)=# of permutations with exactly 4 right= 6C4*h2(0)=15*1=15
h6(3)=# of permutations with exactly 3 right= 6C3*h3(0)=20*2=40
h6(2)=# of permutations with exactly 2 right= 6C2*h4(0)=15*9=135
h6(1)=# of permutations with exactly 1 right=6C1*h5(0)=6*44=264
h6(0)=# of permutations with exactly 0 right=720-(1+0+15+40+135+264)=265

Finally P=265/720=36.8056%

Cam

February 20, 2010 10:48 PM  
Blogger Chris said...

Cam, you didn't err - I did; I transposed 265 to 256 when I copied it from the linked problem.

So 36.805555...% it is.

Sloppy marking round here Zaux ;)

I've put some more comments on: Six take a test.... Skip straight to Feb 20 7:57 PM. You'll like it.

February 20, 2010 10:57 PM  
Anonymous Karl Sharman said...

I did my basic maths and came up with 265/720=36.805555%

Then I thought that the chances of 6 getting the right hat = 1
Chances of 5 getting right hat is nil
4 right hats - 15 possibilities etc...

The question here is the chances of 5 getting the right hat being nil. Surely 5 could get the right hat, with the one left over going to the correct owner? This would make the 6 getting the right hat having 6 possibilities....

Feel free to shoot this one down in flames, as I can't see how that would work!

February 20, 2010 11:59 PM  
Blogger Chris said...

Hi Karl. I'm not sure if your joking. The 0 means that it's impossible for 5 to have the right hat and for the 6th to have a wrong hat.

February 21, 2010 2:57 PM  

Post a Comment

Links to this post:

Create a Link

<< Home