← Student tools · Problem 21 · Lecture 10 · Round 2 (30 pts)

Verifier vs. brute-force solver

The asymmetry that defines NP: checking a witness is easy, finding one is (apparently) hard.

CLO-3 · Find vs verify Round 2 · 30 pts Lecture 10
🔊 Listen

A language L is in NP if there is a polynomial-time verifier V such that

x ∈ L  ⇔  ∃ certificate c, |c| ≤ poly(|x|), with V(x, c) accepting in poly(|x|) time.
Definition · NP via verifiers

SAT ∈ NP. Certificate: a satisfying assignment. Verifier: plug in, check each clause. Time: O(m) where m = clauses. Solver (brute force): try all 2n assignments. Exponential.

The gap between O(m) and 2n is the P vs NP question: is there ever a polynomial-time algorithm that finds the witness, not just checks it? Nobody knows. A million-dollar problem.

🔊 Listen
Two pictures of NP · brute-force solver vs. polynomial-time verifier Brute-force solver · 2ⁿ time on input φ (a CNF formula): for each assignment τ ∈ {0,1}ⁿ: if φ(τ) = true: accept reject Loops over 2ⁿ assignments. n = 30 → 10⁹ assignments. n = 60 → 10¹⁸. "How do I find a witness?" Verifier V · O(m) time on input (φ, certificate τ): for each clause C in φ: if C(τ) = false: reject accept Reads φ and τ once: O(m) work. m clauses + n variables. Linear scan. "Is τ a valid witness?"

The verifier doesn't have to find τ — it just checks whether someone's claim that τ works is correct. The "someone" is the existential quantifier in NP's definition. P = NP would mean there's a way to always find τ in polynomial time. P ≠ NP means there are problems where finding is fundamentally harder than checking.

🔊 Listen

Consider φ = (x1 ∨ ¬x2 ∨ x3) ∧ (¬x1 ∨ x2 ∨ x4) ∧ (x2 ∨ ¬x3 ∨ ¬x4).

Asymmetry: the verifier always halts fast, regardless of n. The brute-force solver does too — but its running time is 2ⁿ, which becomes astronomical fast.

🔊 Listen
Same 3SAT instance · two algorithms race Auto-plays

Solver: brute force (2n)

Tested: 0

Verifier: given witness, check

Checks: 0
🔊 Listen
🔊 Listen
🔊 Listen

Sipser: §7.3 (definition of NP), §7.4 (NP-completeness). Lecture notes: Module 5 slide 1 (verifier ↔ NTM equivalence diagram). Companion problems: P22 (SAT interactive), P23 (HAMPATH verifier), P24 (P showcase).