4.6.24Theory of Computation

P vs NP — statement, why it matters

2,018 words9 min readdifficulty · medium3 backlinks

WHAT are we even talking about?

We study decision problems — questions with a yes/no answer (e.g. "Does this graph have a route visiting all cities under length 100?"). We measure difficulty by how the running time grows with input size nn.


WHY is PNPP \subseteq NP (and why that's obvious)


The statement, precisely

Figure — P vs NP — statement, why it matters

NP-complete: the load-bearing pillars


WHY it matters (the stakes)


Common mistakes (steel-manned)


Recall Feynman: explain to a 12-year-old

Imagine a jigsaw puzzle. Checking if a finished puzzle is correct is easy — you just glance and see the picture. But solving it from a pile of pieces is hard work. "P" problems are like puzzles a robot can finish quickly. "NP" problems are like puzzles where, if someone shows you the finished picture, you can quickly say "yep, correct!" The giant mystery — P vs NP — is: for these check-easy puzzles, is there always a secret quick way to solve them too, or are some puzzles just doomed to be slow? Nobody on Earth knows. There's a million dollars waiting for whoever finds out.


Flashcards

What does P stand for (the class)
Problems solvable in deterministic polynomial time O(nk)O(n^k).
What does NP stand for
Nondeterministic Polynomial — problems whose yes-answers are verifiable in polynomial time given a short certificate.
State the P vs NP question
Does P=NPP = NP? Is every problem that's easy to verify also easy to solve?
Why is PNPP \subseteq NP
A poly-time solver can act as a verifier that ignores the certificate and just solves the instance itself.
What is a certificate/witness
A short (poly-length) hint that lets the verifier confirm a yes-instance in poly time.
Define NP-complete
A problem that is both in NP and NP-hard (every NP problem reduces to it in poly time).
What does Cook–Levin theorem state
SAT (Boolean satisfiability) is NP-complete — the first proven NP-complete problem.
If one NP-complete problem is in P, what follows
P=NPP = NP — they all collapse together.
Common myth: NP means "non-polynomial." Correct?
No. NP = verifiable in poly time; in fact PNPP\subseteq NP.
Difference between NP-hard and NP-complete
NP-hard = at least as hard as all NP (may be outside NP); NP-complete = NP-hard and in NP.
Name one consequence if P=NPP=NP
Most public-key cryptography (e.g. RSA) would break.
Is P vs NP solved?
No — it's an open Clay Millennium Prize problem ($1M).

Connections

Concept Map

measured by

defines

bounds checker of

checked by

reads

solve then ignore c

leads to

reverse direction

expert view

every NP maps via

lands in

hardest inside

Decision problems yes/no

Polynomial time O of n^k

Class P: solvable fast

Class NP: verifiable fast

Verifier V of x,c

Certificate / witness

P subset of NP

P =? NP

Most believe P != NP

NP-complete pillars

Poly-time reduction

Hinglish (regional understanding)

Intuition Hinglish mein samjho

Dekho, P vs NP ka core idea bahut simple hai: kya kisi answer ko dhoondhna utna hi aasaan hai jitna usko check karna? Maan lo koi tumhe bhara hua Sudoku de — tum jaldi se verify kar loge ki sahi hai ya nahi. Lekin khaali grid se solve karna? Bahut mehnat. Class P matlab woh problems jo poly time (n2n^2, n3n^3 type) me solve ho jaati hain. Class NP matlab woh problems jinka answer, agar koi hint (certificate) de de, toh poly time me verify ho jaata hai.

Ek galatfehmi door kar lo: NP ka matlab "Non-Polynomial" nahi hai. NP = Nondeterministic Polynomial = "verify karna easy". Isiliye har P problem NP me bhi hai (PNPP \subseteq NP), kyunki agar tum solve kar sakte ho toh verify toh kar hi sakte ho. Asli sawaal ulta hai: kya P=NPP = NP? Yaani jo check-easy hai woh solve-easy bhi hai kya? Aaj tak kisi ko nahi pata — yeh ek open Millennium Problem hai, $1,000,000 inaam ke saath.

Yeh matter kyun karta hai? Agar kal koi prove kar de ki P=NPP = NP, toh RSA jaisi saari encryption tut jaaye, kyunki uski security isi baat par tiki hai ki factoring "find karna" mushkil hai. Saath hi logistics, scheduling, protein folding — sab fast solve ho jaaye. Aur ek key cheez: NP-complete problems (jaise SAT, Travelling Salesman) — agar inme se kisi ek ka bhi poly-time algorithm mil gaya, toh saari NP problems ek saath solve ho jaayengi. Isiliye yeh sab ek hi dhaage se bandhi hain.

Exam tip: yaad rakho "P = Promptly solve, NP = Notarize a proof". Aur brute force slow hone ka matlab yeh nahi ki problem P me nahi hai — best algorithm kuch aur ho sakta hai. Yeh chhoti-chhoti baatein steel-man karke samjho, tabhi concept pakka hoga.

Go deeper — visual, from zero

Test yourself — Theory of Computation

Connections