Puzzle 1 :
What's the number on my hat ?
A goblin forewarns n gnomes as follows : "Tomorrow morning, I shall place one hat on each of you.
Each hat shall be labled with some number drawn from the range [0,N-1]. Duplicates are allowed, so
two different hats might have the same label. Any gnome shall be able to see numbers on other hats but not his own !! When a bell rings, all gnomes shall simultaneously announce one number each. If any gnome succeeds in announcing the number on his own hat, all gnomes shall be set free." The gnomes have assembled in the evening to discuss their predicament. CAN YOU HELP ??
(Recommend you to first try)
MY SOLUTION :
First Attempt : My first guess was that everyone will shout the lowest number they see. In that case let all have different hat numbers from 0 to N-1. In that case, all guys except the one with number 0 shall shout 0; and the guy with number 0 shall start saying "One..." and then immediately change it by shouting 0 (on hearing others). The problem here is, there is a condition that everyone shouts simultaneously.
Second solution : In my second solution, immediately after everyone assembles, they move "steps".Everyone moves, that many number of steps, which he sees to be the minimum number amongst all hats. So in the case of everyone having different numbers, everyone will take 0 steps (i.e., wont move at all) except the guy with number 0, who will move 1 step. But he
will essentially know that 0 is the minimum through this strategy, and thus will shout 0 (along with everyone). In another case, lets assume everyone has the same number. So, everyone will take that number of steps, and will shout that number. Problem Solved.
What's the number on my hat ?
A goblin forewarns n gnomes as follows : "Tomorrow morning, I shall place one hat on each of you.
Each hat shall be labled with some number drawn from the range [0,N-1]. Duplicates are allowed, so
two different hats might have the same label. Any gnome shall be able to see numbers on other hats but not his own !! When a bell rings, all gnomes shall simultaneously announce one number each. If any gnome succeeds in announcing the number on his own hat, all gnomes shall be set free." The gnomes have assembled in the evening to discuss their predicament. CAN YOU HELP ??
(Recommend you to first try)
MY SOLUTION :
First Attempt : My first guess was that everyone will shout the lowest number they see. In that case let all have different hat numbers from 0 to N-1. In that case, all guys except the one with number 0 shall shout 0; and the guy with number 0 shall start saying "One..." and then immediately change it by shouting 0 (on hearing others). The problem here is, there is a condition that everyone shouts simultaneously.
Second solution : In my second solution, immediately after everyone assembles, they move "steps".Everyone moves, that many number of steps, which he sees to be the minimum number amongst all hats. So in the case of everyone having different numbers, everyone will take 0 steps (i.e., wont move at all) except the guy with number 0, who will move 1 step. But he
will essentially know that 0 is the minimum through this strategy, and thus will shout 0 (along with everyone). In another case, lets assume everyone has the same number. So, everyone will take that number of steps, and will shout that number. Problem Solved.
No comments:
Post a Comment