1. Suppose that the algorithm RANDOMIZED-PARTITION(A,p,r) returns the index q
which is larger than
4 times as often as
that which is equal to
or less
for a set of arrays of n keys. Also suppose that each index within each of these two categories is
equally likely.
Answer the following questions.
(a) Compute the probability that q is equal to 2.
(b) Write a recurrence relation for average time T(n) for QUICKSORT(A,p,r) if its input
is from this set of arrays.
(c) Find a tight upper bound for T(n) of (a).
You may use
if necessary.
2. The committee meeting scheduling problem asks whether or not it is possible
to schedule the meetings of committees in k time slots without any conflicts,
where k is a natural number.
Suppose that there are m committees and that there are altogether n people belonging
to these committees. People can belong to any number of committees.
(a) Prove that the committee scheduling problem is in class NP.
(b) Prove that it is NP-Complete. Use "graph coloring problem" as a known
NP-Complete problem.