0% found this document useful (0 votes)
9 views6 pages

HW1 Solutions

The document contains solutions to various problems from a Computational Complexity course, including proofs related to Turing machines, Rice's Theorem, and reductions between NP-languages. Key topics include the properties of bidirectional and oblivious Turing machines, the implications of Rice's Theorem on computability, and the transitive nature of Cook reducibility. Additionally, it discusses the relationship between unary NP-languages and the complexity classes EXP and NEXP.

Uploaded by

refernubile
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views6 pages

HW1 Solutions

The document contains solutions to various problems from a Computational Complexity course, including proofs related to Turing machines, Rice's Theorem, and reductions between NP-languages. Key topics include the properties of bidirectional and oblivious Turing machines, the implications of Rice's Theorem on computability, and the transitive nature of Cook reducibility. Additionally, it discusses the relationship between unary NP-languages and the complexity classes EXP and NEXP.

Uploaded by

refernubile
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

HW1 Solution Set

CPSC 468/568: Computational Complexity


(Spring 2015)
1 Problem 1.4
Define a bidirectional TM to be a TM whose tapes are infinite in both di-
rections. Show that for every f : {0, 1}∗ → {0, 1}∗ and time-constructible
T : N → N, if f is computable in time T (n) by a bidirectional TM M ,
then it is computable in time 4T (n) by a standard (unidirectional) TM
M̃ .

We complete the proof sketch of claim 1.8. We take a bidirectional tape


and “fold” the tape at index 0 to produce a unidirectional tape as shown in
claim 1.5. The new alphabet is made up of |Γ2 | elements, each a two-tuple
(x, y) : x, y ∈ Γ of every possible combination of the elements of Γ. We
replace every original rule (qi , x) = (qj , y, z) with (qi , (x, ⊥)) = (qj , (y, ⊥), z),
and (qi0 , (⊥, x)) = (qj0 , (⊥, y), ¬z). Note: ¬L = R, ¬R = L, ¬S = S.
The q states preserve the original direction of movement, while the q 0
states reverse said direction. For the case where the head reaches the start
position, we add the rules (qi , (B, B)) = (qj0 , (B, B), R) and (qi0 , (B, B)) =
(qj , (B, B), R) – this lets us switch the “mode” of the machine.
This machine runs in the same number of steps as the original machine
except for the case where we cross the start symbol, which takes 2 steps.
Thus, the unidirectional machine runs in time at most 2T(n).

2 Problem 1.5
Define a TM M to be oblivious if its head movements do not depend on
the input but only on the input length.That is, M is oblivious if for every
input x ∈ {0, 1}∗ and i ∈ N, the location of each of M ’s heads at the ith
step of execution on input x is only a function of |x| and i. Show that
for every time-constructible T : N → N, if L ∈ DTIME(T (n)), then
there is an oblivious TM that decides L in time O(T (n)2 ). Furthermore,
show that there is such a TM that uses only two tapes: one input tape
and one work/output tape.

Use the same construction as in Claim 1.6 of the text: “The TM M 0


encodes the k tapes of M (including its input and output tapes) on a single

1
tape by using locations 1, k + 1, 2k + 1, ... to encode the first tape, locations
2, k + 2, 2k + 2, ... to encode the second tape etc. For every symbol a in
M ’s alphabet, M 0 will contain both the symbol a and the symbol â. In
the encoding of each tape, exactly one symbol will be of the “hat type”,
indicating that the corresponding head of M is positioned in that location.
M 0 uses the input and output tape in the same way M does. To simulate one
step of M , the machine M 0 makes two sweeps of its work tape: first it sweeps
the tape in the left-to-right direction and records to its state register the k
symbols that are hatted. Then M 0 uses M ’s transition function to determine
the new state, symbols, and head movements and sweeps the tape back in
the right-to-left direction to update the encoding accordingly.”
We really only need to make a few changes to this to make M 0 into an
oblivious TM M 00 :
• When M 0 updates the encoding in its right-to-left sweep, it may need
to move the ˆ marker to the right. However, M 00 cannot stop and move
right when it finds the hat, because it is oblivious. Therefore, the head
of M 00 must, on its right-to-left sweep, move LRL every time M 0 would
move L, so its movement pattern will look like LRLLRLLRL... That
way, the head always has the opportunity to move the ˆ marker either
left or right when it is encountered.
• We need to know how far out M 00 needs to sweep. One option is to
calculate T (n) in advance and place a special marker at spot kT (n)+1,
so that we always sweep out to T (n) + 1 and back to the beginning.
Alternatively, we simply place a marker at spot k + 1 in step 1, and at
the end of every sweep right, we have M 00 move the marker k cells to
the right. This will work because the original machine M cannot have
gone beyond spot i in step i of its calculation.
• We also need to handle the case where M might halt at different times
depending on the input. We know that M is computable in time T (n)
for some time constructible T . This means that there exists a machine
MT such that on all inputs of length n, MT halts in exactly T (n)
steps. We can simulate M and MT simultaneously on the same input
by adding m tapes (this includes input/output tapes) for simulation
of MT to M 00 . States of the machine M 00 can then be considered as
pairs of states of the above form corresponding to M and MT . M 0 will
continue sweeping back and forth in the oblivious manner described
above until MT halts.
Because we’re sweeping out to a maximum distance of kT (n), and we do
it T (n) times, the machine M 00 runs in time O(T (n)2 ).

2
3 Problem 1.12
A partial function from {0, 1}∗ to {0, 1}∗ is a function that is not neces-
sarily defined on all its inputs. We say that a TM M computes a partial
function f if for every x on which f is defined, M (x) = f (x) and for
every x on which f is not defined M gets into an infinite loop when exe-
cuted on input x.If S is a set of partial functions, we define fS to be the
Boolean function that on input α outputs 1 iff Mα computes a partial
function in S. Rice’s Theorem says that for every nontrivial S (a set
that is not the empty set nor the set of all partial functions computable
by some Turing machine), the function fS is not computable.
(a) Show that Rice’s Theorem yields an alternative proof for Theorem
1.11 by showing that the function HALT is not computable.
(b) Prove Rice’s Theorem.

1.12 (a)
Let S be the set of all partial functions defined on a given input x. If the
function HALT is computable, then we can compute fS by simply checking
if the program halts - if it does, then the function must be defined. This
contradicts Rice’s theorem, so HALT cannot be computable.
1.12 (b)
We assume that Rice’s theorem is false. We want to compute HALT(α, x)
(does TM Mα halt on input x?).
Let S be some nontrivial set of partial functions. Without loss of gener-
ality, assume that S does not contain the function N IL that is not defined
on any input.
We create a machine M that first runs Mα on the input, then computes
a partial function g ∈ S, and finally outputs the result of the latter compu-
tation. Thus, if Mα halts, M is equivalent to a TM that computes g.
We now take the function computed by M and check whether it satisfies
fS (in which case the first part of the computation must have halted) – if so,
we output 1 , otherwise, we output 0. So, for any given TM and input, we
can check whether HALT is satisfied. This is not possible, so Rice’s Theorem
must be true.

4 Problem 2.13
Recall that a reduction f from an NP-language L to an NP-language L0
is parsimonious if the number of certificates of f is equal to the number

3
of certificates of f (x).
(a) Prove that the reduction from every NP-language L to SAT pre-
sented in the proof of Lemma 2.11 can be made parsimonious.
(b) Show a parsimonious reduction from SAT to 3SAT.

2.13 (a)
The textbook’s presentation of Cook’s Theorem seems to already be par-
simonious. To see this, we need to show that there is a bijection between the
set of certificates of the initial TM M , and the set of satisfying assignments
of the final formula φx . First, we show an injection: suppose we have two
distinct certificates u1 and u2 such that M (x, u1 ) = M (x, u2 ) = 1. Any satis-
fying assignment of φx must contain the bits of the corresponding certificate,
and so it’s clear that u1 and u2 must correspond to distinct satisfying as-
signments. Second, we show a surjection: consider any satisfying assignment
v. v consists of y, z1 , z2 , ..., zT (|x|) . φx checks that the first |x| bits of y are
exactly the same as the bits of x, so those are predetermined. Furthermore,
given x and the remaining bits of y (which are meant to be interpreted as
the certificate u), all of the snapshots zi are fully determined, as M is a
deterministic TM.
The ambiguity is how the formula φx verifies that M outputs 1. The
phrase “M outputs 1” is not well defined. If it means that M is in an accept
state and its output tape head is at a cell reading the bit “1”, then this
property can easily be verified on the final snapshot zT (|x|) , and so we conclude
that the reduction of Cook’s Theorem is already parsimonious. However, if
we are not willing to assume this definition, then the reduction in the blook
might allow for more than one “accept” condition. In order to account for
this, we clear the work tape and place a 1 in the leftmost cell before halting
in an accept state, so that there is now exactly one condition under which
the machine can accept, ensuring parsimony.

