Question 1.4, 17 September I am thinking that 2.5 is trivial. I can assume that for large enough n, and for some c, that f(n) ≤ cg(n). Doesn't substituting this into the other three equations give me what I want?
You have to be careful, and use the definition of the function in each case to make sure that your new left-hand side is bounded by a constant times the right-hand side. In part (a) the new left-hand side is log(f(n)) and the new right-hand side is log(g(n)). You know that the left-hand side is at most log(cg(n)), but you need to do some arithmetic to see how this compares to log(g(n)) -- is it less than a constant times log(g(n))? I'll give you a hint -- the three parts of the problem do not all behave the same.
Question 1.3, 17 September Still on 2.8, maybe I should make all the intervals the same, so that I search rung number t, then 2t, then 3t, and so forth until the first jar breaks, then linear-search from the last successful try to the unsucessful one. But whatever number t is, I might use as many as n/t tries, and this is Ω(n), isn't it?
It's Ω(n) if t is a constant. But you could make t a function of n, chosen so your total worst-case number of tests is a small as possible. Finding the right t is the key to the problem. You might construct a formula for the total number of tests in terms of n and t, then choose t to minimize this formula as a function of n.
Question 1.2, 15 SeptemberAgain on 2.8, what if I start with rung 1, then rung 2, then rung 4, and so forth?
Again in the worst case, you will be in trouble because the jar at rung n/2 might break, leaving you to search everything from n/4 to n/2. This would take Ω(n) tests which is no good.
Question 1.1, 14 SeptemberOn 2.8, my idea is to first try the middle rung, then it that survives rung 3n/4, then 7n/8, and so forth. But I can't figure out how to prove that this is sublinear.
That's because it isn't. Remember that you are trying to find a plan that will make a sublinear number of tests in the worst case. So with your plan, if the first jar breaks you are in trouble because you have only one jar left and have to linear-search around n/2 rungs. In fact, by this argument it follows that your first test must be very close to the bottom, because if is at least εn from the bottom that jar might break and force you to spend εn tests to linear-search all the rungs below it.
Last modified 17 September 2006