A filled-in Sudoku takes a moment to check and can take an afternoon to solve. Is that gap real, or have we just not been clever enough? That is the P versus NP problem, open since 1971 and carrying a million-dollar prize. This module goes inside the question across 42 interactive demonstrations. Program a Turing machine, then watch its entire run compiled into a logic formula and solved. Find the smallest circuit for every small function. Build an imaginary world where P equals NP and another where it does not, and see why that dooms most proof strategies. Catch a lying prover with a handful of random questions, prove you know a secret without revealing it, and find out what a quantum computer would and would not change.
See also: Computational Complexity for satisfiability, search algorithms and the Exponential Time Hypothesis, Algorithms for running times, Mathematical Logic for proofs and Gödel, and Quantum for qubits and amplitudes.
Before asking how hard a problem is, pin down what solving it means. Program a Turing machine, count its steps, and meet the argument that gives more time strictly more power
NP is the class of puzzles whose solutions are easy to check. Hand a verifier a certificate, watch a machine guess, and notice how much harder it is to certify that no solution exists
Any checkable problem can be rewritten as one giant logic formula. Watch a machine’s whole computation compiled into clauses, solved, and decoded back into the run
Thousands of hard problems turn out to be one problem in disguise. Follow an instance through a chain of translations and carry its solution all the way back
If P ≠ NP there are problems that are neither easy nor complete. Graph isomorphism and factoring live in that twilight, and above NP a tower of harder classes rises
Almost every function needs an enormous circuit, yet nobody can name one that does. Count gates, find the smallest circuit for every small function, and watch parity defeat shallow circuits
Three theorems that explain fifty years of failure. Whole families of proof techniques provably cannot separate P from NP, and you can build the worlds that show it
Flip coins and some problems get dramatically easier. Test a polynomial identity with one random point, find primes by chance, and see why most theorists think the coins are unnecessary
Let the verifier ask questions and proofs become far more powerful. Catch a lying prover with the sum-check protocol, and prove you know a colouring without revealing it
If the best answer is out of reach, how close can you get? Sometimes arbitrarily close, sometimes not one percent better than guessing. The PCP theorem says why
Every online secret rests on a problem being hard. Multiply primes in a blink and fail to undo it, then tour the five worlds we might be living in
Quantum computers break factoring, but probably not NP. Run Shor’s period finding and Grover’s search, and see why a square-root speed-up is all unstructured search allows
Suppose it were true. Finding a proof would be as easy as checking one, and every optimisation problem would yield. Or would it — at n to the hundredth power?
What is proved, what is believed, and what happened lately. The strongest lower bounds known, the approaches still alive, and how to read a claimed proof