A bunch of men are on an island, A genie comes down and gathers everyone together and places a magical hat on some people’s heads (i e , at least one person has a hat). The hat is magical: it can be seen by other people, but not by the wearer of the hat himself. To remove the hat, those (and only those who have a hat) must dunk themselves underwater at exactly midnight. If there are n people and c hats, how long does it take the men to remove the hats? The men cannot tell each other (in any way) that they have a hat.

**Note:** Genie does not tell how many hats she has put.

Check your answer:-

Click here to See Solution

Lets take some simple cases first

**c = 1:** in this case person who has hat on his head can see that no one else has hat on their head, so he will understand that he is the one with hat.

**c = 2:** in this case person with hat will see one other person with hat, rest all will see two hats. Now had there been only 1 hat, this case would have been solved on very first day, but in this case no one will go on first night, so the guy who see one hat will understand that there must be one hat on his head, so both of them will go underwater on second night.

**c = 3:** in this case person with hat will see two hats and rest all will see three hats, now had there been 1 or 2 hats some guys would have gone on first or second night, thus on third day guys who see 2 hats will understand that they have hats on their head and they will all go underwater on third night.

Similarly we can see that it will take c days to remove all hats.

Piyush Jain says

Hi

For C = 2,3….up to any n answer should be 2 days.

If C=3, in this case person with hat would see the hat on other two people and same would happen with other two persons with the hat and the peron with no hat will see three hats. So first day no one will go as they would be thinking other two will be put in their head. On second day, when third guy will see hat on other two people, he will understand that i have also hat on my head. On the second all three will be put in their head in the water.

Answer should be 2 days

SREELAKSHMI T T says

Its the perfect answer .

Lets imagine

case (1): suppose there where 4 people and 1 hat , the very person wearing the hat will see that there is no hat on any body else’s head. So it shud be on his head and puts head in the very same midni8 .c=1

case (2) :Suppose there where 4 people , 2 having hats , the first day , no one will put head because , two see hats on two other peoples head . They’ll wait for the next day . the second day they’ll see no one has put in head the one having hat understands that he has a hat on his head because if he had’not then there will be only one person having a hat and he would have dunk his head yesterday itself and he can see the other persons having no hats .So the second should be he .Both of them will dunk their heads in the second day .c=2

case (3) : if there where 4 people and 3 having hats , none of them will dunk their heads 1st day because they see hats on other people’s head .

The second day also no one will dunk . This shows that there are more than two people wearing hats .Or else it wud have been case (2). On the third day person wearing a hat sees only 2 persons wearing hats , so he comes to know the third guy should be him .This way three of them will dunk their heads on the third day . c=3

Apply the same for “n” no people . It works , Truly Logical

Deepak says

perfect answer buddy thats wat i think off 🙂

Juggy says

Perfect!

SREELAKSHMI T T says

🙂

shubhangi garg says

But , In question it is mentioned that people dont know how many hats are there in total. suppose there are 4 people and 2 hats. Then how 4 people know that there has to be only two hats. it can be possible there are 1, 2, 3, 4 hats.

SACHIN SHARMA says

This is wrong answer.. Bcs in this no one knows how many hats there are.. And no one can tell others.. So if c=2 then how will they know on second day that they have cap on their head. The person who see one hat can think that he may or may not have a hat. So y will he go under water if he is not sure..???

Deepak says

beta tum se b na ho payega

Jagmohan Singh says

As the question suggests their needs to be at-least one hat present, if a guy find out that no one is wearing a hat he will get certain that he is the one wearing it, on the second case if he finds out that one is wearing the hat he will wait one day for him to see whether he is getting rid of that hat or not if the another guy dont then he will get that he too is wearing one of the two hats, on the third case every person having a hat will see 2 person wearing a hat, so he need to wait 2 days to check whether those guys(wearing hats) are getting rid of the hat or not, if they dont he will understand that he too is having one of those hat and he needs to go in the mid-night to get rid of it.

Naveen kumar says

Y will one dunk in water, if he doesn’t know he has hat on him.

Ans can not be C.

Ans should be infinity. 😀

SACHIN SHARMA says

Yes i think u r correct.. Well i too have a doubt.

vasu says

Here assumption is pretty clear, atleast one person has a hat. The person who has hat in the first round sees that no other person having hat.. this mean he is the one with hat and hence dunks

sanganna. s says

this is true if only 1 hat is put to 1 person, other 3 heads without hats , and weared one will go to water ,but

if 2 hats are put on 2 persons , how can those weared persons get to know hat is put on us …..????? Take 2 hats nad 4 persons as example.

Shashank Shekhar says

lets take example of 4 persons… assume persons are p1,p2,p3 and p4.

One Hat(c=1)- This is very clear i m sure so when the person who is having hat can’t see on others he will be very sure and he will dunk on very first night.

Two Hat(c=2)- Now assume p1 and p3 having hat so how all 4 persons will think on —

Day1:

p1- I can see only 1 hat on p3 thanks Genie I wouldn’t go in Water its really chilled in midnight.

p2- I can see 2 hats on p1 and p3 thanks Genie u saved me this time.

p3- I can see only 1 hat on p1 yippee I will be safe from cold water.

p4-I can see 2 hats on p1 and p3 thanks Genie u saved me this time.

—- So no one will dunk in water on Day1 midnight.

Day2:

p1- What d hell p3 still having hat-on..sucks man that mean there must be another hat which p3 can see otherwise like one hat case he would have dunk yesterday only and I know p2 and p4 does’t have any hats so this is confirmed m having a hat 🙁

p2- I can see 2 hats on p1 and p3 thanks Genie u saved me this time.

p3-What d hell p1 still having hat-on..sucks man that mean there must be another hat which p1 can see otherwise like oneHat-case he would have dunk yesterday only and I know p2 and p4 does’t have any hats so this is confirmed m having a hat 🙁

p4-I can see 2 hats on p1 and p3 thanks Genie u saved me this time.

—So on Day 2 both p1 and p3 would have 100% sure they are having hats on their head and as per rule they have to Dunk in water to get rid of it.

Hopefully it is clear now 😀

Deepak says

beta tum se na ho payega tum rehne do