Team-BHP > Shifting gears
Register New Topics New Posts Top Thanked Team-BHP FAQ


Reply
  Search this Thread
2,832 views
Old 22nd April 2005, 21:14   #1
BHPian
 
Join Date: Sep 2004
Location: Bangalore
Posts: 211
Thanked: 222 Times
A few puzzles

Postng a few puzzles for the interested...

1. There are 10 prisoners. The king announces that he shall make each one of them wear a hat - either black or white in colour. Each person can see the other 9 prisoners' hat but not his own. The king shall ask each prisoner the colour of his hat, if the answer is right he is spared else killed.
The prisoners are told to devise a strategy such that maximum people can be saved. So how many can be saved and what is the strategy?

2. There are 12 *****, numbered 1 to 12 and one of these has a bias (do not know which one and wether it is light or heavy). Can you find out which is the "biased ball" in 3 attempts?

Not too tough ones, see how much time you take...

~maniac
serious_maniac is offline  
Old 22nd April 2005, 21:23   #2
Senior - BHPian
 
Shan2nu's Avatar
 
Join Date: Feb 2004
Location: Hubli - Karnata
Posts: 5,533
Thanked: 125 Times

Quote:
There are 10 prisoners. The king announces that he shall make each one of them wear a hat - either black or white in colour. Each person can see the other 9 prisoners' hat but not his own. The king shall ask each prisoner the colour of his hat, if the answer is right he is spared else killed.
The prisoners are told to devise a strategy such that maximum people can be saved. So how many can be saved and what is the strategy?
How many black hats and how many white ones? Coz if it's 5 black and 5 white, you don't need to worry much.

Shan2nu
Shan2nu is offline  
Old 22nd April 2005, 21:42   #3
BHPian
 
Join Date: Sep 2004
Location: Bangalore
Posts: 211
Thanked: 222 Times

Quote:
Originally Posted by Shan2nu
How many black hats and how many white ones? Coz if it's 5 black and 5 white, you don't need to worry much.

Shan2nu

Then all 10 can be saved, cos everybody knows what the other 9 are wearing and he find out his own

you can say they choose from a box with infinite black and white caps... so the colour of one's cap is independent of what colour cap others are wearing

~maniac

Last edited by serious_maniac : 22nd April 2005 at 21:58.
serious_maniac is offline  
Old 23rd April 2005, 00:10   #4
Newbie
 
iomega's Avatar
 
Join Date: Mar 2005
Location: Chennai
Posts: 12
Thanked: 0 Times

If it is totally random.. then there is no way of identifyin the colour of the prisoners cap to any degree of accuracy;. it can be guessed however..

Ram
iomega is offline  
Old 23rd April 2005, 00:14   #5
Senior - BHPian
 
Shan2nu's Avatar
 
Join Date: Feb 2004
Location: Hubli - Karnata
Posts: 5,533
Thanked: 125 Times

One way i can think of is, if all the prisoners come to an understanding that they will blink once if the guy in question is wearing a white hat and twice if he's wearing a black one.

Shan2nu
Shan2nu is offline  
Old 23rd April 2005, 12:30   #6
BHPian
 
Join Date: Sep 2004
Location: Bangalore
Posts: 211
Thanked: 222 Times

All need not be saved.. what is the strategy that prisoners should evolve among themselves to save maximum people, even if it means sacrificing a few lives!!!
The only way they can transmit information is by giving a clue to others by telling/guessing the colour of their own hat...

e.g. if you want to save 5 people out of 10, then the first prisoner tells the colour of the second prisoner's hat.... so second prisoner can get saved.. the third prisoner does the favour for the fourth guy and so on... so 5 of them can get saved... but ofcourse the actual answer is more than 5...



Clue : The strategy was easy for prisoners if they were computer geeks!!


~maniac
serious_maniac is offline  
Old 25th April 2005, 13:46   #7
BHPian
 
Join Date: Sep 2004
Location: Bangalore
Posts: 211
Thanked: 222 Times

