1) [8 points total]
a) [4 points] Prove the following using limits and L'Hôpital's
Rule: That $n\lg n$ is $O(k n\lg(kn))$ for any constant $k > 0$.
b) [4 points] Prove the following using limits and L'Hôpital's Rule:
That $6n^2 + 20n$ is $\Omega(n + 5)$.
2) [10 points total]
Suppose you wish to do an average case analysis of the iterative version
of Binary Search for n=4. Consider all possible input lists S of size 4, and
partition those inputs as follows: For i = 1, 2, 3, 4, let $I_i$ be the set of all
inputs for which the number x appears in position i. For the inputs for
which x does not appear in the list, we let
$I_5$ be the set of all inputs for which the number x lies in the gap
between S[1] and S[2],
$I_6$ be the set of all inputs for which the number x lies in the gap
between S[2] and S[3],
$I_7$ be the set of all inputs for which the number x lies in the gap
between S[3] and S[4],
$I_8$ be the set of all inputs for which the number x is smaller than all
the numbers in S,
$I_9$ be the set of all inputs for which the number x is larger than all the
numbers in S.
Do an average case analysis of iterative Binary Search for search lists
of size 4 using the above partitioning of the inputs, and counting
comparisons of x with numbers in S. You should assume that all the
input classes are equally likely to occur. Also, please show your work,
including giving the values of t($I_i$) and p($I_i$) for i = 1,...,9.