PuzzlersWorld.com

  • Hacker Puzzle
  • Interview Puzzles
  • Number Puzzles
  • Maths Puzzles

Genie with c hats

(25 votes, average: 2.96 out of 5)

November 14, 2014 by puzzler 15 Comments

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:-

Tried enough already?


Click here to See SolutionHide

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.

  • Share on Whatsapp
  • Share on Facebook
  • Share on Twitter
Facebook Comments
Next Puzzle
100 floors with 2 eggs puzzle

Checkout more Interview Puzzles Tags: Interesting Puzzles, Solved Puzzles

Comments

  1. Piyush Jain says

    June 25, 2017 at 9:12 pm

    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

    Reply
  2. SREELAKSHMI T T says

    May 15, 2015 at 12:48 pm

    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

    Reply
    • Deepak says

      July 18, 2015 at 2:40 am

      perfect answer buddy thats wat i think off 🙂

      Reply
    • Juggy says

      February 1, 2016 at 4:24 pm

      Perfect!

      Reply
      • SREELAKSHMI T T says

        February 7, 2016 at 5:18 pm

        🙂

        Reply
    • shubhangi garg says

      December 27, 2016 at 8:48 pm

      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.

      Reply
  3. SACHIN SHARMA says

    May 13, 2015 at 8:26 pm

    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..???

    Reply
    • Deepak says

      July 18, 2015 at 2:41 am

      beta tum se b na ho payega

      Reply
    • Jagmohan Singh says

      July 31, 2016 at 10:45 pm

      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.

      Reply
  4. Naveen kumar says

    March 5, 2015 at 8:32 pm

    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. 😀

    Reply
    • SACHIN SHARMA says

      May 13, 2015 at 8:26 pm

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

      Reply
      • vasu says

        July 3, 2015 at 10:35 am

        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

        Reply
        • sanganna. s says

          July 15, 2015 at 1:03 pm

          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.

          Reply
          • Shashank Shekhar says

            December 27, 2015 at 9:01 pm

            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

      July 18, 2015 at 2:40 am

      beta tum se na ho payega tum rehne do

      Reply

Leave a Comment Cancel reply

Submit your Puzzle

You may also like

  • Red and blue balls
  • Two Numbers?
  • Bridge
  • 100 floors with 2 eggs puzzle
  • 4 bottles and water puzzle
  • GPS and Battery Puzzle
  • Days of month using 2 dice
  • Hour glass problem
  • Paradox Dragons
  • River crossing: she-goat, wolf and cabbage

Categories

  • Aive hi Puzzles
  • Akbar and Birbal
  • Alphabetical Puzzles
  • Bollywood Puzzles
  • Google Code jam
  • Hindi Riddles
  • Interview Puzzles
  • Interview Questions
  • Logical Puzzles
  • Malayalam Puzzles
  • Maths Puzzles
  • Miscellaneous
  • Number Puzzles
  • Picture Puzzles
  • Riddles
  • Tamil Puzzles
  • Technical

Social

  • View puzzlersworld’s profile on Twitter
privacy policy

Copyright © 2025 · eleven40 Pro Theme on Genesis Framework · WordPress · Log in

  • Hacker Puzzle
  • Logo Puzzles
  • Optical Illusions
  • WhatsApp Puzzles
  • Picture Puzzles
  • Riddles
    ▼
    • Hindi Riddles
  • Bollywood Puzzles
  • Alphabetical Puzzles
  • Aive hi Puzzles
  • Interview Puzzles
  • Logical Puzzles
  • Interview Questions
    ▼
    • Data Structures
    • Binary Tree
    • Algorithms
    • Recursion Questions
    • Amazon Interview Questions
    • Snapdeal Interview Questions
    • Google Code jam
  • Technical
  • Akbar and Birbal
  • Number Puzzles
  • Maths Puzzles
  • Miscellaneous