Theory of Computation
Final Examination on January 14, 2021 Fall Semester, 2020
Problem 1 (20 points) Consider any CNF φ = C1∧ C2∧ · · · ∧ Cm, where literals in a clause are distinct. Suppose m ≥ 2n. Show that for any > 0, there is a polynomial-time algorithm which solves sat for CNFs on n variables where each clause has at least n distinct literals.
Proof: If a clause contains a variable and its negation, remove that clause as it is trivially satisfiable. Then the length of φ is at least 2n. An exhaustive search of all 2n truth assignments becomes polynomial in the input length.
Problem 2 (20 points) Prove that if NP ⊆ ZPP, then NP ⊆ BPP.
Proof: Assume NP ⊆ ZPP. Pick any NP-complete language L. We only need to show that L ∈ BPP. There exists a Las Vegas algorithm A that decides L in expected polynomial time, say p(n). By Markov’s inequality, the probability that the running time of A exceeds 3 p(n) is at most 1/3. Run A for 3 p(n) steps to determine with probability at least 1 − 1/3 = 2/3 whether the input belongs in L.
We therefore obtain a polynomial-time algorithm for L which errs with probability at most 1/3 on each input. Hence L is in BPP.
Problem 3 (20 points) Present interactive proofs of qr (Quadratic Residuacity) and qnr (Quadratic Nonresiduacity).
Proof: In an interactive proof of qr, the prover sends the square root of the input x ∈ Zn∗ to the verifier.
If x is a quadratic residue, the verifier can verify the square root is valid in polynomial time.
If x is a quadratic nonresidue, the verifier will reject the incorrect square root.
In an interactive proof of qnr, the prover sends n’s factorization p and q to the verifier.
The verifier checks pq = n and applies Lemma 82 (see p. 687 of the slides) to check if x is a quadratic nonresidue. Both can be done in polynomial time.
This protocol can also solve qr.
Problem 4 (20 points) Define IP∗ as IP except that the prover now runs in deter- ministic polynomial space instead of exponential time. Show that IP∗ ⊆ PSPACE.
(You cannot use the known fact IP = PSPACE.)
Proof: Let L ∈ IP∗, (P, V ) be an interactive proof system, V be a probabilistic polynomial-time verifier, P be a polynomial-space prover, k be some positive integer, n be the length of the input x, r ∈ {0, 1}nk be the random bits used by V , and a be the number of r’s for which V accepts. To prove the claim, we will describe a deterministic algorithm that runs in polynomial space and decides the same language L. This algorithm simulates (P, V ) by trying all possible random bits that V uses and calculating the ratio of the number of ACCEPT to the number of all possible random bits, while recycling the space. The detail is described below.
On any input x, M computes a as follows:
1: a = 0;
2: for all r ∈ {0, 1}nk do
3: Simulate (P, V ) deterministically;
4: if V outputs ACCEPT then
5: a = a + 1;
6: end if
7: Free the tape and start over;
8: end for
9: return a;
Step 3 takes polynomial space. If a / 2nk ≥ 2/3, then M accepts x; otherwise, M rejects x. This algorithm performs in polynomial space. So M decides L in polynomial space.
Problem 5 (20 points) Suppose that there are n jobs to be assigned to m < n identical machines. Let ti be the running time for job i ∈ {1, 2, . . . , n}, A[ i ] = j be an assignment for job i on machine j ∈ {1, 2, . . . , m}, and T [ j ] =P
A[ i ]=jti be the total running time for machine j. For convenience, assume that t1 ≤ t2 ≤ · · · ≤ tn. The makespan of A is the maximum time that any machine is busy, given by
makespan(A) = max
j T [ j ].
The problem LoadBalance is to compute the minimal makespan of A. It is known that the decision version of LoadBalance is NP-hard. Consider the following algorithm for LoadBalance:
1: for i ← 1 to n do
2: A[ i ] ← ∅;
3: end for
4: for i ← 1 to m do
5: T [ i ] ← 0;
6: end for
7: for i ← 1 to n do
8: min ← 1;
9: for j ← 2 to m do
10: if T [ j ] < T [min] then
11: min ← j;
12: end if
13: end for
14: A[ i ] ← min;
15: T [min] ← T [min] + ti;
16: end for
17: return maxiT [ i ];
Show that this greedy algorithm for LoadBalance is a 13-approximation algorithm, meaning that it returns a solution that is at most 3/2 times the optimum.
Proof: Let OPT be the optimal makespan. It is clear that OPT ≥ 1 m
Pn
i=1ti. By the pigeonhole principle, at least one machine in the optimal scheduling must get two of the first m + 1 jobs. Each of these jobs is at least as big as tm+1. Hence OPT ≥ 2 tm+1. Suppose that machine j∗ has the largest total running time, and let i∗ be the last job assigned to machine j∗. Since T [ j∗] − ti∗ ≤ T [ j ] for all j ∈ {1, 2, . . . , m}, T [ j∗] − ti∗ is less than or equal to the average running time over all machines. Thus,
T [ j∗] = (T [ j∗] − ti∗) + ti∗ ≤ 1 m
m
X
j=1
T [ j ] + tm+1 = 1 m
n
X
i=1
ti+ tm+1 ≤ 3
2 × OPT.