The answer to the 1st puzzle:

The trick lies in using binary numbers (remember it is easier for computer geeks). Lets say the prisoners decide on a colour code : black =0, white = 1. Three prisoners (the first in the line) agree to count the number of white caps in the remaining 7 prisoners and represent that in binary.

Lets say the first three prisoners notice that 5 prisoners among the remainig 7 are wearing white caps. Then they represent this in the form of a binary number i.e. 101. So the first 3 prisoners respond white-black-white (101).

The 7 prisoners now know that among them they have 5 prisoners with white caps. Now each of them can see the colour of remaining 6 people.. and thus can deduce the colour of his cap...

Thus 7 prisoners can be saved and 3 prisoners agree to sacrifice their lives.

Will post the soution to the second one later...

~maniac
serious_maniac is offline  
Old 25th April 2005, 14:16   #8
Senior - BHPian
 
Gordon's Avatar
 
Join Date: Feb 2004
Location: Mumbai
Posts: 2,549
Thanked: 496 Times

I didn't understand anything though I've done I.T. Its going completely bouncer. And there can be innumerable ways. All 10 can also be saved. If all cannot be saved, the information provided is incomplete or the situation is being seen by one point of view only, ie, computer logic.
Gordon is offline  
Old 25th April 2005, 14:22   #9
Senior - BHPian
 
Gordon's Avatar
 
Join Date: Feb 2004
Location: Mumbai
Posts: 2,549
Thanked: 496 Times

okay read it again properly and I feel that the logic isn't right.....they can also device another plan like this.

One person sacrifices his life. White=1; Black=0.

That one person can see everyone and will just call out the numbers to the rest. So now nine of them know how many white and black caps are there.
Gordon is offline  
Old 25th April 2005, 14:45   #10
BHPian
 
Join Date: Sep 2004
Location: Bangalore
Posts: 211
Thanked: 222 Times

Well ..
- A prisoner is allowed to answer only "black" or "white". He cannot say anything else. What I meant in my solution was that the first 3 people indicate a colour, which can be decoded to 0s & 1s and thus can be represented in binary.

- Another sub-optimal solution where 6 prisoners can be saved is - if the first prisoner says Black then the cap colours of the next 2 prisoners (2nd & 3rd) is different. Thus both 2nd and 3rd prisoner know the colours of their caps. If first prisoner says White then the cap colours of 2nd & 3rd prisoners are same. Then also 2nd & 3rd can be saved. This can be repeated for 9 prisoners (6 are saved). The 10th one takes a guess.

You cannot save more than 7. Try that out!!

~maniac
serious_maniac is offline  
Old 25th April 2005, 15:51   #11
Senior - BHPian
 
Gordon's Avatar
 
Join Date: Feb 2004
Location: Mumbai
Posts: 2,549
Thanked: 496 Times

the guy is surely gonna die, so even if he answers something else, what difference would it make??! as I said the puzzle was incomplete. It wasn't mentioned that he can only answer "black" or "white".
Gordon is offline  
Old 25th April 2005, 23:08   #12
BHPian
 
aveek's Avatar
 
Join Date: Feb 2005
Location: Bangalore
Posts: 294
Thanked: 2 Times

1. What if two prisioners identified each other as white and black hats. They then proceeded to marshall the other prisioners inot two groups - namely black and white. Then the groups would be segregated, and the two in charge could join the groups and know thir hat colour....

2. Take 6 and six ***** on either side of the weighing scale. From the heavier side, make it 3 and three and place them on the weighing scale. From the heavier group, take any two and place them on either side of the weighing scale. If they are equal in weight, the last on eis the biased one. If one is heavier, that is the biased one.
(This is assuming taht we know that it is heavier. If it lighter, then we choose the other group from the start, and eliminate the heavier sections, though following the same procedure.)
aveek is offline  
Reply

Most Viewed


Copyright ©2000 - 2024, Team-BHP.com
Proudly powered by E2E Networks