4.6.23 · D1Theory of Computation

Foundations — NP — non-deterministic polynomial, verifier definition

2,116 words10 min readBack to topic

The parent note throws a lot of symbols at you in one breath: , , , , , , , , and phrases like "polynomial time" and "decision problem." If any of those are fuzzy, the whole definition collapses into noise. So here we earn each one, in an order where every new symbol only uses ones we already built.


0. The picture behind the whole thing

Before any symbol, hold this image: a problem is a giant field of possible answers. Searching the field is slow. But a good tip points you to one spot, and checking that spot is fast.

Figure — NP — non-deterministic polynomial, verifier definition

Everything below is just this picture, translated into precise notation.


1. Decision problem — a yes/no question

Why the topic needs it. NP is defined only for yes/no problems, because the definition talks about which inputs are "yes" instances. If a problem returned a number or a list, the machinery (, one-sided certificates) wouldn't fit.


2. Input and its size

Figure — NP — non-deterministic polynomial, verifier definition

Why the topic needs it. Every speed claim ("polynomial time") is measured relative to . Without a clear notion of input size, "fast" and "short" have no yardstick.


3. Language — the set of all YES inputs

The notation (read " is in ") means "the input is a YES instance." means " is a NO instance."

Why the topic needs it. The entire definition of NP is a statement about when . Turning "the answer is yes" into " belongs to a set " lets us reason with set membership instead of vague English.


4. Polynomial time — the meaning of "fast"

Figure — NP — non-deterministic polynomial, verifier definition

Why the topic needs it. Both the verifier's speed and the certificate's length are bounded "in polynomial time / polynomial size." This is the yardstick behind the whole class.


5. The polynomial and the bound

The inequality reads: "the length of the certificate is at most of the input length." In words: the tip must be short relative to the input.

Why the topic needs it. Without this cap you could smuggle in an enormous tip that already contains the full answer — the verifier couldn't even read it in poly time. Step 2 of the parent's derivation is precisely this loophole-fix.


6. Certificate — the tip / witness / proof

Why the topic needs it. is the heart of the "easy to check" idea. No certificate → nothing to check → you're back to solving from scratch.


7. Verifier and the output

Why the topic needs it. is the formal machine that captures "checking is easy." Its two arguments and its output are exactly the notation the definition uses.


8. The logic symbols: , ,

Now the parent's defining line reads in plain English:

" is a YES instance exactly when there exists a tip that is short enough AND makes the judge ring the bell."


9. Nondeterminism — "magical guessing"

Why the topic needs it. The letter N in NP comes from this model. Understanding that "guess" = "certificate" dissolves the mystery of the name.


Prerequisite map

Decision problem yes or no

Language L set of YES inputs

Input x and its length

Polynomial time meaning of fast

Polynomial p bounds tip length

Certificate c the tip

Verifier V fast two-input judge

Logic symbols exists and iff

NP definition

Nondeterministic machine guessing

P subset NP and beyond

Everything on the left ultimately feeds the single boxed idea: NP. Notice how "polynomial time" () feeds three different children — it is the yardstick for both the tip's length and the judge's speed.


Equipment checklist

Self-test: can you answer each before revealing?

A decision problem is...
a question with only YES or NO as the answer.
means...
the number of symbols in the written input — its length, not its numeric value.
For a number , is roughly...
(the count of digits/bits), not itself.
The language is...
the set of all inputs whose answer is YES; means " is a YES instance."
Polynomial time means...
at most steps for fixed constants — e.g. , never .
Why is polynomial the chosen "feasible" line?
polynomials compose/add/multiply into polynomials, so chaining fast steps stays fast.
is used to...
cap the certificate length so it stays short relative to the input.
The certificate is...
the short "tip"/proof/witness that lets you check a YES instance quickly.
The verifier takes...
two inputs, and , and outputs (accept) or (reject) in poly time.
means...
there exists at least one such tip — you only need one.
means...
if-and-only-if: both sides are true together or false together.
Why is NP one-sided?
only YES instances need a working certificate; for NO instances no certificate makes accept.
Nondeterministic "guessing" corresponds to...
writing down the certificate ; the machine accepts if some branch does.

Once every box above rings clear, re-read the parent definition — see the topic note — and it should read like plain English. From here the natural next steps are P vs NP Problem, Polynomial-Time Reductions, and NP-Completeness.