I have a question where I'm completely confused how to set up a recurrence.
A watch manufacturer looks to find out if an integer value for water resistance is in the range of 0 to n. The water resistance is 0 if a watch leaks, and the watch does not leak at the depth of n meters. The water resistance is defined as n.
To test the water resistance at a depth k, a scuba diver does a dive at k meters and stays under water at that depth for one hour. If the watch leaks, it is discarded. If it does not leak, it can be reused in another experiment.
How many watches leak in the worst case? (worst case here means the maximum number of damaged watches)?
What's given: Describe the worst case situation and then give a recurrence relation for the number of damaged watches. Assume that the midpoint is chosen for the sub-problem for row lower to upper by the formula: mid = floor[(lower+upper)/2] where lower = 1, and upper = n
for the first sub-problem.
So what I got from this is mid = floor[(1+n)/2]
but I'm not sure how to come up with a recurrence that holds for any value of n.
Can someone guide me on what to do / how to get started? I would appreciate any help from anyone.
Thanks guys.