![]() Similarly other prisoners from 97 to 1 are saved. The 98’th prisoner decides his answer on the basis of answer of 99’th prisoner’s answer and uses same logic. If 100’th prisoner said ‘Black’ (There must have been odd number of red hats in front of him)Ī) If 99’th prisoner sees even number of red hats in front of him, then his color is Red.ī) If 99’th prisoner sees odd number of red hats in front of him, then his color is Black. If 100’th prisoner said ‘Red’ (There must have been even number of red hats in front of him)Ī) If 99’th prisoner sees even number of red hats in front of him, then his color is black.ī) If 99’th prisoner sees odd number of red hats in front of him, then his color is red. There are following possibilities and 99’th prisoner can figure out color of his hat in every case. The 99’th prisoner decides his answer on the basis of answer of 100’th prisoner’s answer. He may or may not be saved, but he conveys enough information to save 99th prisoner. ![]() The idea is that every prisoner counts number of red hats in front of him.ġ00th prisoner says red if the number of red hats is even. SDE SHEET - A Complete Guide for SDE PreparationĪt-most 99 prisoners can be saved and the 100th prisoner has 50-50 chances of being executed.Puzzle 5 | (Finding the Injection for Anesthesia).Puzzle 4 | (Pay an employee using a gold rod of 7 units ?).Puzzle 3 | (Calculate total distance travelled by bee).Puzzle 1 | (How to Measure 45 minutes using two identical wires?).Puzzle 20 | (5 Pirates and 100 Gold Coins).Puzzle 17 | (Ratio of Boys and Girls in a Country where people want only boys).Puzzle 14 | (Strategy for a 2 Player Coin Game).Puzzle 13 | (100 Prisoners with Red/Black Hats).Puzzle 12 | (Maximize probability of White Ball).Puzzle 10 | (A Man with Medical Condition and 2 Pills). ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |