4.6.24 · D5Theory of Computation
Question bank — P vs NP — statement, why it matters
True or false — justify
True or false: "NP" stands for "non-polynomial."
False. NP means Nondeterministic Polynomial = verifiable in poly time; since , even easy problems live inside NP, so NP is not a synonym for "slow."
True or false: .
True. Any poly-time solver doubles as a verifier that ignores the certificate and just solves the instance itself, so every P problem is automatically in NP.
True or false: is known to be false.
False — it is open. Whether is exactly the P vs NP question; most experts believe it's false but nobody has proved it.
True or false: Every NP-hard problem is in NP.
False. NP-hard only means "at least as hard as all of NP"; it may lie outside NP — e.g. the Halting Problem (undecidability) is NP-hard yet undecidable, so it isn't even in NP.
True or false: If a problem has an exponential brute-force algorithm, it cannot be in P.
False. Brute force being slow says nothing about the best algorithm; shortest-path and primality (AKS 2002) have naive slow approaches yet sit comfortably in P.
True or false: Verifying a Sudoku solution and solving a Sudoku from scratch are the same difficulty.
False (as far as we know). Verifying is clearly poly-time (check rows/cols/boxes); whether solving is also poly-time is precisely the open P-vs-NP mystery.
True or false: If someone finds a poly-time algorithm for SAT, then .
True. SAT is NP-complete (see Cook–Levin Theorem), so every NP problem reduces to it; a fast SAT solver would give fast solvers for all of NP.
True or false: A problem in NP always has an exponential-time solver.
True but trivially. You can try all possible certificates and verify each, giving an exponential deterministic solver — that's the ceiling, not evidence it can't be faster.
True or false: is equivalent to "checking is as easy as finding."
True. That is the plain-language soul of the statement: are yes-answers that are easy to verify always easy to discover?
True or false: If , then no NP-complete problem can ever be solved.
False. They can be solved (they're decidable) — just not in polynomial time in the worst case; exact exponential algorithms and good heuristics still exist.
Spot the error
"NP problems are the problems computers can never solve." — what's wrong?
NP problems are all decidable; a machine can solve every one of them, just possibly slowly. "Never solvable" describes undecidable problems like the Halting Problem (undecidability), not NP.
"Since , binary search is an NP-complete problem." — error?
Being in NP is not being NP-complete. Binary search is in P (hence in NP) but is nowhere near NP-hard; NP-complete needs every NP problem to reduce to it.
"TSP-decision is solvable by trying all tours, so it's in P." — error?
"Finite / solvable by trying everything" is not "polynomial." grows faster than any , so brute force does not place TSP-decision in P.
"To show a problem is in NP, I must give a fast algorithm that finds the answer." — error?
NP only requires a fast verifier of a given certificate, not a fast finder. You supply the witness and check it in poly time; finding it can be hard.
"RSA is safe because factoring is undecidable." — error?
Factoring is perfectly decidable and even in NP (the factors are the certificate). RSA relies on factoring being believed hard to find, not impossible — and that safety evaporates if . See Cryptography and RSA.
"Cook–Levin proved ." — error?
No. Cook–Levin proved SAT is NP-complete (the first such problem); it says nothing about whether equals , which remains open.
"A reduction from problem A to problem B shows A is harder than B." — error?
It's the reverse: reducing A to B shows B is at least as hard as A, because a fast solver for B would solve A too.
Why questions
Why is considered "obvious"?
Because solving is stronger than checking: a poly-time solver can be repackaged as a verifier that discards the certificate and just runs the solver.
Why do all NP-complete problems "stand or fall together"?
Every NP problem reduces to each of them in poly time, so a single poly-time algorithm for one NP-complete problem would propagate through the reductions to solve them all → .
Why does a certificate have to be polynomial in length?
If the hint could be exponentially long, the verifier would need exponential time just to read it, destroying the whole point that verification is fast.
Why can't we settle P vs NP just by noting brute force is exponential?
Brute force being exponential bounds only one algorithm from above; proving requires showing no poly-time algorithm exists — a statement about all possible algorithms, which is far harder.
Why does "verifier view" of NP require the no-case too?
A valid verifier must accept some certificate on yes-instances and reject every certificate on no-instances; without the second condition a liar could always forge a hint and the definition would be useless.
Why would threaten cryptography but not automatically break every real cipher instantly?
guarantees a polynomial algorithm exists in principle, but the constants and exponent could be huge; still, most security proofs assume hardness, so the theoretical guarantee collapses. See Cryptography and RSA.
Edge cases
Is a problem with a constant-time solver (e.g. "is even?") in P? in NP?
Yes to both. Constant time is , a polynomial, so it's in P, and places it in NP as well.
Is the empty language (always "no") in NP?
Yes. A verifier that rejects every input for every certificate is a valid poly-time checker with no yes-instances to satisfy, so it trivially lies in NP (and in P).
Can a problem be NP-hard but not NP-complete?
Yes. If it's NP-hard but sits outside NP (e.g. undecidable problems, or ones needing exponential certificates), it fails the "in NP" half and so isn't NP-complete.
If a problem's only known algorithm is exponential, does that place it outside P?
No. "Known" refers to our current cleverness; a poly-time algorithm might exist undiscovered. Membership in P is about existence, not about what we've found so far.
Where does the Halting Problem (undecidability) sit relative to NP?
It is NP-hard (all of NP reduces to it) but undecidable, hence not in NP — a clean example that NP-hard ⊄ NP.
Is SAT with a fixed number of variables (say 3) still NP-complete?
No. With a constant bound on variables the search space is constant-sized, so it's decidable in w.r.t. the rest of the input; NP-completeness of SAT needs the number of variables to grow with input size. See SAT and Boolean Satisfiability.
Connections
- P vs NP — statement, why it matters (index 4.6.24)
- NP-Completeness and Reductions
- Cook–Levin Theorem
- SAT and Boolean Satisfiability
- Big-O and Time Complexity
- Decision Problems and Languages
- Turing Machines (Deterministic vs Nondeterministic)
- Halting Problem (undecidability)
- Cryptography and RSA