Author |
Topic: MS INterview Question (Read 5614 times) |
|
Joel Burlingham
Guest
|
There are 10 dwarfs of different heights and they get captured by a giant. The giant says, "Tomorrow I am going to put either a red feather or a blue feather on your head. You won't be able to see it. You will have to guess your feather. If you guess wrong, you die. If you guess right you live. I am going to line you up like this:" -----> | | | | | | | | | | | | | | So the tallest guy can see everyone's feathers. But he can't see his own. He will have to either say red or blue. So the dwarves have a night to figure out a plan of what they can do. What is the max guaranteed # of dwarves that can be saved?
|
|
IP Logged |
|
|
|
BNC
Uberpuzzler
Gender:
Posts: 1732
|
|
Re: MS INterview Question
« Reply #1 on: Apr 12th, 2003, 10:38am » |
Quote Modify
|
duplicate of this riddle It's a nice riddle, BTW!
|
|
IP Logged |
How about supercalifragilisticexpialidociouspuzzler [Towr, 2007]
|
|
|
Raymond
Guest
|
|
Re: MS INterview Question
« Reply #2 on: Apr 13th, 2003, 9:24pm » |
Quote Modify
Remove
|
if I'm thinking it right this might be a possible solution: - If we let the dwarfs stand in ascending order then dwarf2 can see dwarf1 and so on......so this way we can save 9 dwarfs at least.... does it makes sense?...
|
|
IP Logged |
|
|
|
aero_guy
Senior Riddler
Gender:
Posts: 513
|
|
Re: MS INterview Question
« Reply #3 on: Apr 13th, 2003, 11:42pm » |
Quote Modify
|
Check the linked discussion. Yours is a seemilngly common mistake.
|
|
IP Logged |
|
|
|
Joel Burlingham
Guest
|
|
Re: MS INterview Question
« Reply #4 on: May 14th, 2003, 9:58am » |
Quote Modify
Remove
|
I'm still not sure about this one.....any help is appreciated.....
|
|
IP Logged |
|
|
|
Ganon
Guest
|
|
Re: MS INterview Question
« Reply #5 on: Feb 8th, 2005, 11:09pm » |
Quote Modify
Remove
|
9. Though the 10th guy has a 50% chance. Think parity bit. Let red feather = 0. Let blue feather = 1. Have the tallest guy count the number of blue feathers mod 2 and say the corresponding feather (ie. say red if he counts even number of blue feathers and blue if he counts an odd number of blue feathers). eg. if the dwarves are 1011011010 (10th guy on left) Then the 10th guy counts 4 blue feathers and says red (blam, he's dead, too bad). The 9th guy knows there are an even number of blue feathers and sees an even number of blue feathers, so he says red and is happy. The 8th guy knows there are an even number of blue feathers left and sees an odd number of blue feathers, so he says blue. The 7th guy knows there are an odd number of blue feathers left (because the 8th guy's was a blue feather) and sees an even number of blue feathers, so he says blue. ...
|
|
IP Logged |
|
|
|
|