|
Microsoft interview Question...
|
View this Thread in Original format
| DJ E-s*it |
U got 50 people in one room, they cant talk to eachother nor having body movement, 25 of them got red cap on , the other 25 got green cap..They all can see eachothers cap but not they own cap, how r they suppose to walk out of the room and split the 2 color equally? like red on one side and green on the other....
if u heard this dont say the answer , thanx^^ ill post answer shortly.. |
|
|
| Furel |
| ... by moving their legs... I suppose? :conf: |
|
|
| DJ E-s*it |
| lets say u r one of them... how r u gonna split the 2 colors? |
|
|
| DJ Mikey Mike |
| The answer is pretty straight forward. I've never heard of this problem before so am I allowed to say the answer? |
|
|
| DigiNut |
I don't get it... if it's known that there are 25 of each, they can just count the caps in advance... if they see 24 red ones then they're red, if they see 24 green ones then they're green.
Then 1 random person goes to one side and everybody else follows up based on their cap colour.
This seems like a trivial version of the "hats in a line" problem (which is fairly trivial in and of itself). |
|
|
| zarathustra |
EDIT: ^^^^ Damn you DigiNut :p
I suppose you could walk around the room and count everyone according to their hats. You'll end up with 24 of one and 25 of the other and therefore you know what colour your own hat is. If everyone does this then problem solved. |
|
|
| DJ E-s*it |
| lets say u wake up in a room with 49 other people and some r red some r green. and u cant c ur own cap...so u cant count in advance how u gonna split it up when u walk out dat door...? |
|
|
| DJ E-s*it |
| lets say its a dark room where u cant see anything...but u know there r red N green caps..how u guys gonna walk out and split up |
|
|
| DigiNut |
Well it's still fairly simple I guess... just form 4 groups. Let's assign group 1 to red and group 2 to green.
First person goes to group 3. Next person goes to group 3 if the last person was red, group 4 if the last person was green. Then the last person goes to group 1 if the person behind went to 3, or group 2 if he went to 4. Keep repeating this process until there is only 1 person left. Then the right colour group can just go to him, because they know what colour they are by looking at the other people in their group.
No communication involved, really. Not sure if this is "allowed" by the rules or not.
Edit: wtf, you keep changing it, you expressly stated it in the 1st post that "they can see each other's cap". You just trying to piss us off, or what? Anyway, you can still do what I said, just form the groups *outside* the dark room after walking out. :p |
|
|
| UglyDave |
| u go to the bog and take a look in the in mirror - problem solved |
|
|
| placebo |
| quote: | Originally posted by UglyDave
u go to the bog and take a look in the in mirror - problem solved |
haha |
|
|
|
|