![]() Optimized Method: The idea is to do optimize the solution using the below equation: Let us make our first attempt on x'th floor. The worst-case happens when the required floor is 49’th floor. If we use Binary Search Method to find the floor and we start from the 50’th floor, then we end up doing 50 comparisons in the worst case. The problem is not actually to find the critical floor, but merely to decide floors from which eggs should be dropped so that the total number of trials is minimized. What is the least number of egg droppings that are guaranteed to work in all cases? In the worst case, this method may require 100 droppings. Drop the egg from the first-floor window if it survives, drop it from the second-floor window. If only one egg is available and we wish to be sure of obtaining the right result, the experiment can be carried out in only one way. We strongly recommend you to minimize your browser and try this yourself first If an egg survives a fall then it would survive a shorter fall. ![]() If an egg breaks when dropped, then it would break if dropped from a higher floor.The effect of a fall is the same for all eggs.An egg that survives a fall can be used again.What strategy should be used to drop eggs such that a total number of drops in the worst case is minimized and we find the required floor Suppose that we wish to know which stories in a 100-story building are safe to drop eggs from, and which will cause the eggs to break on landing. The following is a description of the instance of this famous puzzle involving 2 eggs and a building with 100 floors. Puzzle 8 | (Find the Jar with contaminated pills).Puzzle 4 | (Pay an employee using a gold rod of 7 units ?).Puzzle 5 | (Finding the Injection for Anesthesia).Puzzle 3 | (Calculate total distance travelled by bee).Puzzle 1 | (How to Measure 45 minutes using two identical wires?).Puzzle 26 | (Know Average Salary without Disclosing Individual Salaries).Puzzle 23 | (Days of month using 2 dice).Puzzle 40 | (Find missing Row in Excel).Puzzle | Set 35 (2 Eggs and 100 Floors).Puzzle 34 | (Prisoner and Policeman Puzzle).Puzzle 30 | (Last Palindrome Date Before ).ISRO CS Syllabus for Scientist/Engineer Exam.ISRO CS Original Papers and Official Keys.GATE CS Original Papers and Official Keys.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |