Case 1:
when one person is wearing hat.The person wearing hat will see that no
other is wearing hat.hence he must be wearing it.So she will take it
off.hence one day
Case 2:
when two persons are wearing,first will think..that only second one is
wearing..while second will think only first one is wearing.hence no
one will go on first day.
on the second day..when both will see the same thing..they will come
to know..that they are also wearing hat..and making the second one
confused ;)  hence..they both will go and take off hat on second day.
Case 3:
first person sees hat on two others.(same for other two). no one will
go on first day.
On second day..same situation..bt this time the person is still
unsure..wether she is wearing hat or not..bcoz case 2 can happen..
on third day..when same situation arises...they will come to
know..that they are also wearing hat..hence..they will take it off on
day 3.
so on..
so on..
For C hats...C dayz...

On Aug 18, 4:06 pm, DheerajSharma <dheerajsharma1...@gmail.com> wrote:
> it would take c days to take off all the hats
>
> On Aug 18, 3:51 pm, "pg@manit" <gpt.pa...@gmail.com> wrote:
>
>
>
>
>
>
>
> > 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.
> > FOLLOW UP
> > Prove that your solution is correct.

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to