Question: Can i get complete solution for this problem please its from my Algorithms and Complexity class. The Glass Jar problem You are doing stress-testing on

Can i get complete solution for this problem please its from my Algorithms and Complexity class.

The Glass Jar problem You are doing stress-testing on some kind of glass jars to determine the height from which they can be dropped and still not break. Here is the setup. You have a ladder with n rungs, and you want to find the highest rung from which you can drop a copy of this jar and not break. We call this the highest safe rung. Obviously, if a jar is not broken in a throwing, it can be reused; otherwise, you have to use a new jar. Now you are only given K (identical) jars. For simplicity, supoose K = 2 (i.e. you only have two copies of the glass jar). Of course, you can take the simplest way: try throwing one jar from the lowest rung and move one rung up if it does not break. But in the worst case you may need to throw n times, which seems to be not so optimal (note you only use one jar in this case). So our goal is to throw as few times as possible while only using at most K = 2 jars. Now your task: describe a strategy for finding the highest safe rung that only uses K = 2 jars and also minimizes the number of throws in the worst case. Also tell me what is the smallest number of throws you need for the n = 100 case (i.e. 100 rungs) 1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!