2.13 (b)
We define parsimonious reduction f : SAT → 3SAT as a repeated ap-
plication of function g, where g maps each clause C = x1 ∨ ... ∨ xk in SAT
instance x to a set of clauses as follows:

• If k < 4, g(C) = C

• Else, g(C) = (z ∨ x1 ∨ x2 ) ∧ (x1 → z̄) ∧ (x2 → z̄) ∧ g(z̄ ∨ x3 ∨ ... ∨ xk )


= (z ∨ x1 ∨ x2 ) ∧ (z̄ ∨ x̄1 ) ∧ (z̄ ∨ x̄2 ) ∧ g(z̄ ∨ x3 ∨ ... ∨ xk )

4
The idea here is that it’s just like the reduction in the book, except we
force z to be false whenever either x1 or x2 is true. This guarantees that
whenever x is satisfied by some assignment of variables, there is a unique
extension to that assignment that satisfies f (x). If x1 and x2 are both false,
z is forced to true; otherwise, z is forced to false. Furthermore, if we take
any satisfying assignment of g(C) and remove all the assignments to new
variables, it’s clear by induction that the resulting assignment satisfies C
(if z is false, then x1 ∨ x2 is true; if z is true, then x3 ∨ ... ∨ xk is true by
induction).

5 Problem 2.14
Cook used a somewhat different notion of reduction: A language L is
polynomial-time Cook reducible to a language L0 if there is a polynomial
time TM M that, given an oracle for deciding L0 , can decide L. An
oracle for L0 is a magical extra tape given to M , such that whenever M
writes a string on this tape and goes into a special “invocation” state,
then the string – in a single step! – gets overwritten by 1 or 0 depending
upon whether the string is or is not in L0 ; see Section 3.4 for a more
precise definition.
Show that the notion of cook reducibility is transitive and that 3SAT
is Cook-reducible to TAUTOLOGY.

Cook reducibility is transitive


In the following, we use “reducible” to mean polynomial-time Cook re-
ducible. Let L be reducible to L0 , and let L0 be reducible to L00 . We want to
show that L is reducible to L00 .
We have a TM ML that recognizes L in polynomial time O(nc1 ) using an
oracle OL0 . We also have a TM ML0 that recognizes L0 in time O(nc2 ) using
an oracle OL00 . (OL0 and OL00 recognize L0 and L00 , respectively.)
We simply compose the two reductions. We replace OL0 with ML0 – a
“false” oracle. Now, ML runs in polynomial time O(nc1 nc2 ) = O(nc1 ×c2 ),
using the oracle OL00 . So, L is reducible to L00 .

3SAT is Cook-reducible to TAUTOLOGY


A 3SAT formula f (x), is unsatisfiable if ∀x, f (x) = 0. So, the negation
thereof, ¬f (x), is a tautology.
We take the negation of the input to 3SAT, pass it to a TAUTOLOGY
oracle, and then output the negation of the result. Thus, 3SAT is Cook-
reducible to TAUTOLOGY.

5
6 Problem 2.32
Prove that if every unary NP-language is in P then EXP=NEXP. (A
language L is unary iff it is a subset of {1}∗ , see Exercise 2.30.)

We use the proof of Theorem 2.22 from the textbook, which shows that
if P=NP, then EXP=NEXP.
Instead of the actual value x, we simply use the unary representation of
x, which has length O(2|x| ). This gives us a unary NP language L0pad – the
rest of the proof is identical to what is given in the book.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy