Prove the Two Definitions of NP Equivalent
Convert between nondeterministic polynomial time and polynomially bounded certificates.
Assignment sources
Related exam and assignment appearances
These links mark a related idea or close version; only groups explicitly marked as exact repeats in the question map count as duplicates.
Problem
Prove that a language is decided by a nondeterministic polynomial-time TM if and only if there are a polynomial and deterministic polynomial-time verifier such that
Track certificate length and total verification time in both directions.
Prerequisites
Know the unit definitions and how resources are measured against encoded input length. Distinguish a conditional theorem, a reduction, and an algorithm.
Hint 1
Encode one nondeterministic choice per simulated step.
Hint 2
Reject certificates that do not describe a legal accepting computation.
Hint 3
In the reverse direction, guess exactly a polynomially padded certificate, then run .
Full solution
Assume first that a nondeterministic TM decides and every branch halts within steps. Because the transition relation is finite, each step has at most a constant possible choices. Encode a branch by a string of bits, padding after early halting. Define to simulate deterministically, using successive blocks of to select transitions. Reject if a block names no legal transition, if the simulated branch rejects, or if it has not accepted by the clock.
The certificate length is , hence polynomial. A straightforward deterministic simulation of steps is polynomial in ; even a polynomial model-conversion overhead remains polynomial. There is an accepting branch of exactly when some choice string drives the simulation to acceptance. Therefore
Conversely, suppose and satisfy the verifier definition, with running in time . Construct an NTM that, on input , nondeterministically writes a certificate of length at most and then runs . One convenient fixed-length implementation guesses symbols including a padding symbol, verifies canonical padding, and interprets the prefix as . Guessing costs and verification costs at most , a polynomial in . Every branch halts.
If , a valid witness exists and one branch guesses it, so accepts. If , no witness makes accept, so every branch rejects. Thus decides nondeterministically in polynomial time.
The quantifiers matter. NP requires existence of one accepting branch or certificate for yes-instances and rejection of all branches for no-instances. It does not require a unique witness, and the verifier need not find a witness. Also, the polynomial bound must be in , not in the numerical value encoded by . Finally, a verifier must halt on every pair , including malformed or overlong certificates; these may simply be rejected.
Checkpoints
Check both logical directions, halting of every relevant branch, and that output length and construction time are polynomial in the encoded input length.
Common mistakes
- Using the entire computation tableau when a choice string suffices without bounding it.
- Saying a no-instance has one rejecting branch instead of all branches rejecting.
- Letting verification time be polynomial in the numeric value of the input.
Nondeterministic computation tree
Sources and verification
- Merged summary, pp. 40-42
- 2026 transcript 8
- Sipser 3e, sec. 7.3
- Arora-Barak draft, sec. 2.1
- Catalog mapping:
data/exercises.json; statements and solutions are independently written; personal submissions are non-authoritative.
Provenance and confidence
The exercise is an original synthesis. Confidence reflects verification of the mathematical claim against the textbook sources listed above; course sources are used only where direct coverage is identified.
Open in the visualization gallery: Nondeterministic computation tree