Lecture 6

We finished up the last lecture by showing that the recurrence for the deterministic selection algorithm was 16n. This recurrence was T(n) = 8n/5 + T(n/5) + T(7n/10).

Next we discussed lower bounds. We noted in particular how important it was to state the model of computation being used. Then we did two simple lower bounds: first we argued that no algorithm could find the max element in an unsorted list of numbers in less than Omega(n) time. We introduced an adversary to prove this. The adversary behaved as follows:

1. If algorithm examines position i in the array A, then report that value as A[i]=1. 2. If algorithm reports unexamined element A[u] as the MAX, then make A[u] = 0, else make it 2.

Clearly if any algorithm uses less than Omega(n) time, it cannot examine every element of A. So the adversary above makes the algorithm report the wrong answer by manipulating the input as the algorithm runs (we argued that this was valid behavior as long as the adversary was never "caught in a lie.")

Next we did another easy lower bound, a little more involved than the first: we argued that no comparison-based algorithm could search a sorted array in fewer than lg n comparisons, because the algorithm could exclude at most half of the remaining array with each of its comparisons.