The Lumenary · Advanced undergraduate
Computational complexity
Name: ______________________
Date: ______________________
You will learn to
- Define running time, the classes P, NP and coNP, and place standard problems in them
- Prove the inclusions and explain why by the time hierarchy theorem
- State the Cook–Levin theorem and explain the idea of its proof
- Prove NP-completeness by polynomial-time reductions, including 3-SAT to independent set, vertex cover and clique
- Explain what is known and unknown about P versus NP, and why cryptography rests on unproved hardness assumptions
- 1.
Which of these is the definition of the class NP?
- A.Decision problems whose "yes" instances have certificates of polynomial length that can be checked in polynomial time.
- B.Decision problems that cannot be solved in polynomial time.
- C.Decision problems whose "yes" and "no" answers both have short checkable certificates.
- D.Decision problems solvable in exponential time.
- 2.
Which of these problems are known to be in P? (Select all that apply.)
- A.Is a given graph 2-colourable?
- B.Is a given graph 3-colourable?
- C.Is a given -digit number prime?
- D.Does a given graph have a perfect matching?
- E.Does a given graph have a Hamiltonian cycle?
- 3.
Karp's reduction from 3-SAT to INDEPENDENT SET is applied to a 3-CNF formula with clauses on variables. How many vertices does the graph have?
- 4.
In the reduction from SAT to 3-SAT, a clause with literals is replaced by a chain of 3-literal clauses using fresh variables . How many 3-literal clauses does it become?
- 5.
You want to prove that a new problem is NP-complete. Which is enough?
- A.Give a polynomial-time reduction .
- B.Give a polynomial-time reduction .
- C.Show that the best known algorithm for takes exponential time.
- D.Show that has exponentially many candidate solutions.
- 6.
In the proof of Theorem 5 ( direction) we said: an independent set of size in contains exactly one vertex from each clause. Why?
- A.Each clause's three vertices form a triangle, so has at most one of them; with clauses and , it must have exactly one from each.
- B.Because complementary literals are joined by edges.
- C.Because is satisfiable.
- D.Because every independent set of has exactly vertices.
- 7.
Which of these statements are known theorems (not conjectures)? (Select all that apply.)
- A.If some NP-complete problem is in P, then .
- B..
- C.If then .
- D.If factoring can be done in polynomial time, then .
- E..
- 8.
The Lean file proves
bruteForce_correct : bruteForce φ = true ↔ Satisfiable φandlength_allAssignments : (allAssignments n).length = 2 ^ n. Which conclusion do these two theorems justify?- A.SAT is decidable, by an algorithm proved correct that examines exactly assignments.
- B.SAT is in P.
- C.SAT requires exponential time.
- D.Nothing:
decidecould prove satisfiability directly, so the theorems are vacuous.
- 9.
Implement Karp's reduction. A 3-CNF formula is a list of clauses, each a tuple of three nonzero integers ( for , for ). Number the vertices for the -th literal () of clause . Write
karp_graph(formula)returning the set of edges as pairs(p, q)withp < q: the three edges inside each clause, and an edge between every two vertices whose literals are complementary.Computational — Practice