[next] [prev] [prev-tail] [tail] [up]

 Exercises

  
5.1.1
The RAM represented by the program of Figure 5.E.1
 
read x
read y
if x < y then
    do
        t := x
        x := y
        y := t
    until true
do
    t := x mod  y
    x := y
    y := t
until t = 0
write x
if eof then accept 
 
Figure 5.E.1

is based on Euclid's algorithm and determines the greatest common divisor of any given pair of positive integers. Find the time and space complexity of the RAM.
  1.  Under the uniform cost criterion.
  2.  Under the logarithmic cost criterion.
 
5.1.2
Show that a RAM can compute the relation { (1n, y) | n >= 0, and y is the binary representation of n } in time linear in n.

Hint: Note that (1/21) + (2/22) + (3/23) + . . . < 3.  

5.1.3
Show that each of the following classes is closed under the given operations.
  1.  NTIME (T(n)) and NSPACE (S(n)) under the operations of union and intersection.
  2.  DTIME (T(n)) under the operations of union, intersection, and complementation.
 
5.1.4
Consider any two functions T1(n) and T2(n). Assume that for each constant c, there is a constant nc such that T2(n) >= cT1(n) for all n >= nc. Show that DTIME (T1(n))  (_ DTIME (T2(n)).  
5.1.5
(Tape Compression Theorem) Let c be any constant greater than 0. Show that each S(n) space-bounded, m auxiliary-work-tape Turing machine M has an equivalent cS(n) space-bounded, m auxiliary-work-tape Turing machine Mc.  
5.1.6
Show that each of the following problems is in NP.
  1.  The nonprimality problem defined by the following pair.
    Domain:
    { m | m is a natural number }.
    Question:
    Is the given instance m a nonprime number?
  2.  The traveling-salesperson problem defined by the following pair.
    Domain:
    { (G, d, b) | G is a graph, d is a "distance" function that assigns a natural number to each edge of G, and b is a natural number }.
    Question:
    Does the given instance (G, d, b) have a cycle that contains all the nodes of G and is of length no greater than b?
  3.  The partition problem defined by the following pair.
    Domain:
    { (a1, . . . , aN ) | N > 0 and a1, . . . , aN are natural numbers }.
    Question:
    Is there a subset S of {a1, . . . , aN } for the given instance (a1, . . . , aN ) such that (the sum of all the elements in S) = (the sum of all the elements in {a1, . . . , aN } - S)?

 

5.1.7
Show that each of the following problems is in NSPACE (log n).
  1.  The graph accessibility problem defined by the following pair.
    Domain:
    { (G, u, v) | G is a graph, and u and v are nodes of G }.
    Question:
    Is there a path from u to v in G for the given instance (G, u, v)?
  2.  The c-bandwidth problem for graphs defined by the following pair, where c is a natural number.
    Domain:
    { G | G is a graph }.
    Question:
    Does the given graph G = (V, E) have a linear ordering on V with bandwidth c or less, that is, a one-to-one function f: V --> {1, . . . , |V |} such that |f(u)-f(v)| <= c for all (u, v) in E?

 

5.1.8
Show that the following problems are solvable by logspace-bounded Turing transducers.
  1.  Sorting sequences of integers.
  2.  Addition of integers.
  3.  Multiplication of integers.
  4.  Multiplication of matrices of integers.
  
5.2.1
Show that each of the following functions is a fully time-constructible function.
  1.  nk for k >= 1.
  2.  2n.
 
5.2.2
Show that each of the following functions is a fully space-constructible function.
  1.  log n.
  2.   V~ --
  n.
 
5.2.3
Show that each space-constructible function S(n) >= n is also a fully space-constructible function.  
5.2.4
Show that there are infinitely many functions T1(n) and T2(n) such that the containments DTIME (T1(n))  (_ DTIME (T2(n))  (_ NP are proper.  
5.2.5
Show that for each T(n) > n, the language { x | x = xi and Mi is a deterministic Turing machine that does not accept xi in T(|xi|) time } is not in DTIME (T(n)).

Hint: Use the following result.

Linear Speed-Up Theorem A T(n) time-bounded Turing machine M1 has an equivalent cT(n) time-bounded Turing machine M2 if T(n) > n and c > 0. Moreover, M2 is deterministic if M1 is so.  

5.2.6
(Space Hierarchy Theorem) Consider any function S1(n) >= log n and any fully space-constructible function S2(n). Assume that for each c > 0 there exists an nc, such that cS1(n) < S2(n) for all n >= nc. Show that there is a language in DSPACE (S2(n)) that is not in DSPACE (S1(n)).   
5.3.1
What will be the value of  
5.3.2
What will be the value of
  1.  Einit
  2.  Eaccept
  3.  f0(q0, a , W, t1)
  4.  f0(Y , q0, a , t1)
  5.  f0(Y , Z , q0, t1)
  6.  f0(Y , Z , W, t1)
  7.  f1(q0, B, W, t1)
  8.  f1(Y , q0, B , t1)
  9.  f1(Y , Z , q0, t1)
  10.  f1(Y , Z , W, t1)
in Example 5.3.2 if x = abb?  
5.3.3
Show that the proof of Theorem 5.3.1 implies a Boolean expression Ex of size O((T(|x|)2log T(|x|)).  
5.3.4
Show that the problem ^K concerning the solvability of systems of linear Diophantine equations over {0, 1} is an NP-complete problem. Use a generic proof, in which each problem in NP is shown to be directly reducible to ^K, to show the NP-hardness of the problem.   
5.4.1
What is the instance of the 0 - 1 knapsack problem that corresponds to the instance (x1  \/ ¬x2  \/ x4)  /\ (¬x1  \/ x2  \/ x3)  /\ (¬x2  \/ ¬x3  \/ ¬x4) of the 3-satisfiability problem, according to the proof of Theorem 5.4.1?  
5.4.2
Modify the proof of Theorem 5.4.1 to show that the problem defined by the following pair, called the integer knapsack problem, is an NP-complete problem.
Domain:
{ (a1, . . . , aN , b) | N >= 1, and a1, . . . , aN , b are natural numbers }.
Question:
Are there natural numbers v1, . . . , vN such that a1v1 + . . . + aN vN = b for the given instance (a1, . . . , aN , b)?
Hint: Construct the system E so that its ith equation from the start equals the ith equation from the end.  
5.4.3
Show, by reduction from the 0 - 1 knapsack problem, that the partition problem is an NP-hard problem.  
5.4.4
What is the instance of the clique problem that corresponds to the instance (x1  \/ ¬x2  \/ x4)  /\ (¬x1  \/ x2  \/ x3)  /\ (¬x2  \/ ¬x3  \/ ¬x4) of the 3 satisfiability problem, according to the proof of Theorem 5.4.2?  
5.4.5
A LOOP(1) program is a LOOP program in which no nesting of do's is allowed. Show that the inequivalence problem for LOOP(1) programs is an NP-hard problem.   
5.5.1
Modify Example 5.5.1 for the case that M is the Turing machine in Figure 5.5.1(a) and x = aba.  
5.5.2
The proof of Theorem 5.5.2 shows that

 NSPACE (S1(n))    (_  DSPACE  (S2(n))

for S2(n) = (S1(n))2 if the following two conditions hold.

  1.  S1(n) >= log n.
  2.  S1(n) is fully space-constructible.
  1.  What is the bound that the proof implies for S2(n) if condition (1) is revised to have the form S1(n) < log n?
  2.  Determine the time complexity of M2 in the proof of Theorem 5.5.2.
  3.  Show that condition (2) can be removed.
 
5.5.3
Modify Example 5.5.2 for the case that A is the Turing machine in Figure 5.5.1(a).  
5.5.4
A two-way finite-state automaton is an 0 auxiliary-work-tape Turing machine. Show that the nonemptiness problem for two-way deterministic finite-state automata is PSPACE-complete .  
5.5.5
Show that each S(n) >= log n space-bounded Turing transducer M1 has an equivalent S(n) space-bounded Turing transducer M2 that halts on all inputs.   
5.6.1
Show that logspace reductions are closed under composition , that is, if problem Ka is logspace reducible to problem Kb and Kb is logspace reducible to problem Kc then Ka is logspace reducible to Kc.  
5.6.2
Let Gx be the grammar of Example 5.6.1. List all the production rules A --> a of Gx that satisfy a ==>* e but are not listed in the example.  
5.6.3
The circuit-valued problem, or CVP, is defined by the following pair.
Domain:
{ (I1, . . . , Im) | m >= 0, and each Ii is an instruction of any of the following forms.
  1.  xi := 0.
  2.  xi := 1.
  3.  xi := xj  o. xk for some j < i, k < i, and some function  o. : {0, 1}2 --> {0, 1}. }
Question:
Does xm = 1 for the given instance (I1, . . . , Im)?
Show that CVP is a P-complete problem.

[next] [prev] [prev-tail] [front] [up]