Skip to content
The Lumenary

Practice · Advanced undergraduate

Computational complexity

Computational complexity

Warm-upHuman

Which of these is the definition of the class NP?

Choose one

Computational complexity

Warm-upHuman

Which of these problems are known to be in P? (Select all that apply.)

Choose all that apply

Computational complexity

Warm-upHuman

Karp's reduction from 3-SAT to INDEPENDENT SET is applied to a 3-CNF formula with 77 clauses on 55 variables. How many vertices does the graph GφG_\varphi have?

Computational complexity

CoreHuman

In the reduction from SAT to 3-SAT, a clause (ℓ1∨ℓ2∨⋯∨ℓ7)(\ell_1 \vee \ell_2 \vee \cdots \vee \ell_7) with 77 literals is replaced by a chain of 3-literal clauses using fresh variables z1,z2,…z_1, z_2, \dots. How many 3-literal clauses does it become?

Computational complexity

CoreHuman

You want to prove that a new problem B∈NPB \in \mathrm{NP} is NP-complete. Which is enough?

Choose one

Computational complexity

StretchHuman

In the proof of Theorem 5 (⇐\Leftarrow direction) we said: an independent set SS of size mm in GφG_\varphi contains exactly one vertex from each clause. Why?

Choose one

Computational complexity

StretchHuman

Which of these statements are known theorems (not conjectures)? (Select all that apply.)

Choose all that apply

Computational complexity

CoreFormal

The Lean file proves bruteForce_correct : bruteForce φ = true ↔ Satisfiable φ and length_allAssignments : (allAssignments n).length = 2 ^ n. Which conclusion do these two theorems justify?

Choose one

Computational complexity

StretchComputational

Implement Karp's reduction. A 3-CNF formula is a list of clauses, each a tuple of three nonzero integers (vv for xvx_v, −v-v for ¬xv\neg x_v). Number the vertices 3i+j3i + j for the jj-th literal (j=0,1,2j = 0, 1, 2) of clause ii. Write karp_graph(formula) returning the set of edges as pairs (p, q) with p < q: the three edges inside each clause, and an edge between every two vertices whose literals are complementary.

Runs entirely in your browser, in an isolated worker. Nothing is sent to a server.