## Welcome to BrainDen.com - Brain Teasers Forum

 Welcome to BrainDen.com - Brain Teasers Forum. Like most online communities you must register to post in our community, but don't worry this is a simple free process. To be a part of BrainDen Forums you may create a new account or sign in if you already have an account. As a member you could start new topics, reply to others, subscribe to topics/forums to get automatic updates, get your own profile and make new friends. Of course, you can also enjoy our collection of amazing optical illusions and cool math games. If you like our site, you may support us by simply clicking Google "+1" or Facebook "Like" buttons at the top. If you have a website, we would appreciate a little link to BrainDen. Thanks and enjoy the Den :-)
Guest Message by DevFuse

# Hats on a death row!! One of my favorites puzzles!

Best Answer bonanova, 08 January 2008 - 06:25 PM

Spoiler for Here's my idea
Go to the full post

471 replies to this topic

### #471 vivekkumarjha

vivekkumarjha

Newbie

• Members
• 2 posts

Posted 13 June 2012 - 06:36 PM

Sorry. I must have missed something in the instructions. This solution only works when there are 10 black hats and 10 red hats. No where in the instructions does it say this. The solution fails if there are different numbers of black and red hats. There could be 19 black hats and 1 red hat.

no the solution doesn't fail.
suppose there are 19 black and 1 red hat
then 20th last prisoner shouts black (key word for black being odd)
he does not know his own hats colour so he may or may not be saved
but the 19th prisoner knows that including his hat there are odd number of black hats, now if he sees even black hats, his hats colour is black, but if he sees odd black colours, his hat colour is red
now suppose he sees odd black colour, then he shouts red
the others keep on counting, this red means red is now odd (key word for red being odd)
the others would keep a note of it and carry on like wise

Edited by vivekkumarjha, 13 June 2012 - 06:37 PM.

• 0

### #472 GaneshJJ

GaneshJJ

Newbie

• Members
• 1 posts

Posted 08 November 2014 - 04:41 PM

THE last person can see 19 hats in front of him. 19 is an odd number. So it is the sum of an even and an odd number. Let us assume that there are 12 black and 7 red hats. The Last man will say the color of the hat of which there are even numbers, in this case black.

The person in front of him can count the number hats he sees.

CASE 1 - He is wearing a red hat. So he sees 12 black hats and 6 red hats. Since he knows that black hats are in even numbers. He discovers that he's wearing a red hat.

CASE 2_ HE is wearing a black hat. So he sees 11 black and 7 red hats. The last guy has told that black hats are in even numbers.
So he discovers that he is wearing a black hat.

Similarly the people in front can find out the color of their hat and thus can save themselves.

The last man can either be wearing a red or a black hat. So that is 2 possibilities and he says one color. So he has a 50% chance to live.

THANK YOU

• 1

#### 0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users