Nondeterminism and Certificates
Branching computation, polynomial verification, and the equivalence of two views of NP.
Goals
- Define acceptance for nondeterministic machines.
- Translate between accepting branches and certificates.
- Avoid confusing nondeterminism with randomness.
Intuition
A nondeterministic decider accepts when at least one legal branch accepts. Equivalently, a short certificate lets a deterministic verifier check a yes-instance efficiently.
Formal definitions
A nondeterministic machine runs in time if every branch halts within . The class
A nondeterministic transition relation may offer several legal moves from one configuration. A computation tree has the initial configuration at its root and one child for each legal successor. The machine accepts if at least one branch accepts and rejects only if all branches reject. Nondeterminism assigns no probabilities to branches.
For general bounds,
and is defined analogously using at most work cells on every branch. Every branch must halt for an NTM decider. A single infinite branch invalidates a claimed time bound, even if another branch accepts quickly.
Nondeterministic computation tree
Trace one accepting root-to-leaf path and record its edge labels. That string is a certificate of choices. Then inspect a no-instance: there must be no accepting leaf anywhere.
A polynomial verifier for is a deterministic polynomial-time and polynomial such that
Theorem. The nondeterministic-machine and polynomial-verifier definitions of are equivalent.
Proof walkthrough
We prove both directions. Assume a standard multitape model and that deciders/verifiers halt.
Direction I — NTM to verifier. Let decide in nondeterministic time . Each configuration has at most children ( fixed for ). Encode each transition choice in bits. A certificate is the choice string along a branch of length , so .
The verifier simulates on according to : at each step it reads the next choice, rejects if the choice is illegal or ends before halt, and accepts only if the simulation reaches an accepting state within steps. Deterministic time is polynomial in .
Completeness: if some accepting branch exists; its choice encoding is an accepting certificate. Soundness: every accepted certificate describes a genuine accepting branch of .
Direction II — verifier to NTM. Given verifier and polynomial with iff some has , the NTM guesses a string of length bit by bit, then runs deterministically. If some guess accepts; if every guess rejects. The length bound is essential: without it, even reading an exponential witness is not polynomial in .
What this does not show. Equivalence does not give a deterministic polynomial simulation, nor settle .
Computation-tree size and deterministic simulation
Suppose each configuration has at most successors and every branch has length at most . The tree can contain
nodes for constant . A deterministic simulator can traverse this tree depth-first, simulate every branch, and accept if one leaf accepts. Therefore
for standard fixed-branching models and reasonable constructible . In particular,
The first inclusion lets a deterministic machine be an NTM with one choice. The second explores all polynomial-length choice strings.
This simulation is exponential in time, not polynomial merely because each branch is polynomial. The number of branches, not just branch depth, matters.
For space, naive depth-first exploration of a computation tree may encounter cycles and potentially infinite branches. Configuration graphs supply the correct finite object. An NTM using space has configurations. Acceptance asks whether an accepting configuration is reachable from the start configuration. Deterministically exploring this graph yields
by a straightforward simulation. A much stronger theorem, Savitch's theorem, gives
for , but its recursive reachability proof is beyond the basic tree enumeration used here. Consequently .
Space semantics
Space is measured on the largest branch footprint, not by adding space across simultaneous branches. The computation tree is mathematical semantics; the NTM does not physically store all branches at once. A branch may reuse work cells, so exponential time can coexist with polynomial space.
Define
Clearly . Savitch's theorem supplies the reverse containment after squaring a polynomial.
Worked example
For Hamiltonian cycle, a certificate is an ordering of all vertices. Check that every vertex appears once and each consecutive pair, including the last-first pair, is an edge. The check is polynomial in the graph encoding.
If vertices are numbered , the witness contains numbers of bits, so its size is . The verifier checks range, uniqueness, and required edges. With an adjacency matrix, each edge lookup is constant-time under the conventional indexed model; with a TM-level encoding, the total remains polynomial. A malformed or repeated vertex causes rejection.
SAT example. For a Boolean formula with variables , guess bits and evaluate the syntax tree bottom-up. Completeness: a satisfiable formula has an accepting assignment branch. Soundness: if any branch accepts, its bits define a satisfying assignment. This is existential semantics, not a randomized search claim.
Nondeterministic padding
For
the same length conversion used for deterministic classes applies to and . If has a nondeterministic -time decider and , its correctly padded version has a polynomial-time nondeterministic decider in total length .
The machine must first verify padding format, recover , and then simulate the original NTM. Every simulated branch must meet the translated bound. Padding changes the represented language; it does not imply that the original belongs to NP.
Padding often appears in conditional arguments. One assumes an equality at one resource scale, pads or unpads instances, and derives a consequence at another scale. The algebra must state both lengths and preserve the existential acceptance condition.
Common mistakes
- Requiring every branch to accept.
- Allowing exponential certificate length.
- Treating an unverified guessed object as evidence.
- Assigning probabilities to nondeterministic choices.
- Bounding only an accepting branch instead of every branch.
- Confusing branch depth with total tree size.
- Summing work space over all conceptual branches.
- Using graph search without handling repeated configurations.
- Applying a padding conclusion to the original language.
Visualization prompt
Show a branching computation tree with one accepting leaf and map its edge labels to a certificate string.
Exercises
Exercise 1 — Accept and reject semantics
Define when an NTM accepts input and when it rejects (as a decider). Prove that swapping accept and reject states need not decide .
Solution
Definition. accepts if some computation branch accepts. As a time- decider every branch halts within steps, and iff every branch rejects.
Swap. After swapping accept/reject, new acceptance is “some formerly rejecting branch exists” — existential — whereas requires “no accepting branch”, a universal condition. Local state swapping does not exchange the quantifiers.
Exercise 2 — Certificate as choice string
Prove that if then there is a deterministic polynomial verifier with certificates of length . State completeness and soundness.
Solution
Encode transition choices along a branch of length using bits per step. The verifier simulates according to and rejects illegal choices. Completeness: an accepting branch yields a certificate. Soundness: an accepted certificate is a real accepting branch. Time .
Exercise 3 — Polynomial depth is not
Prove a binary machine with branches of length may create tree nodes, and deduce why naive deterministic simulation does not prove .
Solution
A full binary tree of depth has nodes. Deterministic enumeration takes exponential time. The known inclusion is , not polynomial.
Exercise 4 — Nondeterministic space measure
Define for a nondeterministic machine. Prove that “some branch uses little space” is not the definition of .
Solution
is the maximum, over all branches, of work cells visited. requires every branch to stay within cells. Existential thrifty branches alone allow overflowing branches hidden behind an accepting path — not the definition.
Exercise 5 — Savitch and
State Savitch's conclusion for constructible , and deduce .
Solution
Savitch: . For , . Union yields . The reverse inclusion is immediate, hence equality.
Summary
Nondeterminism is an existential quantifier over branches. Short certificates and deterministic verifiers express the same idea; full deterministic simulation is exponentially costly.
Guided practice
Task 1 — Clique verifier
Build a polynomial verifier for CLIQUE. Prove completeness, soundness, and a certificate-length bound.
Solution
Certificate: vertex IDs. Checks: in range, distinct, and all pairs are edges. Length , polynomial time. Completeness: a true clique gives a list. Soundness: an accepted list is a clique. “Guess and accept” without checks is not a proof.
Task 2 — Complement trap
Explain why swapping accept/reject leaves in a machine for need not decide . Relate to versus .
Solution
Original rejection means every branch rejects. After swapping, one originally rejecting branch suffices for acceptance — too weak. is -evidence; is /no-evidence. Whether they coincide is open.
Task 3 — Simple path of length
Describe “simple path of length ” in three ways (NTM, verifier, tree) and prove membership in . What does deterministic simulation give?
Solution
Guess/receive as certificate a sequence of vertices; check legality, no repeats, and edges. Length ; reject if . All three views are the same . Deterministic enumeration: — exponential, not a proof.
Sources
- Student-summary evidence: merged course summary, pp. 25-42; pp. 50-54 are cited only where the material overlaps with tableaux. The summary is used for course alignment, not authoritative verification.
- Course evidence: Semester A 2026 transcripts 5-6, nondeterminism and padding.
- Verification: Sipser, 3e, pp. 292-304 and 321-330.
- Verification: Arora-Barak draft, pp. 43-64 and 83-88.
- Verification: Papadimitriou, pp. 35-51 and 159-170.
The pages this was written from
1 page
These pages were chosen by word overlap between the text here and the page's transcription — nobody has verified them. Treat them as a lead to check, not a citation.
Lecture 25 · page 1תרגיליםShared wordsוהוכיחו · לינארית · שקולה · פתוחה · אינה · לפי