Complexity Theory · P vs. NP
Everyone Would Be Mozart
What if appreciating a symphony were as easy as composing one? P vs. NP from first principles: machines that read, machines that guess, and the gap nobody has closed.
A recipe does nothing. Neither does a knitting pattern, a page of sheet music, or a list of directions to a friend’s house. Each is a sequence of instructions, and each sits there, inert, until something comes along that can read it, understand what each step asks for, and do it. The instructions carry the procedure, but the procedure only happens when there is a reader.
So what is the least a reader needs? Not a cook or a musician: something far simpler, something with no understanding at all, that still follows any instructions you could write down. That question has an answer, and the answer is a Turing machine.
It turns out to be the right place to start a much bigger question. P vs. NP, the most famous open problem in computer science, is at heart a question about two kinds of these readers: one that follows its instructions one step at a time, and one that is allowed to guess. By the end of this article, you’ll have built both, watched the second one split into a tree of guesses, written one of its branches down as a string, and counted what it would cost an ordinary machine to search that tree. Whether that cost can be avoided is the whole question.
Let’s start with nothing, and add only what we’re forced to.
A machine that reads
Our reader faces some information laid out in front of it: a row of symbols, say. The textbook calls this row a tape, divided into cells, one symbol per cell, running on forever to the right, with a blank symbol in every cell nobody has written on. I’ll call each symbol an instruction, and I’m deliberately not going to separate instructions from data. We’ll see why in a moment.
The first thing the reader must do is read: look at one symbol, the one under its head.
Reading alone gets it nowhere. A reader that can’t change anything can’t compute anything, so it must also write: replace the symbol under its head with another.
A reader stuck on one cell can only ever see one symbol, so it must move: one cell to the left or one to the right.
And now the crucial piece. Suppose the instructions say “if you have just seen an , do one thing; otherwise, do another”. The reader must remember something about where it has been. So it keeps an internal state: a label from a fixed, finite list . The state is the machine’s memory, a summary of the trajectory that brought it here: what it has seen, and what it now believes.
Read, write, move, remember. That is all a Turing machine is. Each step, it looks at its state and the symbol under its head, and a fixed rule called the transition function tells it what to do:
Switch to state , write over the , and move in direction . Then do it again, and again, possibly forever, until the machine enters one of two special states, (accept) or (reject), where it halts. Written as a whole, the machine is the tuple
Each part has a job:
Notation: the parts of a Turing machine
- , the states
- A finite list of labels, : the machine’s memory.
- , the input alphabet
- The symbols an input may be written in. For our first machine, just and .
- , the tape alphabet
- Everything that can appear on the tape: the input symbols, the blank , and any other symbol the machine writes.
- , the transition function
- The rules. For each state and symbol , exactly one move : a new state (one of ), a symbol to write (one of ), and a direction (one of , ).
- , ,
- Where the machine starts, with its head on the first symbol of the input, and the two states where it stops: accept and reject. A move into either one ends the run on the spot, so it needs no direction: the head stays where it is.
- , “is one of”
- reads “ is one of and ”. Curly brackets list the members of a set.
Two things about this memory are worth pausing on.
First, it is finite. A machine with states can tell apart only different pasts, which is about bits (8 states hold 3 bits, since ), and that number is fixed before the machine sees its input. However long the input, the state can only say what kind of trajectory led here, never the trajectory itself. Anything longer has to be written out onto the tape. The tape is the scratchpad; the state is the reader’s sense of where it is in the procedure.
Second, nothing stops the symbols on the tape from describing another machine. Write down a machine’s states and its as a string, put it on the tape next to an input, and build a reader whose instructions say “look up what that machine would do, and do it”. That reader is a universal Turing machine. It treats the other machine as data, never knowing it is running a procedure. This is why I’m not separating instructions from data: the line between them was never really there. A sequence of instructions is a machine, and a machine is a sequence of symbols.
Our first machine
Let’s build one. Here is the smallest question I could find with a little memory in it:
Does the input, a string of ‘s and ‘s, contain two ‘s in a row?
A machine for it needs to remember exactly one thing: whether the last letter it read was an . So two working states will do. means “the last letter wasn’t an ” (or there was no last letter); means “the last letter was an ”. The machine never needs to write anything new, so it writes back what it reads, and it only ever moves right. Here is all of :
| reading | reading | reading | |
|---|---|---|---|
| reject | |||
| accept | reject |
Now let’s run it on . To follow the run, we need a way to write down where the machine is at any moment:
Definition
- Configuration
- A snapshot of the machine: its state, everything on its tape, and where its head is. We’ll write it as the tape with the state placed just before the symbol under the head, set in bold. So means “in state , head on the first ”.
Step 0 (start):
Step 1 (read , remember it):
Step 2 (read , forget it):
Step 3 (read , remember it):
Step 4 (read a second while in , and accept):
Four steps, one configuration at each, and an answer. Every configuration but the last has exactly one successor, because gives exactly one move for every state and symbol. That is what makes the machine deterministic: run it twice on the same input and it does exactly the same thing twice. Its whole computation is a single line, . Hold on to that line. In a moment, it will split.
And since a machine is just a sequence of symbols, we can hand this one to a universal machine as data. Its table becomes a few lines of text, the universal machine reads them alongside , and it carries out exactly the run we just traced:
The tape doesn’t matter
Before we let the machine guess, I want to loosen the picture, because the tape is just a convenience. It is a way of presenting information to the reader, nothing more.
The same symbols could sit on a 2D grid, and the reader could move up and down as well as left and right. Or in a 3D cube, with six directions. Or the reader could have several tapes and several heads. We can even let it jump: teleport its head to any cell and act there. Or we could lay the information out in the most absurd object, in the most absurd way. None of this changes what can be computed. Each of these machines can be imitated by the plain one-tape machine above.
What it changes is how long it takes. Here is a concrete case. To decide whether a word is a palindrome, a machine with two tapes can copy the word onto the second tape, rewind, and compare the two, one pass each: about steps for a word of length . A machine with one tape has no second copy to compare against, so it has to shuttle: erase the first letter, remember it, run to the far end, check and erase the last letter, run back, and repeat. Each pass erases one letter, so each is one cell shorter than the last:
So the second tape bought a speed-up from to , and not because the one-tape machine was clumsy: it is a theorem, from the 1960s, that no one-tape machine can decide palindromes in fundamentally fewer than steps. And this is the general picture: any machine with several tapes that runs for steps can be imitated on one tape in about steps. Grids, cubes and machines that jump all come out the same way. The slowdown is never worse than a polynomial, or or for some fixed .
There is one condition, and it holds this whole article together: each step does a bounded amount of work. Symbols come from a finite alphabet, the state is finite, and a jump costs about as much as writing down where you are going: a jump of a million cells costs about twenty steps (a million has twenty binary digits), not one. Break that rule, by letting one step update unlimited information, or jump any distance for free, or store a real number to infinite precision, and you get machines that can do things no real computer can. Keep it, and every reasonable machine imitates every other at polynomial cost.
Hold on to that word, polynomial. Changing the machine costs a polynomial. It will turn out to be the whole reason polynomials matter.
Letting the machine guess
Go back to our deterministic machine and look at what is doing. At every position, it carries a piece of information forward (“the last letter was an ”), just in case it turns out to matter. What if, instead, the machine could simply guess where the begins, and check only the letter after it?
To allow that, we change one thing: may now offer several moves at once, or none.
Notation: a transition function that guesses
- The rule in words
- For each state and symbol , now gives a set of moves instead of exactly one. Each move is still a triple: a new state (one of ), a symbol to write (one of ), and a direction (one of , ). The set may hold several moves, one, or none.
- Every possible triple: each state, paired with each symbol, paired with each direction. The builds all the combinations.
- , “is a subset of”
- is some of those triples: the moves allowed from state reading .
A machine like this is a nondeterministic Turing machine (NDTM). Here is one for our question, with every allowed move listed in each entry:
| reading | reading | reading | |
|---|---|---|---|
| or | reject | ||
| accept | none | reject |
Reading an in , the machine has two moves: keep looking (stay in , choice 1), or guess that starts here (go to , choice 2). In , a second confirms the guess. A refutes it, and there is no move at all: that line of computation simply stops, and counts as a rejection.
What does it mean to run a machine that has two moves at once? It means following both. Every configuration with two moves has two successors, and the computation is no longer a line. Let’s run it on the same , writing down, at each step, every configuration the machine could be in.
Step 0:
Step 1 (an : two moves):
Step 2 (the guess in reads , and dies):
Step 3 (another : two moves again):
Step 4 (the guess in reads : it was right):
The machine has accepted. The other two configurations don’t stop, though. Every branch runs in parallel, and they keep going until each one halts. One more step and the remaining guess dies on the final ; one after that, the last reads and rejects.
Here is how many configurations the machine was in at each step, counting the ones that halted there:
| Step | 0 | 1 | 2 | 3 | 4 | 5 | 6 |
|---|---|---|---|---|---|---|---|
| Count | 1 | 2 | 1 | 2 | 3 | 1 | 1 |
Draw each configuration as a node and each move as an edge, and the line we had before becomes a tree: a computation tree, with one branch for every complete sequence of choices. The rule for reading the tree is the heart of nondeterminism:
Definitions
- Accepting
- An NDTM accepts its input if at least one branch of its computation tree reaches .
- Running time
- The length of its longest branch: the depth of the tree, not the total work across all of it. When that is a polynomial in , the length of the input, we’ll call it .
It doesn’t matter how many other branches die or reject. One is enough. (In general a branch could also run forever, but the machines that define NP come with a time bound: every branch halts within steps, so the tree is finite.) The branches don’t talk to each other, and there can be exponentially many of them, but the machine is charged as if it had followed only one. That is where its power comes from.
Letters a and b, up to 6. Choose any node to follow its branch.
4 branches, 1 accepting, so the machine accepts. This branch accepts (read a second a). Its choices: c = 1, 2.
Two machines for “does the input contain aa?”, one row per step, with the tape down the left: every configuration in a row reads the cell beside it. The deterministic machine remembers whether the last letter was an a (state q₁) and accepts on a second one. The nondeterministic machine keeps no track of the last letter: at every a it may keep looking (choice 1) or guess that aa starts here and switch to q₁ to check (choice 2). A wrong guess has no move, and its branch stops there (✗). Switch machines, change the input, and choose any node to follow its branch.
Switch the figure to the deterministic machine and the tree collapses back into our line from earlier. Both machines answer the same question on every input. The difference is in how they get there: one carries its memory forward, the other guesses and lets the wrong guesses fall away.
Writing a branch down
Here’s the observation the rest of this article stands on.
Pick the accepting branch in the tree above. Along it, the machine faced exactly two choices: at step 0 it kept looking (choice 1), and at step 2 it guessed that starts there (choice 2). Write those choices down as a string:
Now build an ordinary deterministic machine that takes two inputs, and . It runs the NDTM’s rules, but whenever offers several moves, it doesn’t guess: it reads the next entry of and takes that one. follows exactly one branch of the tree, the one describes, and it is deterministic, because has made every choice in advance.
How long can be? One entry per step, at most. If the NDTM’s branches are never longer than steps on inputs of length , then has at most entries, and runs in polynomially many steps too: about with on a second tape, about if one head has to shuttle between and . Following a branch costs barely more than the NDTM itself.
So is a short piece of evidence that the answer is yes, and is a fast way of checking it. Both have names:
Definitions
- Certificate
- A short piece of evidence that the answer is yes: here, the choice string of an accepting branch.
- Verifier
- A deterministic machine that checks a certificate in polynomial time: here, . It accepts only if really does show that the answer is yes.
The idea is older than the machines:
- Sudoku. Finding a solution to a big puzzle may be hard. Hand me a filled-in grid and I can check it in a minute. The filled grid is the certificate.
- Factoring. Does 8,633 have a factor between 2 and 90? Finding one takes some searching. Hand me 89 and I can check it with one division: 8,633 = 89 × 97.
It works in the other direction too. Given any fast verifier, build an NDTM that guesses a certificate, one symbol per step, writing it onto its tape, and then runs the verifier on it. Some branch guesses a good certificate exactly when one exists. So “decided by an NDTM in polynomial time” and “has short certificates checkable in polynomial time” describe exactly the same problems.
Guessing a sum
Our machine was a gentle start: its wrong guesses died almost as soon as they were made, so its tree never grew wide. Here is a problem where they don’t.
Subset sum. Given some numbers and a target , does some selection of the numbers add up to exactly ?
Take the numbers and . A nondeterministic machine walks along the numbers and, at each one, makes a choice: skip it, or take it and add it to a running total. At the end it checks whether the total is . Every branch is one selection, and its certificate is just its list of skips and takes. Here is the whole tree, as a figure:
Numbers: 2, 3, 5. Does some of them add up to 5?
2 of the 8 branches reach 5, so the answer is yes.
c = skip, skip, take. Check: 5 = 5 ✓
Subset sum, guessed one number at a time: dashed lines skip a number, solid lines take it, and each leaf shows the total its branch took. The leaves that hit the target (✓) are the accepting branches. Choose a leaf to see its certificate and the verifier’s check, and try 11, which no selection reaches.
Two of the eight leaves reach 5: take only the 5, or take the 2 and the 3. Either list of choices is a certificate, and checking it takes at most one addition.
Now count the leaves. Each number doubles them, because every branch alive splits in two:
| Numbers | Branches |
|---|---|
| 1 | 2 |
| 2 | 4 |
| 3 | 8 |
| 10 | 1,024 |
| 30 | 1,073,741,824 |
| 60 |
The tree is levels deep, so the NDTM finishes in about steps of guessing, plus the check. Its tree, meanwhile, grows exponentially wide. Every single branch is quick. There are simply too many of them.
This is a real machine, not just a picture. It’s in my machine library, and you can open it in AutomataStudio, which explores its branches as it goes. Its numbers are written in unary, where 3 is written 111, with the target first, so 111#1#11 asks whether some of 1 and 2 make 3; try 111#11#11, where nothing does. (Unary keeps the tape readable, but by the catch in the aside it also makes this version easy: a target written as a row of 1s is never bigger than the input. The hard version writes its numbers in binary.) The same idea works on composite numbers: guess a factor, then check it divides.
111#1#11), then three (111#1#1#11), then four (111#1#1#1#11): 4, 8 and 16 branches. Last, 111#11#11 asks whether 2 and 2 can make 3. All 4 branches halt without accepting, and the machine rejects.And here is its verifier, , built exactly as in the last section. I took the machine above and deleted the two transitions where it guesses. In their place, each number on the tape now starts with its choice already written in: for take, for skip. So the input asks “do make ?”, with the certificate woven into . Everything else is the same machine, and it no longer has a single choice to make.
+ or a - from the input, and AutomataStudio now classes the machine as deterministic. It accepts 111#+1#+11 after 69 steps, and rejects 111#-1#+11, whose certificate takes only the 2.What it costs to stop guessing
Real computers don’t guess. So suppose we only have a deterministic machine, and we want it to give the same answers as an NDTM. Can it?
Always, and the last two sections tell us how. Every branch of the tree is the run of for some choice string . So a deterministic machine can simply try them all: write down the first possible , run , and if it accepts, say yes; otherwise move on to the next . If none accepts, say no.
Let’s count what that costs. Say the NDTM never has more than moves to choose from, and its branches are at most steps long. A choice string has at most entries, each one of values, so there are at most
of them. Each takes about steps to follow. The whole search takes about
which is exponential in . For our subset sum machine, and there are choices to make: strings to try. With 3 numbers that’s 8 runs. With 60, it’s a billion billion.
The outer loop of that search is nothing more than counting through every string of binary choices, , , all the way to . A three-state machine can do that, and you can watch what it costs: with bits on its tape it halts after 9 steps for , 2,049 for , and 106,497 for . Exactly, it takes steps: every bit added to the input doubles the running time, and then a little more.
# followed by n zeros. The table reads 9 steps at n = 1, 2,049 at 7 and 106,497 at 12, and the panel’s estimate is about 2.2n. It comes out above 2n because the exact count, 2(n + 1)·2n + 1, has an extra factor of n. The one-tape palindrome machine, for comparison, is quadratic.So the question was never whether a deterministic machine can do what a nondeterministic one does. It can: by brute force, through every branch. The question is whether it can do it without paying exponentially.
That question can be asked of every kind of machine, and the answers differ. Taking the guessing out of a finite automaton can cost exponentially many states, but it always works. For a pushdown automaton, it can’t be done at all: guessing gives it real power. For a Turing machine, guessing adds no power, and what it costs to remove is exactly what nobody knows.
The machines in the table
- Finite automaton
- A machine with states but nothing to write on: it reads its input once, left to right, and remembers only its state.
- Pushdown automaton
- A finite automaton with a stack: memory it can add to and take from, but only at the top.
- Büchi, co-Büchi, parity and weak automata
- Finite automata that read infinitely long inputs. They differ in how they decide whether an endless run counts as accepting.
| Machine | Does guessing add power? | What it can cost to remove |
|---|---|---|
| finite automaton | no | exponentially many states |
| pushdown automaton | yes | it can’t be removed |
| Büchi automaton | yes | it can’t be removed |
| co-Büchi and parity automata | no | exponentially many states, or more |
| weak automaton | yes | it can’t be removed |
| Turing machine | no | possibly exponential time: the P vs. NP question |
To say what “without paying exponentially” means for a Turing machine, we need to look at polynomials properly.
Why polynomial means efficient
We measure a machine by how its number of steps grows with , the length of its input.
Definitions
- Polynomial time
- At most steps, for some fixed numbers and that don’t depend on the input. , and are all polynomial.
- Exponential time
- Like , where the input size sits in the exponent. Every extra symbol of input multiplies the time.
- Superpolynomial
- Growing faster than every polynomial. Exponential time is superpolynomial, and so are things in between, like .
- Galactic
- Polynomial in principle, with an exponent so large that the algorithm is useless in practice: , say.
Complexity theorists call problems with polynomial-time algorithms efficiently solvable, and that can look arbitrary. Why there? Why not , or “under a second”? Here are three reasons, and each one is something we can work out.
Polynomials survive being combined. Suppose machine runs in steps and hands its output to machine , which runs in steps on an input of length . writes at most one symbol per step, so its output is at most about long. Then takes at most
steps, and the pair takes about : still a polynomial. Call one polynomial routine a polynomial number of times, and the same thing happens: calls of an routine cost . So “efficient” stays efficient when you build big programs out of small ones. A cut-off at "" wouldn’t: feed one routine’s output to another, and you can get .
Polynomials don’t care about the machine. This is the word we held on to. Switching from two tapes to one, or from a grid to a tape, or from jumps to steps, costs at most a polynomial. A polynomial of a polynomial is a polynomial, so whatever is polynomial on one reasonable machine is polynomial on all of them. “Efficiently solvable” belongs to the problem, not to the hardware. A cut-off at “linear” would fail this test immediately: palindromes take time proportional to on two tapes and to on one.
Polynomials scale. Double the input to an algorithm:
It takes 8 times as long, always, whatever is. Turn that around: a computer twice as fast handles inputs times as large (the cube root of 2), and one a thousand times faster handles inputs ten times as large. Better hardware multiplies the size you can handle. Now double the input to a algorithm:
Its running time is squared. Faster hardware barely moves it: a computer a thousand times faster, , handles about ten more items, and that’s all. Better hardware only adds to the size you can handle.
| Steps | At a billion steps a second | When n doubles |
|---|---|---|
| n2 | 2.5 µs | ×4 |
| n3 | 125 µs | ×8 |
| n100 | 10143 × the age of the universe | ×1030 |
| 2n | 13 days | ×1015 |
Four running times at a billion steps a second. Polynomials grow by a fixed factor when n doubles; 2n multiplies by 2n. The grey row is a polynomial too, but a galactic one: slower than 2n until n reaches about a thousand.
The figure also shows where the idea stops being honest. is a polynomial, and it is hopeless: at it outlasts the universe by a factor of . Polynomial isn’t a promise of speed. It’s a promise of scaling. In practice, once a natural problem has a polynomial algorithm at all, someone usually finds one with a small exponent. But that is experience, not a theorem.
P, NP, and the question
We have everything we need. Think of a problem as a question with a yes-or-no answer about an input written as a string: “does this string contain ?”, “does some selection of these numbers add up to ?”, “is this formula satisfiable?”.
Definitions
- P
- The problems a deterministic machine can solve in polynomial time.
- NP
- The problems a nondeterministic machine can solve in polynomial time. Equivalently, by the section on writing a branch down: the problems whose “yes” answers have short certificates that a deterministic machine can check in polynomial time, and whose “no” answers have none it would accept.
Every problem in P is in NP. A deterministic machine is just a nondeterministic one that never has a choice; or, if you prefer certificates, a machine that can solve a problem fast can check any claimed answer by ignoring the certificate and solving it. So
(read it “P is contained in NP”), and P vs. NP asks whether the two are equal. Can a deterministic machine, on its own, decide everything a nondeterministic machine decides in polynomial time, and still finish in polynomial time?
It doesn’t have to be the same polynomial. An NDTM that runs in steps, matched by a deterministic machine that needs , would still mean P = NP. What matters is staying in the same class: an exponent that is a fixed number, however large, and never grows with the input. And the deterministic machine doesn’t have to imitate the NDTM at all. It only has to give the same answers, by any method whatsoever.
Or, in the slogan: if checking an answer is easy, is finding one easy too?
That slogan is older than the name. In 1956, Kurt Gödel wrote to John von Neumann, asking how many steps a machine would need to find a proof of a given length. If it could be done in roughly or steps, he wrote, the mental work of a mathematician on yes-or-no questions could be completely replaced by machines. Stephen Cook and Leonid Levin made the question precise in the early 1970s, and it has stood ever since.
Fifty years later, Scott Aaronson put what is at stake better than anyone:
If P=NP, then the world would be a profoundly different place than we usually assume it to be. There would be no special value in “creative leaps,” no fundamental gap between solving a problem and recognizing the solution once it’s found. Everyone who could appreciate a symphony would be Mozart; everyone who could follow a step-by-step argument would be Gauss; everyone who could recognize a good investment strategy would be Warren Buffett.
Appreciating a symphony is checking it: the verifier reading a certificate. Composing one is finding it: the search through the tree. Aaronson wrote this in a list of reasons to believe P ≠ NP, because a world without that gap seems too strange to be ours. It is a reason to believe, though, not a proof. Nobody has shown that the gap is real.
One problem for all of them
NP holds thousands of problems people actually want solved: scheduling, routing delivery vans, packing boxes, colouring maps, finding short proofs, and subset sum. It would seem that P vs. NP is thousands of separate questions. It is one.
In 1971, Cook showed that one problem, SAT, is as hard as everything in NP. SAT asks: given a logical formula, such as
can its variables be set true or false to make the whole formula true? (This one can: true, true, false.)
Notation: reading a formula
- , ,
- “Or”, “and” and “not”. is true exactly when is false.
- Clause
- One bracket. A formula like this one is true when every bracket has at least one true entry.
- 3-SAT
- SAT with three entries to a bracket. That is where the difficulty starts: with at most two, SAT is easy.
Cook’s insight was that the whole run of an NDTM on an input can itself be written down as a formula. Picture the space-time view from the first clip: one row per step, one column per cell. Give every square of that grid a few variables, saying which symbol is in it and whether the head is there and in which state. Then add small clauses that check the first row is the input, that each row follows legally from the one above, and that some row reaches . Setting the variables amounts to choosing a branch, so the formula is satisfiable exactly when some branch accepts, and since the grid is only by , the formula is only polynomially large. So any NP problem can be translated into SAT in polynomial time, and an algorithm for SAT answers it.
A year later, Richard Karp showed that 21 familiar problems are just as hard, subset sum among them (he called it knapsack): SAT translates into each of them, and each translates back. Problems like these have a name:
Definition
- NP-complete
- A problem in NP that every problem in NP can be translated into in polynomial time. Solve one of them fast, and you have solved all of NP fast.
There are now thousands of them, all the same problem in different clothes.
So the whole question rests on any one of them. Find a polynomial algorithm for SAT, or subset sum, or any NP-complete problem, and every problem in NP gets one: translate, then solve. Prove that any one of them has no polynomial algorithm, and P ≠ NP.
Brute force, or something clever?
Let’s go back to our tree one last time, because there is a second question hidden inside the first. Does a deterministic machine have to search every branch, or is there a cleverer way through?
Fix the input . Every choice string picks out one branch of its tree, and follows it: one deterministic machine, handed a different each time. Out of all the choice strings, a subset lead to the accept state: in the subset sum figure, the leaves marked ✓. A deterministic machine searching the tree has to find a member of before it can stop and say “yes”. And if is empty, as it was for the target 11, it has to say “no” and know it is right, which by brute force means ruling out every single branch. The “no” answers are where the search is most expensive.
Two things keep this picture honest. First, the deterministic machine is under no obligation to search at all. It needn’t look at branches, or find a member of , or produce a certificate: answering yes or no correctly is enough, by any method. And for NP-complete problems, a fast yes-or-no answer would hand you the certificate too. Given a fast decider for subset sum, ask “is there still a solution without the first number?”; drop it if so, keep it if not, and move on to the next. One question per number, and what you are left holding is a solution. That is why Aaronson’s symphony survives the move to yes-or-no questions: deciding fast would mean composing fast. Second, “clever” doesn’t automatically mean “polynomial”. Between brute force and polynomial there is a great deal of room. An algorithm that solved 3-SAT on variables in
would beat brute force’s handsomely, and would still be nowhere near polynomial. So beating brute force, even by a lot, wouldn’t settle P vs. NP.
That leaves two sensible possibilities.
- It cannot. No deterministic machine solves the NP-complete problems in polynomial time: some superpolynomial cost is unavoidable. That is P ≠ NP, and it is what most people expect.
- It can, but at an absurd price. There is a polynomial algorithm, but its exponent is a fixed, finite and enormous number: , say. That would be P = NP by a galactic algorithm, true in principle and useless in practice. Look back at the grey row in the figure: the world would barely notice, and nobody would become Mozart. Aaronson’s world needs P = NP and an algorithm fast enough to run.
There are stranger possibilities at the edges: that P = NP with a practical algorithm, which almost nobody believes, and that it can be neither proved nor disproved from the standard rules mathematicians build proofs from, which nobody has ruled out.
Why now
I’ve been thinking about all this because of the last few weeks of November 2026, which have been strange ones for mathematics. Two AI labs posted rival claimed proofs, hours apart, that VP ≠ VNP: the algebraic version of P vs. NP, about how hard certain polynomials are to compute. A proof of the Riemann Hypothesis, the most famous open problem about how the prime numbers are spread out, was built with an AI model and has been certified correct in Lean, a program that verifies proofs line by line, and rebuilt independently by other mathematicians; but it runs to millions of lines, and no explanation a person can read has been released. Claimed algorithms have appeared that would refute the Exponential Time Hypothesis, the conjecture that 3-SAT can’t be solved in less than exponential time. Independent groups have checked a new method for multiplying two grids of numbers in about steps, against by the school method, and a newer preprint claims that nothing can do better. And an AI-generated proof of the existence half of the Yang–Mills problem, one of the seven million-dollar Millennium Prize problems, this one from physics, has been accepted by a review committee; the other half, the mass gap, is still open. Some of these have been checked by machine or by experts, but none has yet been through the slow, ordinary process by which mathematics accepts a result.
None of them settles P vs. NP either, and the people behind them say so. VP ≠ VNP is a statement about algebraic circuits, not Turing machines. The ETH refutation, if it holds, is an algorithm of exactly the kind in the last section: much faster than brute force, still superpolynomial.
And as I write, there is a rumour, with no paper, no authors and nothing yet to check, that someone has shown P = BQP. BQP is the class of problems a quantum computer can solve in polynomial time, allowed a small chance of error. The best evidence that quantum computers are stronger than ordinary ones is Shor’s algorithm, which factors large numbers in polynomial time on a quantum computer, a feat no known ordinary algorithm matches. If P = BQP, that evidence evaporates. Factoring would have a polynomial-time algorithm on an ordinary machine, and in principle the RSA and elliptic-curve cryptography that protects most of the internet would fall without anyone building a quantum computer; in practice, that depends on the exponent, as it does for any galactic algorithm. And since machines allowed to flip coins sit between ordinary and quantum ones, every fast coin-flipping algorithm would have a fast coin-free one too. It wouldn’t settle P vs. NP, though: it is widely believed that quantum computers can’t solve NP-complete problems efficiently either. Until there is something to check, it is a rumour, and the people passing it on say as much.
But these results are its neighbours. VP vs. VNP is the same question asked of algebra, and the Exponential Time Hypothesis is a sharper claim about exactly how hard 3-SAT is. Problems of this kind stood for decades, and now claimed proofs are arriving within weeks of one another, often with machine-checkable versions. I should say why most complexity theorists would bet against what comes next. Proving P ≠ NP runs into known barriers, with names like relativization, natural proofs and algebrization: theorems showing that whole families of proof techniques cannot settle it, and it isn’t clear they block algebraic questions like VP vs. VNP in the same way. Whatever proof comes will have to find a way around them. So I have no argument for what comes next, only a hunch from the pace: if problems of the same class keep falling at this rate, I wouldn’t be surprised to see a proof of P vs. NP by next year.
If it comes, it will be about the two readers we built at the start. Instructions mean nothing until something reads them. The question is whether a reader that follows one path at a time can keep up, in polynomial time, with one that walks every path at once.