In my latest interview I encountered the following puzzle. There are 100 prisoners in the prison. All of them have either black or white cap.
Jailer has asked them to stand in the queue such that nth guy can see caps of all the guys standing ahead of him, but he can not see his own cap. It means Guy standing at 100th position can see caps of all other 99 guys. Prisoner standing at 99th position can see caps of rest of 98 guys standing ahead of him. Now jailer proposes to release the guy who can guess correct color of his own cap. Assuming All the prisoner are nice guys ;), who can sacrifice for others, device a method which can help to release maximum number of prisoners. On Fri, Jul 22, 2011 at 7:46 PM, Vishal Jain <[email protected]> wrote: > Hi All, > > In my last interview(given few months back), I was asked the following > puzzle.. > > http://goo.gl/jrnpc > > Could you please tell me the solution for the same? > > Thanks & Regards > Vishal Jain > MNo: +91-9540611889 > Tweet @jainvis > Blog @ jainvish.blogspot.com > Success taste better when target achieved is bigger. > > P *We have a responsibility to the environment.* > > *Before printing this e-mail or any other document, let's ask ourselves > whether we need a hard copy.* > > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
