Problem Set #5

CS 155 -- due December 8, 1999

Problem 1 is worth 20 points; the other problems are worth 10 points each. No late submissions will be accepted.
  1. The following divide-and-conquer F-sorting algorithm was designed to have a time complexity near the theoretical minimum given by the decision tree model. A top-level description is as follows:
    1. Find the values of mk for k=2 to k=7.
    2. For each of the subscripts from i=11 down through i=6, how large is the sorted sequence into which li is to be inserted?
    3. For each of the subscripts in the block from i=m(k) down through i=m(k-1)+1, how large is the sorted sequence into which li is to be inserted?
    4. Trace the operation of the F-sorting algorithm on the input sequence
      (8 5 4 9 1 7 6 3 2 0). Compare the number of element comparisons required with the theoretical minimum obtained from the decision tree model.
    5. How many element comparisons are required to apply the F-sorting algorithm to an input sequence of size 21? Compare this value to the theoretical minimum obtained from the decision tree model.

  2. An instance of the Shortest Common Superstring Decision Problem consists of a finite alphabet S, a set R of strings over S, and a target integer K. The question is whether there is a string over S of length at most K that is a superstring of every string in R. Show that this problem is in NP.

  3. Show that the version of the Boolean Satisfiability Problem in which every clause contains at most 2 literals is in P. You might want to test your algorithm on the cases
    {{x,y}, {x',y}, {x,y'}, {x',y'}}
    and
    {{x',y}, {x,y'}, {x',y'}, {y',z}, {y,z'}, {y',z'}}
    and
    {{x',y}, {x,y'}, {x',y'}, {y',z}, {y,z'}, {y,z}}