P versus NP
Is finding a solution ever fundamentally harder than checking one?
In March 1956 Godel wrote to the dying von Neumann asking how fast the best machine could find a proof of length n. The part makes the question precise: polynomial time as the definition of efficient, the time hierarchy theorem and Savitch's theorem to separate and relate classes, and NP as the problems whose answers can be checked. Cook-Levin is built rather than quoted: a small nondeterministic machine becomes a tableau of 2 by 3 windows, a formula of 3,416 to 23,324 variables, and the series' clause-learning solver decodes an accepting run from a model. One five-clause formula is then carried through independent set, clique, vertex cover, 3-colouring and subset sum, with each solution mapped back. The part widens to coNP and Pratt certificates, to PSPACE and games, and to Williams's 2025 simulation of time t in about the square root of t space. It turns on why the question resists proof: relativization, natural proofs and algebrization each rule out a family of techniques. It ends with Impagliazzo's five worlds and what P = NP would and would not give.
What you need. Big-O notation and graphs from Act IV; propositional logic (and, or, not, CNF).
- Mathematics, ideas and history
- the hierarchy theorems, Savitch, NP, Cook–Levin, the reduction web, PSPACE and games, Ladner, barriers, five worlds
- What we build or compute
- verified reductions; our SAT solver
What you will be able to do
Degree
- Define P and NP with a verifier and a certificate, and show that a given problem is in NP.
- Explain what a polynomial reduction is and what NP-complete means.
- Reduce 3-SAT to independent set and map a satisfying assignment to an independent set and back.
Graduate
- Prove the time hierarchy theorem by diagonalization and Savitch's theorem by midpoint recursion.
- Prove Cook-Levin by the tableau and count the variables and clauses of the formula.
- Tell weak from strong NP-hardness, and say when a pseudo-polynomial algorithm or an FPTAS exists.
Research
- State the relativization, natural-proofs and algebrization barriers and what each rules out.
- State Williams's time-space simulation and Ladner's theorem, and name the open separations around them.
- Explain what the minimum circuit size problem asks and why meta-complexity ties it to cryptography.
Industry
- Recognize scheduling, packing and dependency resolution as NP-hard models, and choose between a SAT or ILP solver, an approximation and a heuristic.
- Encode a puzzle or a configuration problem as CNF, run a CDCL solver, and report UNKNOWN separately from UNSAT.
Contents
Each chapter has a home level. Choose a track to see what to read and watch: Degree 17 min · Graduate 36 min · Research 45 min · Industry 22 min.
- 0Finding against checkingDegree2 min
- 1What counts as efficientDegree2 min
- 2More time, more problemsGraduate3 min
- 3NP: problems with checkable answersDegree2 min
- 4Reductions and completenessDegree2 min
- 5Cook–Levin: SAT is NP-completeGraduate2 min
- 6The web of reductionsDegree4 min
- 7NP-completeness everywhereIndustry2 min
- 8Strong and weak hardnessGraduate2 min
- 9coNP and the polynomial hierarchyGraduate2 min
- 10Space: games and alternationGraduate3 min
- 11Time in square-root spaceResearch2 min
- 12Between P and NP-completeGraduate2 min
- 13SAT in practiceIndustry3 min
- 14Why it is hardResearch3 min
- 15Five possible worldsDegree2 min
- 16Frontier: complexity about complexityResearch4 min
- Recap, problems, and where this comes backAll tracks3 min
Also on this page: Lecture · Key results · Try it · Lab · Problems · Notes and sources · 中文 · Build the film.
Lecture
The text of each chapter is the film's narration, as it is spoken, so you can read along or revise without the film. The pictures are in the film.
Finding against checkingDegree2 min
In March 1956 Kurt Gödel wrote a letter to John von Neumann. A machine can obviously decide, for any formula and any number n, whether the formula has a proof of length n: just try them all. The question, Gödel wrote, is how fast the number of steps grows for the best possible machine. If it grew only like n, or n squared, then the mental work of a mathematician on yes-or-no questions could be completely replaced by a machine. Von Neumann was dying of cancer and never answered. The letter was found decades later. It asks, fifteen years before anyone else, the question of this part: is finding a proof as easy as checking one?
Here is the question in modern form. This planted three-colourable graph has sixty vertices and a hundred and twelve edges. Find a colouring with different colours at adjacent vertices. Checking a supplied valid colouring examines every edge. We measure that check repeatedly on this host. Multiplying its average duration by three to the sixtieth gives an exhaustive-enumeration scenario. It is neither a measured search nor a lower bound: a search can stop early and reject invalid candidates faster. Our clause-learning solver finds a colouring quickly for this instance, and every edge is checked. Whether every graph admits a polynomial-time decision algorithm remains open. This finite success does not answer P versus NP.
1What counts as efficientDegree2 min
Suppose a computer takes a microsecond per step. An algorithm taking n squared steps handles a hundred items in ten milliseconds. N cubed takes a second. Two to the n is fine at twenty and hopeless at sixty: thirty-six thousand years. At a hundred, it is four times ten to the sixteen years. And n factorial at sixty is beyond any number of universes. The universe is fourteen billion years old. Faster hardware does not rescue exponential algorithms. A computer a thousand times faster lets an n squared algorithm handle inputs thirty-one times larger, but a two to the n algorithm only ten items more.
Polynomial time is a useful mathematical boundary. Edmonds's 1965 matching work helped establish this viewpoint. Cobham studied its independence from standard machine details. Deterministic multitape Turing machines and appropriately costed RAM models simulate one another with polynomial overhead. Unbounded integer arithmetic at unit cost would require a different analysis. Polynomially many calls to polynomial-time subroutines still take polynomial time, including the cost of writing their inputs. The extended Church-Turing thesis is a broader physical claim, commonly phrased using efficient probabilistic classical simulation. Quantum computation challenges that claim; it is not a theorem equating every model with P. Asymptotic membership also does not promise practical speed: large exponents and constants matter.
2More time, more problemsGraduate3 min
Can extra time provably add power? Yes. In a standard deterministic multitape model, for constructible bounds f and g at least n, f times log f being little-o of g gives a strict inclusion from TIME f to TIME g. The gap condition matters. Here is the diagonal idea, with technical clock choices suppressed. Decode a machine from a padded input, simulate that machine on the entire input, and reverse acceptance after a clock expires. Choose the clock so simulation fits the larger budget while eventually exceeding every fixed constant times the smaller one. Suppose a smaller-time decider recognized this diagonal language. It has arbitrarily long padded descriptions, so choose one beyond its runtime constants and finite exceptions. On that input the simulation finishes and reverses its answer. That contradiction proves a separation. Padding and overhead are essential parts of the theorem, not optional details. One consequence is P strictly contained in EXP. This does not separate P from NP.
Here is the map of the classes this part needs. Logarithmic space, its nondeterministic version, polynomial time, NP, polynomial space, exponential time, exponential space. Each sits inside the next. The hierarchy theorems prove that some of these are different. P is not exponential time; logarithmic space is not polynomial space. So between P and exponential time at least one inclusion is strict, but nobody knows which. Every one of them might be strict. Space behaves differently from time because it can be reused. A machine that runs for t steps can visit at most t cells, and a machine using s cells has at most exponentially many configurations in s, so it either halts within that many steps or loops forever.
Savitch's theorem removes nondeterminism at a space cost. For a suitable space bound s at least log n, nondeterministic space s is contained in deterministic space of order s squared. To test reachability within t edges, use zero edges for equality, one for an edge or equality, and otherwise try every midpoint with integer half-budgets. Our path examples measure actual recursive calls and depths. A theoretical recursive frame stores only a constant number of configurations, the midpoint iterator and a budget. With a read-only input and s at least log n, the configuration count is exponential in s. Logarithmically many recursive levels therefore use order s squared space. Time can be very large; these finite path counts illustrate that cost without proving a growth law. Consequently PSPACE equals NPSPACE. The analogous polynomial-time question is still open.
3NP: problems with checkable answersDegree2 min
Here is the definition behind finding and checking. A decision language is in NP when each yes-instance has a certificate whose bit length is polynomial in the input length. One deterministic polynomial-time verifier accepts exactly the valid input-certificate pairs, with no accepting certificate for a no-instance. A graph colouring, a satisfying assignment or a Hamiltonian path can supply such a certificate for the corresponding decision problem. NP does not require short certificates for no-instances. That is a statement about the class definition, not a claim that individual no-instances cannot have short proofs.
The N in NP stands for nondeterministic, and the two views agree. A nondeterministic machine branches at every choice, and accepts if any branch does. Given such a machine, the certificate is simply the list of choices along an accepting branch, and a verifier replays that single branch in polynomial time. Conversely, given a verifier, a nondeterministic machine guesses the certificate one bit at a time and then runs the verifier. So NP is exactly nondeterministic polynomial time. Every problem in P is in NP, since the verifier can ignore the certificate. And NP sits inside polynomial space, since one machine can try every certificate in turn, reusing the same cells.
Consider six decision problems. SAT, clique, Hamiltonian cycle and binary-encoded subset sum have polynomially checkable yes-certificates. For these general problems, polynomial-time algorithms remain unknown. This is not a claim that every best known algorithm has the same exponential bound. Graph isomorphism asks for an adjacency-preserving bijection. Babai's quasipolynomial upper bound is faster than a general exponential bound, while polynomial time remains open. Primality is in P by the AKS theorem, so it needs no extra certificate for polynomial-time decision. A verifier can always exhaust all polynomial-length certificates using exponential time.
4Reductions and completenessDegree2 min
Part 25 carried impossibility from problem to problem with reductions. Here they get a budget. A reduces to B in polynomial time if a polynomial-time function f turns every instance of A into an instance of B with the same answer. Then a fast solver for B gives a fast solver for A: compute f, and ask. A polynomial applied to a polynomial is still a polynomial. Read the other way, if A is hard, then B is at least as hard. And reductions chain: if A reduces to B and B to C, then A reduces to C.
Now define hardness and completeness. B is NP-hard if every language in NP has a deterministic polynomial-time many-one reduction to B. B is NP-complete if it is also in NP. The picture draws disjoint easy and complete regions under the assumption that P differs from NP. If any NP-complete language is in P, every NP language is in P. Equivalently, if some NP-complete language is outside P, all of them are. Neither premise is currently proved. Cook and Levin supplied the first complete problem by encoding polynomially bounded computations as satisfiability.
Decision can also recover a witness. First ask whether this SAT formula is satisfiable. Then try setting each variable to true while retaining earlier choices. Keep true when the remaining formula is satisfiable; otherwise choose false. The retained four-variable trace uses five actual queries, including the initial test. Each query and answer is saved. The invariant is that every chosen prefix extends to a full satisfying assignment. If P equals NP, this method extends through SAT encodings to polynomially bounded, polynomial-time verifiable witness relations. It does not promise to invert any arbitrary many-one reduction. Compositeness decision is already in P; finding a nontrivial factor is a different search problem.
5Cook–Levin: SAT is NP-completeGraduate2 min
Cook and Levin encoded bounded nondeterministic computation as satisfiability. A tableau records configurations in rows: tape symbols, state and head position. Our tiny machine scans right and may enter an accepting state when it reads a one. Acceptance is made absorbing. The displayed input zero zero one zero has six rows, hence at most five transitions, with explicit borders. One accepting run reaches acceptance after three transitions. Adjacent rows are constrained by overlapping two-by-three windows. We enumerate the legal local patterns for this fixed machine; the count is specific to its alphabet and transition rules. The start row has exactly one head, and legal overlapping windows enforce a valid successor. We also check each decoded whole configuration directly, independently of the window encoding.
Translate those conditions into Boolean variables. A variable says that a particular row and column contains one specified symbol or state-symbol pair. Exactly-one clauses give every cell a single value. Unit clauses fix the initial input and head. Auxiliary choices enforce one legal window at every position between adjacent rows. The final row must contain the accepting state. Because that state is absorbing, earlier acceptance extends to the final row. The formula is satisfiable exactly when an accepting branch fits this row budget. For a fixed machine, quadratic many cells and window positions, each with a constant-size local encoding, give polynomial formula size. The construction uses the machine, input and time bound without knowing an accepting branch. Applying it to any polynomial-time NP verifier proves SAT NP-complete.
We ran the finite construction. Inputs consisting of zeros followed by a one, of lengths two through eight, produce the displayed variable and clause counts. Full formulas and solver models are retained. Every decoded accepting tableau is checked against whole-machine transitions, and a separate configuration search confirms the bounded acceptance result. The all-zero example is rejected within its stated budget. These experiments check our implementation. The general theorem follows from the encoding argument and its polynomial bound, rather than from extrapolating the seven measurements.
6The web of reductionsDegree4 min
Once one problem is NP-complete, the rest get easier. To show that a new problem B is NP-complete, it is enough to put it in NP and reduce SAT, or any known NP-complete problem, to it. The first step is three-SAT, where every clause has at most three literals: split a long clause into a chain of short ones linked by new variables. Here is a small formula: five clauses over four variables, satisfied by seven of the sixteen assignments. We will push it through three reductions, solve each disguised problem, and translate the answer back.
First disguise: independent set. Choose k vertices of a graph, no two joined by an edge. Make a triangle for each clause, one vertex per literal. Since the vertices of a triangle are all joined, you can pick at most one from each clause. Then join every literal to every copy of its negation, so you can never pick both x and not x. An independent set of five vertices picks one literal from every clause, consistently: a satisfying assignment. Our solver found one, and the five green vertices are it. The same five vertices are a clique in the complement graph, and the other ten are a vertex cover. So clique and vertex cover are NP-complete too, almost for free.
Second disguise: colouring a graph with three colours. Start with a triangle whose colours we name True, False and Base. For each variable, two vertices, x and not x, joined to each other and to Base: one must be coloured True and the other False. For each clause, a small gadget whose output vertex can be True only if one of its inputs is; chain two for three literals, and join the output to False and Base, forcing it to be True. Our formula becomes a graph of forty-one vertices. Written as a SAT problem for our solver, a hundred and twenty-three variables. The colouring it found, read back as truth values, satisfies the original formula. And an unsatisfiable formula, put through the same construction, gives a graph that cannot be three-coloured. We checked that too.
Third disguise, with no graphs at all: subset sum. Pick some of these numbers to hit the target exactly. Each number is written in decimal, one column per variable and one per clause. The number y i has a one in variable i's column and in every clause where x i appears; z i does the same for not x i. The target has a one in every variable column, so exactly one of y i and z i must be chosen: a truth value. It has a three in every clause column. The chosen literals contribute between one and three there, and two slack numbers per clause can top it up, but only if at least one literal is true. No column ever holds more than five ones, so there are no carries and the columns cannot interfere. The green rows come from our solver's assignment, and they add up to the target exactly. Numbers have become logic.
In 1972 Richard Karp connected twenty-one classical problems by polynomial reductions. The grouped list includes satisfiability, zero-one integer programming, clique, cover and packing problems, Hamiltonian cycles, colouring, matching, knapsack and max cut. The indentation is a display grouping, not a reconstruction of the exact historical reduction tree. Garey and Johnson later collected hundreds more examples. For a new decision language, proving membership in NP and reducing a known NP-complete language to it adds another complete problem. A polynomial-time algorithm for any one of them would solve all NP languages.
7NP-completeness everywhereIndustry2 min
Hardness appears in many generalized decision problems. Offline Tetris asks whether a specified board and known piece sequence can achieve a stated objective, such as enough cleared rows, under the chosen move rules. Minesweeper consistency asks whether a finite clue layout has a compatible mine placement. Generalized Sudoku completion lets board dimensions grow; a fixed nine-by-nine puzzle is a finite case. The folding example concerns a specified lattice hydrophobic-polar model and energy threshold, not unrestricted physical protein behaviour. Each named decision variant has a polynomially checkable witness and an appropriate hardness reduction. Different rules or objectives may change the classification. Long two-player games introduce another set of questions, considered in the space chapter.
Engineers meet these problems in general-purpose forms. Scheduling models often lead to integer programming or constraint programming. In one-dimensional bin packing, first-fit decreasing has an eleven-ninths asymptotic guarantee with an additive constant; it is not a pure eleven-ninths bound for every small instance. Expressive dependency constraints can make package installation NP-complete. Actual package managers use different techniques, including SAT, incompatibility learning and backtracking; PubGrub is not the algorithm of every manager. Configuration and register allocation also produce hard general models. NP-completeness describes worst-case reductions. A polynomial-time algorithm for all instances would imply P equals NP; many real instances remain easy. Match the model to the task, then consider exact solvers, structure, approximation guarantees or explicitly limited heuristics.
8Strong and weak hardnessGraduate2 min
Why can a dynamic program solve subset sum? The familiar dense recurrence uses order n times W scalar work, where W is the target value. Our actual bitset version stores sums from zero through W and shifts many bits at once; each operation still has a limb cost. W can be exponential in its binary encoding length, so this is pseudo-polynomial, not polynomial in the full input length. The digit comparison describes possible numeric-range growth, not an exact law for these timings. The table retains every weight, target, final reachable bitset and explicit subset witness. Separate meet-in-the-middle searches check the answers. For thirty twelve-digit weights, meet in the middle uses exponentially many subsets in half the variable count. It avoids a table proportional to W, while arithmetic and storage still depend on integer bit lengths.
Numeric encodings refine hardness. Weakly NP-hard numerical problems such as subset sum admit pseudo-polynomial algorithms, but their binary-encoded general cases remain NP-hard. Strong NP-hardness persists even when numeric parameters are polynomially bounded, as in three-partition and suitable bin-packing decision formulations. Some optimization problems admit useful rounding schemes. Positive-profit zero-one knapsack has an FPTAS: for each positive epsilon it obtains at least one minus epsilon of optimum in time polynomial in the input length and one over epsilon. Weak hardness alone does not guarantee an FPTAS. For strongly NP-hard optimization with an integer objective polynomially bounded on the hard restricted instances, an FPTAS would imply P equals NP. Asymptotic schemes such as bin packing's have a different guarantee. State the objective and approximation definition before drawing conclusions from hardness.
9coNP and the polynomial hierarchyGraduate2 min
NP requires short certificates for yes-instances. CoNP consists of languages whose complements are in NP, so their no-instances have short efficiently checkable certificates. Tautology for general Boolean formulas is a coNP-complete example: a falsifying assignment certifies a no-answer. Enumerating every assignment is one decision method, not a necessity for every yes-instance. CNF tautology has a different, easy structure. Whether NP equals coNP is open; equality would follow from P equals NP, but the converse is not known. Bounded nontrivial-factor decision lies in both classes. If an NP-complete language were also in coNP, then NP would equal coNP.
Define the factor question carefully. For N at least two and k below N, ask whether N has a divisor d between two and k. Divisor one is excluded. The full prime factorization, with primality certificates, answers both yes and no: compare the smallest prime factor with k. Its total bit length is polynomial in log N. Pratt certificates recursively certify the prime factors of p minus one and exhibit an element of order p minus one modulo p. The order criterion then proves p prime. We retain the complete certificate for two to the sixty-first minus one and certificates for both displayed factors. One checker counts certificate nodes; a separate arithmetic checker records the modular powers. These are different counts. AKS later put primality decision itself in P. Factoring search still has no known classical polynomial-time algorithm.
Alternation produces the polynomial hierarchy. An existential block of polynomially many bits followed by a polynomial-time predicate gives NP. A universal block gives coNP. They are duals at the same first level, not successive levels. An existential block followed by a universal block gives the second existential level, with its universal-existential dual beside it. Each quantified string has polynomial BIT LENGTH in the original input; the numerical values can therefore be exponentially large. If the existential and universal classes coincide at level k, the entire hierarchy collapses to that level. P equals NP would collapse it to P. None of the displayed separations is assumed proved.
10Space: games and alternationGraduate3 min
Polynomial space has its own complete problem. Take a formula with quantifiers in front, alternating: there exists x one, for all x two, there exists x three, and so on. Is the whole thing true? Evaluate it by recursion: try both values of the first variable, and evaluate the rest for each. The recursion only needs one assignment and a stack, so the space is polynomial. The time can be exponential, although on our random formulas early answers prune most of the tree. Larry Stockmeyer and Albert Meyer proved in 1973 that this problem is complete for polynomial space. Satisfiability is the special case with only existential quantifiers.
Quantifier alternation also describes games. Generalized geography moves a token along a directed edge to a vertex not visited before; a player unable to move loses. Here player one places the starting token, and player two moves next. The displayed winner and position count follow that initial-placer convention. A separate recursive set search checks the result. Our actual instrument memoizes positions and can use exponential storage. For the PSPACE membership proof, traverse possible plays depth first, keeping only the current path of at most the number of vertices. Generalized geography is PSPACE-complete under the standard rules. That theorem and the storage cost of our finite memoized implementation are distinct claims.
Generalized games require precise rules. Hex winner decision is PSPACE-complete. Results for Go depend on the ko and repetition rules, while suitable generalized chess and checkers rules yield EXPTIME-complete problems. These statements concern growing boards and formal move conventions. A polynomially bounded play length gives a depth-first polynomial-space upper bound when positions and legal moves are efficiently represented. Exponentially long play requires a separate configuration or game-graph analysis; length alone proves no completeness result. EXPTIME-complete problems are outside P by the time hierarchy. PSPACE versus P remains open. Offline Tetris concerns achieving a stated one-player objective with known pieces, rather than a two-player winner question. A fixed everyday board is a finite instance of a generalized family.
Space also matters at the bottom. Logarithmic space allows a read-only input and a handful of counters and pointers. Its nondeterministic version, NL, has a natural complete problem: is there a path from s to t in a directed graph? In 1987 and 1988 Róbert Szelepcsényi and Neil Immerman independently proved a surprise: NL is closed under complement. The trick is to count the reachable vertices, layer by layer, nondeterministically but verifiably. So for space, unlike what we expect for time, guessing a no is as easy as guessing a yes. In 2005 Omer Reingold showed that reachability in undirected graphs needs no guessing at all. Whether logarithmic space equals polynomial time is as open as P versus NP.
11Time in square-root spaceResearch2 min
How much space can simulate a time-bounded computation? For deterministic multitape Turing machines, divide a computation into blocks. The grid is an illustration of dependency structure, not a literal implementation of the entire proof. Hopcroft, Paul and Valiant obtained a time-over-log-time space simulation in 1977. Improving that general bound resisted progress for decades. Williams's 2025 theorem gives TIME t contained in SPACE of order square root of t log t, for t at least n, in the stated multitape model. It is not an unrestricted RAM theorem. The proof reduces the simulation to implicitly generated tree-evaluation instances. Shared dependencies may be unfolded into a much larger tree, accessed on demand rather than stored in full.
Tree evaluation asks for the root value. Leaves carry values and internal nodes provide explicit tables mapping child values to a parent value. Keeping a value at each level uses height times value length space. This motivates pebbling-based algorithms and lower-bound conjectures. Proving sufficiently strong tree-evaluation lower bounds would separate small-space classes from P, but those separations remain open. Cook and Mertz found a more space-efficient evaluation algorithm using algebraic techniques. This undermines some pebbling intuitions; it does not settle membership in L or disprove the conjecture that tree evaluation is outside NL. Williams uses that improved algorithm as an ingredient in the multitape simulation theorem.
Compare the asymptotic functions. At a trillion steps, the expressions t over log base two of t and square root of t log base two of t differ dramatically. The table evaluates those functions with constants omitted, not measured or guaranteed memory cell counts. The theorem implies that for space-constructible s at least n, and every fixed positive epsilon, some problems in SPACE s are outside TIME s to the power two minus epsilon. The machine model and constructibility conditions matter. This is a time-space separation theorem, not a resolution of P versus PSPACE or L versus P.
12Between P and NP-completeGraduate2 min
Suppose P differs from NP. Ladner's theorem then supplies languages in NP that are neither in P nor NP-complete under polynomial-time many-one reductions. One proof uses a carefully controlled restriction or padding of satisfiability. This is a proof sketch, not a claim that ordinary padding makes SAT trivial. Delayed diagonalization chooses the growth rate slowly enough that the resulting language remains in NP. It defeats polynomial-time deciders and candidate completeness reductions in successive stages, under the assumption P differs from NP. The construction is artificial. Proving that a familiar natural candidate is intermediate remains a separate challenge.
Several natural problems motivate the question. Suitable decision versions of factoring and discrete logarithm lie in NP intersect coNP. RSA inversion and Diffie-Hellman assumptions are related to those searches, but should not be described as proved equivalent to them. Graph isomorphism has a quasipolynomial algorithm and cannot be NP-complete under standard reductions unless the polynomial hierarchy collapses. The minimum circuit size problem is another candidate: given a full truth table, is there a small circuit computing it? None of these is proved intermediate; each might still be in P. Their possible NP-completeness has different known consequences. In contrast, Bulatov and Zhuk proved a dichotomy for each FIXED finite constraint language over a finite domain: its decision CSP is in P or NP-complete. The fixed-template condition matters.
13SAT in practiceIndustry3 min
Clause learning explains many practical SAT successes. Decide a variable value, using activity to guide choices. Unit propagation forces a literal when every other literal of its clause is false. Two watched literals avoid scanning every clause at every step. When a clause is falsified, follow the implication reasons. First-UIP analysis learns a clause implied by the original formula. Backjump to a level where that clause propagates, retaining the learned information. Our teaching solver also uses Luby restarts and saved phases. Exhausting a conflict budget returns unknown, never a refutation. The retained comparison uses the same formulas for DPLL and CDCL. Recursive DPLL nodes and CDCL decisions plus conflicts are DIFFERENT work units; host timings exclude the separate native reference checks. Resolved and budget-exhausted trials are reported explicitly.
Random SAT displays a striking finite-size pattern. For each plotted ratio and variable count, generate independent random clauses with three distinct variables and fair signs. We retain every formula, complete solver status and positive model, and cross-check resolved answers with a native solver. Our twenty or forty trials per point show a drop in satisfiability and a peak in median conflicts near the transition region. The notes give binomial uncertainty intervals. A coarse finite grid cannot locate an exact limiting threshold or establish a scaling exponent. The vertical line near four point two seven marks a prediction, not a theorem inferred from these plots. Friedgut proved sharp-threshold behaviour; Ding, Sly and Sun established the predicted limiting threshold for sufficiently large clause length. Those theorems and this small three-SAT experiment have different scopes. A dated update: 2026 preprints report existence and computability of the three-SAT limiting threshold, and an upper bound of four point two six eight. The notes identify these reported claims and the exact versions inspected; our finite plots establish none of them.
SAT solvers also support mathematical proofs. We find and check Schur colourings through thirteen in three colours and forty-four in four colours. For fourteen with three colours, a native solver supplies a refutation trace whose every retained addition is checked by independent unit propagation. Our budget-limited forty-five-in-four run remains unknown when exhausted. Heule's published result establishes the five-colour Schur boundary at a hundred and sixty, using a huge proof computation. We do not repeat that proof here. For Pythagorean triples, our local SAT models supply complete colourings up to the displayed finite sizes, and we check every integer triple. The separate 2016 result of Heule, Kullmann and Marek establishes the boundary at seven thousand eight hundred and twenty-four. We independently check the larger instance's triple encoding, not its two-hundred-terabyte refutation. Solving, retaining a proof, and checking that proof are separate operations. Each reported verification names the artifact and checker actually used.
14Why it is hardResearch3 min
Some theorems constrain possible proof techniques. Baker, Gill and Solovay constructed an oracle relative to which P equals NP. A PSPACE-complete oracle makes both sides equal PSPACE. They also constructed an oracle relative to which P differs from NP. An argument that remains valid with every oracle cannot decide the unrelativized question, because it would give the same answer in these incompatible worlds. Many standard simulation and diagonal arguments relativize in this sense; this is not a claim about every possible use of those tools. Time hierarchy results survive relativization and separate appropriate time classes. They do not by themselves separate P from NP.
Circuit lower bounds face another barrier. A superpolynomial circuit lower bound for SAT would imply P differs from NP, and in fact the stronger statement that NP is not contained in P over poly. Strong results exist for restricted models, including parity against constant-depth AND-OR circuits and clique against monotone circuits. A natural property is constructive in polynomial time in the FULL truth-table length, holds for a sufficiently large fraction of truth tables, and is useful against the specified small circuits. All three conditions matter. Such a test can distinguish genuinely random functions from suitably secure pseudorandom functions. Under a sufficiently strong quantitative pseudorandomness assumption, Razborov and Rudich rule out natural properties proving the targeted general circuit bounds. Ordinary one-way-function existence alone is not the stated quantitative hypothesis. This is a conditional barrier to a class of circuit arguments, not a theorem excluding every proof of P differs from NP.
Arithmetization escapes some relativization limits. The interactive-proof results in Part 27 turn Boolean computations into low-degree polynomial questions. Aaronson and Wigderson formalized a stronger limitation called algebrization, showing that important algebraic techniques still do not settle P versus NP. A proposed argument must be assessed against the precise barrier it encounters. Calling a proof simultaneously nonrelativizing, nonnatural and nonalgebrizing is only shorthand, with the natural-proof claim conditional and circuit-specific. Williams's algorithm-to-lower-bound method proves that NEXP has no polynomial-size, nonuniform, constant-depth ACC-zero circuit family. The permitted gates and depth are part of the statement. These results supply new methods, without resolving the central P versus NP question.
15Five possible worldsDegree2 min
Impagliazzo's five worlds organize hypothetical possibilities. Algorithmica means P equals NP. Heuristica keeps worst-case hardness while NP problems are easy on the relevant efficiently samplable distributions; it does not say every generated input is easy. Pessiland has average-case hard NP problems but no one-way functions. Minicrypt has one-way functions and the private-key primitives they imply, while public-key cryptography remains unavailable in the intended picture. Cryptomania adds public-key cryptographic capabilities. These are informal worlds with specific distributional and security assumptions, rather than five proven consistency theorems. P differs from NP alone does not choose among the average-case and cryptographic worlds. Parts 29 and 30 develop those distinctions.
What would P equals NP imply? A bounded proof search with an efficiently checkable formal proof could recover a proof in polynomial time in the statement and the chosen length bound. It would not decide unbounded mathematical truth. Efficiently verifiable finite scheduling and routing objectives could be optimized through decision queries. Certain bounded circuit-learning searches would become efficient; finding the smallest unrestricted program remains undecidable. Computational cryptography based on one-way functions would fail. Information-theoretic secrecy, including a properly used one-time pad, is outside that conclusion. Large exponents, constants and the need to identify an algorithm could still make the theorem impractical. Historical opinion polls measure researchers' beliefs, not evidence of a mathematical separation. The Clay prize recognizes a valid resolution; neither applications nor consensus substitute for a proof.
Could the unrelativized question be independent of our axioms? Part 25 explained that effective arithmetic theories can leave statements undecided. P differs from NP can be expressed by saying that every clocked polynomial-time SAT decider has a finite counterexample. Encoding machines and polynomial clocks gives a universal-existential arithmetic form; quantifier count alone is no evidence of independence. Relative independence examples concern particular constructed oracles and specified formal theories. They do not prove that ordinary P versus NP is independent of ZFC. No such independence conclusion is established here. The connections between algorithms and lower bounds instead provide concrete mathematical methods for continued work.
16Frontier: complexity about complexityResearch4 min
Complexity about complexity. Measure complexity itself on a finite example. Enumerate all two hundred and fifty-six three-input Boolean functions using binary AND-OR formulas. Count literal leaves, allow negations only on inputs, and do not provide free constants. We retain a minimum-size formula for every truth table and check all trees and the complete dynamic-programming closure. Majority needs five leaves; parity and its complement need ten, the maximum in this experiment. Khrapchenko's general quadratic lower bound for parity matches that value at three inputs only as a lower bound of nine, not an exact answer. Counting shows that almost all functions require exponentially large circuits, but a circuit is not a fan-out-one formula and the precise size measure matters. Proving superlinear general circuit lower bounds for suitable explicitly computable families remains difficult. Our finite enumeration is a complete small calculation, not a solution to that asymptotic question.
Compare results only within their circuit models. Li and Yang's 2022 result supplies a dated example of a three point one n minus lower-order gate bound in the B-two basis, where every two-input Boolean gate is permitted. We are not presenting it as a verified current-record survey. Formula and constant-depth lower bounds use different restrictions and size conventions. A superpolynomial circuit lower bound for SAT would imply NP is not contained in P over poly, which is stronger than P differs from NP. Such a circuit bound is a sufficient route, not a necessary equivalence. Geometric complexity theory studies related algebraic lower bounds. The negative occurrence-obstruction results rule out a particular proposed strategy in specified settings, not the entire programme.
Meta-complexity asks how hard it is to recognize complexity. Minimum circuit size takes a FULL truth table and a size threshold. A candidate circuit can be checked on every input in time polynomial in that table length, so the decision problem is in NP. Standard deterministic NP-completeness remains a separate question. Hirahara's 2022 partial-truth-table result proves NP-hardness under RANDOMIZED polynomial-time reductions. It does not establish the unqualified deterministic completeness claim. Liu and Pass relate one-way functions to mild average-case hardness of exact time-bounded Kolmogorov complexity on uniformly random strings, for appropriate polynomial time bounds at least one plus epsilon times the string length. The time bound, uniform distribution and error requirement are essential; this is not an equivalence with public-key encryption. These results connect the difficulty of recognizing short descriptions to computational cryptography, while leaving the stated qualifications intact.
Six directions remain. P versus NP, NP versus coNP, P versus PSPACE and L versus P. The deterministic many-one hardness of ordinary minimum circuit size. Classical polynomial-time algorithms for factoring search and graph isomorphism. Rigorous numerical characterization of the random three-SAT threshold, beyond the existence and computability reported in 2026 preprints, and distinguished from a finite fifty-percent crossing. Further time-space simulation improvements, with the model and quantifiers specified. General circuit lower bounds for suitable families in P or NP: improving a linear coefficient, such as five n, is different from proving a superlinear bound such as n log n. The starred exercise studies finite random-SAT samples with uncertainty. It does not ask you to claim an asymptotic theorem from a small fit.
Recap, problems, and where this comes backAll tracks3 min
This part built a map of computational complexity. Polynomial time under standard cost models; the correct time hierarchy and Savitch proof ideas; NP certificates; a bounded Cook-Levin encoding with complete traces; concrete reductions and mapped witnesses; coNP, prime certificates and quantifier alternation; games and space; the multitape square-root-space theorem; and a clause-learning SAT solver with finite random-instance measurements. The experiments verify finite implementations, while theorems keep their model assumptions. Barriers, hypothetical worlds and meta-complexity explain both progress and what remains unresolved.
Where this comes back. Part 27 adds randomness and interaction to proofs, and reaches the PCP theorem. Part 29 builds cryptography on one-way functions, Impagliazzo's Minicrypt, and Part 30 builds public keys on factoring and discrete logarithms, the suspects of chapter twelve. Part 41 resolves package dependencies with a SAT solver. Part 53 asks whether quantum computers break the extended Church-Turing thesis. And Part 54 proves programs correct by sending verification conditions to a solver like ours.
In practice, first specify the exact decision or optimization problem and its encoding. General scheduling, packing and dependency models may be NP-hard, while structured instances can be easy. SAT, SMT, integer programming and constraint solvers are useful tools. Approximation guarantees depend on the objective: weak hardness alone does not promise an FPTAS. Verification often uses SAT internally. For computational cryptography, identify the precise hardness assumption; information-theoretic ciphers require a different analysis.
Six exercises, with worked guidance in the notes. Pause on any of them. The Sudoku build exercise retains the full formula, solver model and independently checked grid. The starred exercise estimates finite-size crossings and widths with uncertainty.
Next, proofs that use randomness. Zero-knowledge protocols can convince a verifier while revealing no additional knowledge under their precise definition and assumptions. Interaction gives the class IP, equal to PSPACE. The PCP theorem uses logarithmically many random bits and a constant number of proof queries: true statements have an accepting proof, while false statements are rejected with bounded probability for every purported proof. Part 27 develops those definitions and their consequences for approximation.
The books and papers this part follows are on screen and in the notes. Thank you for watching.
Where it goes next. Part 27 adds randomness and interaction to proofs and reaches the PCP theorem. Part 29 builds cryptography on one-way functions and Part 30 on factoring and discrete logarithms, the suspects between P and NP-complete. Part 41 resolves package dependencies with a SAT solver, Part 53 tests the extended Church-Turing thesis against quantum computers, and Part 54 sends verification conditions to a solver.
Key results
The part's results in one place, for revision.
Try it
Lab 26 · Reductions that preserve the answer, and the 3-SAT threshold
Decide small random 3-SAT formulas three ways (a truth table, an independent set of size m in the reduced graph, a 3-colouring of Karp's gadget graph found by the series' CDCL solver) and check that all three agree; then measure how the fraction of satisfiable formulas and the solver's conflicts change with m / n.
python -m videos.cs.labs 26
needs numpy, scipy, matplotlib · download lab26.py ·
source on GitHub30 random formulas on 5 variables 17 satisfiable, 13 not; three deciders agree on all 30
largest: 34 clauses independent-set graph 102 vertices, 625 edges; colouring graph 217 vertices, 426 edges
m / n = 3.0 (n = 40) satisfiable 20/20 median conflicts 2
m / n = 3.5 (n = 40) satisfiable 19/20 median conflicts 6
m / n = 4.0 (n = 40) satisfiable 17/20 median conflicts 24
m / n = 4.25 (n = 40) satisfiable 13/20 median conflicts 24
m / n = 4.5 (n = 40) satisfiable 8/20 median conflicts 34
m / n = 5.0 (n = 40) satisfiable 3/20 median conflicts 29
m / n = 5.5 (n = 40) satisfiable 1/20 median conflicts 24
m / n = 6.0 (n = 40) satisfiable 0/20 median conflicts 22
A reduction is checked by running it: the answer survives the trip to a graph and back. The drop near 4.27 at n = 40 is a finite-size picture of the threshold, not a proof of it.
The code (116 lines; it asserts its own result)
"""Lab 26: carry random 3-SAT formulas through two reductions, and watch satisfiability fall off near 4.27 clauses per variable."""
from videos.coursekit import labs
import random
import numpy as np
from explainer.cs.algo import complexity as X
TITLE = "Reductions that preserve the answer, and the 3-SAT threshold"
GOAL = ("Decide small random 3-SAT formulas three ways (a truth table, an independent set of size m in the reduced "
"graph, a 3-colouring of Karp's gadget graph found by the series' CDCL solver) and check that all three "
"agree; then measure how the fraction of satisfiable formulas and the solver's conflicts change with m / n.")
TASKS = [
"Set N to 60 and TRIALS to 30. Does the drop from mostly satisfiable to mostly unsatisfiable get steeper, and where is the conflict peak?",
"Add the subset-sum reduction: for each satisfiable formula check that X.subset_from_model picks numbers summing to the target of X.sat_to_subset_sum.",
"Replace X.cdcl by X.dpll in the threshold experiment and plot nodes instead of conflicts. At which ratio does plain DPLL suffer most?",
]
N, TRIALS = 40, 20
RATIOS = (3.0, 3.5, 4.0, 4.25, 4.5, 5.0, 5.5, 6.0)
def truth_table(n, clauses):
return any(all(any(((a >> (abs(l) - 1)) & 1) == (l > 0) for l in c) for c in clauses) for a in range(1 << n))
def independent_set_of_size_m(clauses):
"""Search the reduced graph itself: one vertex from each clause triangle, no edge inside the chosen set."""
verts, edges, _, m = X.sat_to_is(clauses)
adj = {v: set() for v in verts}
for u, v in edges:
adj[u].add(v)
adj[v].add(u)
tri = [[v for v in verts if v[0] == j] for j in range(m)]
blocked = dict.fromkeys(verts, 0) # how many chosen vertices are adjacent to each vertex
def go(left, chosen):
if not left:
return chosen
free = {j: [v for v in tri[j] if not blocked[v]] for j in left}
j = min(left, key=lambda k: len(free[k])) # the triangle with the fewest usable vertices
for v in free[j]:
for u in adj[v]:
blocked[u] += 1
found = go(left - {j}, chosen + [v])
for u in adj[v]:
blocked[u] -= 1
if found:
return found
return None
S = go(frozenset(range(m)), [])
assert S is None or (len(S) == m and X.is_independent(S, edges))
return S is not None, len(verts), len(edges)
def run(seed=0):
rng = random.Random(int(np.random.default_rng(seed).integers(2 ** 31)))
lab = labs.Lab()
# 1. three deciders, one answer
n, sat, sizes = 5, 0, []
for _ in range(30):
clauses = X.random_ksat(n, rng.randint(18, 34), 3, rng)
truth = truth_table(n, clauses)
model, stats = X.cdcl(n, clauses)
assert (stats["status"] == "sat") == truth and (model is None or X.check(model, clauses))
has_is, nv, ne = independent_set_of_size_m(clauses)
assert has_is == truth, "satisfiable iff an independent set of size m exists"
V, E = X.sat_to_3col(n, clauses)
nvar, cnf, var = X.coloring_cnf(V, E, 3)
cmodel, cstats = X.cdcl(nvar, cnf)
assert (cstats["status"] == "sat") == truth, "satisfiable iff the gadget graph is 3-colourable"
if cmodel is not None:
colour = X.decode_coloring(V, cmodel, var, 3)
assert all(colour[u] != colour[v] for u, v in E)
back = [False] + [colour[f"x{v}"] == colour["T"] for v in range(1, n + 1)]
assert X.check(back, clauses), "the colouring maps back to a satisfying assignment"
sat += truth
sizes.append((len(clauses), nv, ne, len(V), len(E)))
m, nv, ne, cv, ce = max(sizes)
lab.row("30 random formulas on 5 variables", f"{sat} satisfiable, {30 - sat} not; three deciders agree on all 30")
lab.row(f"largest: {m} clauses", f"independent-set graph {nv} vertices, {ne} edges; colouring graph {cv} vertices, {ce} edges")
assert 3 <= sat <= 27, "the sample holds both kinds of formula"
# 2. the threshold
frac, med = [], []
for r in RATIOS:
conflicts, ok = [], 0
for _ in range(TRIALS):
model, stats = X.cdcl(N, X.random_ksat(N, round(r * N), 3, rng))
assert stats["status"] != "unknown"
ok += stats["status"] == "sat"
conflicts.append(stats["conflicts"])
frac.append(ok / TRIALS)
med.append(float(np.median(conflicts)))
lab.row(f"m / n = {r:<4} (n = {N})", f"satisfiable {ok}/{TRIALS} median conflicts {med[-1]:.0f}")
assert frac[0] >= 0.9 and frac[-1] <= 0.15, "satisfiable well below the threshold, unsatisfiable well above"
assert max(med[2:6]) > 3 * max(med[0], 1), "the hard formulas sit near the threshold, not at low density"
lab.note = ("A reduction is checked by running it: the answer survives the trip to a graph and back. The drop "
"near 4.27 at n = 40 is a finite-size picture of the threshold, not a proof of it.")
fig, ax = labs.figure(2, size=(11, 4.2))
se = [np.sqrt(max(f * (1 - f), 1e-9) / TRIALS) for f in frac]
ax[0].errorbar(RATIOS, frac, yerr=se, fmt="o-", color=labs.BLUE, capsize=3, label=f"n = {N}, {TRIALS} formulas per point")
ax[0].axvline(4.267, color=labs.GOLD, ls="--", label="predicted threshold, about 4.27")
ax[0].set(title="Fraction of random 3-SAT formulas that are satisfiable", xlabel="clauses per variable, m / n",
ylabel="fraction satisfiable", ylim=(-0.05, 1.05))
ax[0].legend(loc="upper right")
ax[1].plot(RATIOS, med, "o-", color=labs.RED, label="median CDCL conflicts")
ax[1].axvline(4.267, color=labs.GOLD, ls="--")
ax[1].set(title="Work to decide them: easy, hard, easier", xlabel="clauses per variable, m / n", ylabel="conflicts")
ax[1].legend(loc="upper left")
lab.fig = fig
return lab
Now change it
- Set N to 60 and TRIALS to 30. Does the drop from mostly satisfiable to mostly unsatisfiable get steeper, and where is the conflict peak?
- Add the subset-sum reduction: for each satisfiable formula check that X.subset_from_model picks numbers summing to the target of X.sat_to_subset_sum.
- Replace X.cdcl by X.dpll in the threshold experiment and plot nodes instead of conflicts. At which ratio does plain DPLL suffer most?
Problems, with solutions
Try each problem before opening its solution.
-
P, NP and coNP. Prove that if P = NP then NP = coNP, and that an NP-complete problem in coNP implies NP = coNP.
Solution
P is closed under complement (flip the answer of a polynomial-time decider). If P = NP then coNP = co-P = P = NP. For the second claim, let L be NP-complete with L ∈ coNP, and take any A ∈ NP. Then A ≤ₚ L by some f, and the same f reduces the complement of A to the complement of L, which is in NP. So the complement of A is in NP, that is, A ∈ coNP; hence NP ⊆ coNP. Conversely, if B ∈ coNP then its complement is in NP ⊆ coNP, so B ∈ NP. The classes are equal.
-
2-SAT is easy. Prove 2-SAT is in P, then explain why a direct implication-graph encoding does not represent a general 3-clause.
Solution
Turn (a ∨ b) into ¬a → b and ¬b → a, including repeated literals for units. An empty clause is immediately UNSAT. If x and ¬x share an SCC, the formula is UNSAT; otherwise an SCC topological ordering gives a satisfying assignment, in linear time. For the obstruction, every 2-CNF relation is closed under coordinate-wise majority: if a two-literal clause were false at the majority of three satisfying assignments, each literal would be false in at least two assignments, so some assignment would falsify both. Existential projection preserves this closure. But 3-OR contains 100, 010 and 001 and excludes their majority 000. Thus no existential 2-CNF gadget represents 3-OR exactly. This is a specific expressibility argument, not a claim that every NP-completeness reduction must manufacture a particular AND gadget.
-
Hamiltonian path. Reduce 3-SAT to directed Hamiltonian path, specifying the variable/clause ports and why cross-row detours fail.
Solution
For n variables and m clauses, introduce connectors b₀,…,bₙ. Variable row i has vertices vᵢ,₀,…,vᵢ,₃ₘ₊₂ and both directed edges between every consecutive pair. Add bᵢ₋₁ → each row endpoint, and each row endpoint → bᵢ. For clause j = 1,…,m, create cⱼ and dedicate the pair Lᵢⱼ = vᵢ,₃ⱼ₋₁, Rᵢⱼ = vᵢ,₃ⱼ in every row. A positive occurrence adds Lᵢⱼ → cⱼ → Rᵢⱼ; a negative occurrence reverses those two ports. Keep the direct row edges. Non-port spacer vertices separate successive pairs and occur before/after the first/last pair. The graph has O(nm+n+m) vertices and edges. Source b₀ has indegree zero and sink bₙ has outdegree zero, forcing the endpoints of any spanning directed path.
Every spacer has only its two row neighbours, so an internal spanning path must use both of those incidences. Each port therefore already uses one row-side incidence and has only one remaining path incidence: either its paired port or cⱼ. If a path enters cⱼ from one pair and exits into another pair, the unused mate of the entering port cannot obtain its remaining incidence: its partner and cⱼ have already used theirs. Thus each clause detour returns to the same pair. Each row is traversed in one consistent direction; interpret left-to-right as true. All clause vertices must be visited through an occurrence compatible with that direction, giving a satisfying assignment. Conversely, a satisfying assignment fixes each row direction; choose one true occurrence per clause and replace that pair's direct edge with the two-edge detour. This visits every vertex exactly once. The zero-clause case reduces to rows without clause detours. The retained finite audit compares independent truth-table SAT with exhaustive Hamiltonian-path search on 128 complete graphs, including an UNSAT full eight-clause three-variable example; that audit supports the implementation of this recipe, while the paired-port argument proves its general correctness.
-
Search from decision. Show that if SAT can be decided in polynomial time, a satisfying assignment can be found in polynomial time.
Solution
First ask whether φ is satisfiable; if not, stop. Then for i = 1, …, n ask whether φ with x₁, …, xᵢ₋₁ fixed as chosen and xᵢ = 1 is satisfiable. If yes, fix xᵢ = 1; otherwise xᵢ = 0 must extend to a satisfying assignment, because the formula with the previous choices was satisfiable. That is n + 1 calls to the decider on formulas no larger than φ, so polynomial time. Chapter 4 ran it: five calls for four variables.
-
Build: Sudoku. Reduce Sudoku to SAT, solve a hard puzzle with this part's CDCL solver, and count its conflicts.
Solution
Variables x(r, c, v) for row, column and value, 729 in all. Each cell gets at least one value (81 clauses of 9 literals) and at most one (81 × 36 binary clauses). Each value appears at least once in every row, column and box (243 clauses) and at most once (243 × 36). That is 324 long clauses and 11,664 binary ones, plus a unit clause for each given digit. Number the variables 81(r − 1) + 9(c − 1) + v. Run
complexity.cdcl(729, clauses), decode the true variables back into a grid, and check every row, column and box.The retained 21-clue exercise puzzle is:
800000000 003600000 070090200 050007000 000045700 000100030 001000068 008500010 090000400Run
python -m videos.cs.cs26.compute sudoku. The current retained run has 111 teaching-solver conflicts; host time is in the schema-2 payload. All 12,009 clauses, the full SAT model and the decoded grid are retained, with independent row, column, box and given-clue checks. A puzzle's human difficulty is not a solver complexity guarantee. -
★ Research: finite-size crossings and widths. Estimate the 50% crossing and the 10%–90% window for n ≤ 300, including binomial uncertainty and solver cutoffs. Use independent formulas at each point. Report UNKNOWN separately; do not count timeouts as UNSAT. Compare the location of the median-conflict peak with the finite crossing. Increase sample size and ratio resolution before fitting, propagate crossing uncertainty, and test sensitivity to the chosen size range. A power-law fit over a few small n values does not prove an asymptotic exponent.
Starting evidence. Our 1,300 formulas use proper random 3-clauses: three distinct uniformly sampled variables, independent fair signs, and clauses sampled with replacement. There are 40 trials per ratio for n = 50 and 100 and 20 for n = 150. Schema-2 payloads retain Wilson 95% intervals and all conflict counts. Friedgut's sharpness theorem concerns a shrinking transition window; Ding–Sly–Sun 2015 identifies the limiting prediction for sufficiently large k. Consult the dated 2026 reports below for newer existence/computability and upper-bound claims. None is established by this finite exercise.
Notes and sources
Glossary
多项式时间 polynomial time · 时间层级定理 time hierarchy theorem · 空间层级 space hierarchy · Savitch 定理 Savitch's theorem · 验证器 verifier · 证书 certificate · 非确定性 nondeterminism · 多项式时间归约 polynomial-time reduction · NP 难 NP-hard · NP 完全 NP-complete · Cook–Levin 定理 Cook–Levin theorem · 表格 tableau · 合法窗口 legal window · 独立集 independent set · 团 clique · 顶点覆盖 vertex cover · 三着色 3-colouring · 子集和 subset sum · 自归约 self-reducibility · 伪多项式 pseudo-polynomial · 强 NP 难 strongly NP-hard · 完全多项式时间近似方案 FPTAS · coNP · Pratt 证书 Pratt certificate · 多项式层级 polynomial hierarchy · 量化布尔公式 TQBF · 广义地理游戏 generalized geography · 对数空间 logarithmic space · 树求值 tree evaluation · Ladner 定理 Ladner's theorem · 二分定理 dichotomy theorem · 冲突驱动子句学习 CDCL · 单元传播 unit propagation · 相变 phase transition · 相对化 relativization · 自然证明 natural proofs · 代数化 algebrization · 单向函数 one-way function · 最小电路规模问题 MCSP · 元复杂性 meta-complexity
Sources
Model and source distinctions
The extended Church–Turing thesis is a physical simulation claim, commonly probabilistic; polynomial equivalence of suitably costed deterministic models is a separate theorem. NP certificates and PH quantifiers are bounded in bit length. P=NP only accelerates polynomially bounded, efficiently verifiable searches; unrestricted program minimization stays undecidable, and information-theoretic ciphers are outside the computational-cryptography consequence. Impagliazzo's worlds are distributional/security scenarios, not five proved consistency claims.
Natural-proof barriers require constructivity in full truth-table length, largeness and usefulness against a specified circuit class, plus sufficiently strong quantitative pseudorandomness. They constrain a class of circuit arguments, not every possible P≠NP proof. Relative oracle independence does not establish independence of ordinary P versus NP from ZFC.
Primary statements additionally inspected for this repair:
- Demaine, Hohenberger and Liben-Nowell author page (2003): offline objectives include clearing a target number of rows; exact move rules matter. The abstract was read, not the complete reduction proof.
- Arora–Barak web draft, Theorem 3.1 and Definitions 22.4/22.10: hierarchy gap, padding, natural-property conditions and quantitative pseudorandomness.
- Razborov–Rudich original manuscript, introduction and section 2.1: circuit lower bounds are a stronger route and naturalness has explicit conditions.
- Bulatov 2017, Theorem 1: each fixed finite constraint language on a finite domain.
- Williams 2025, Theorem 1.1, Corollary 1.2 and Remark 1.6: deterministic multitape scope, constructibility and RAM limitation.
- Hirahara 2022: randomized-reduction hardness of partial MCSP.
- Liu–Pass 2020: exact Kᵗ, uniform average-case scope and OWFs.
- Li–Yang, 2021 report / STOC 2022: dated B₂ linear lower-bound example.
Sources
Canon. Books:
- Sipser, Introduction to the Theory of Computation (3rd ed., 2012), ch. 7–8;
- Arora & Barak, Computational Complexity: A Modern Approach (2009), ch. 1–6;
- Papadimitriou, Computational Complexity (1994);
- Garey & Johnson, Computers and Intractability (1979);
- Moore & Mertens, The Nature of Computation (2011), ch. 4–6;
- Goldreich, P, NP, and NP-Completeness (2010);
- Fortnow, The Golden Ticket (2013); Biere, Heule, van Maaren & Walsh (eds.), Handbook of Satisfiability (2nd ed., 2021).
Papers:
- Foundations: Gödel's letter to von Neumann (1956); Edmonds (1965); Cobham (1965); Hartmanis & Stearns (1965); Savitch (1970); Cook (1971); Karp (1972); Levin (1973); Meyer & Stockmeyer (1972); Stockmeyer & Meyer (1973); Ladner (1975); Pratt (1975).
- Hardness everywhere: Kaye (2000); Demaine, Hohenberger & Liben-Nowell (2003); Yato & Seta (2003); Berger & Leighton (1998); Mancinelli et al. (2006); Schaefer (1978); Lichtenstein & Sipser (1980); Robson (1983, 1984); Fraenkel & Lichtenstein (1981); Reisch (1981); Ibarra & Kim (1975); Garey & Johnson (1978).
- Space: Immerman (1988); Szelepcsényi (1987); Reingold (2005); Hopcroft, Paul & Valiant (1977); Cook, McKenzie, Wehr, Braverman & Santhanam (2012); Cook & Mertz (2024); Williams, "Simulating time with square-root space" (2025).
- NP and coNP: Babai (2015); Agrawal, Kayal & Saxena (2002); Karp & Lipton (1980); Bulatov (2017); Zhuk (2017).
- SAT: Davis, Logemann & Loveland (1962); Marques-Silva & Sakallah (1996); Moskewicz et al., "Chaff" (2001); Friedgut (1999); Kirkpatrick & Selman (1994); Ding, Sly & Sun (2015); Heule, Kullmann & Marek (2016); Heule (2017).
- Barriers and frontier: Baker, Gill & Solovay (1975); Razborov & Rudich (1994); Aaronson & Wigderson (2008); Williams (2011); Murray & Williams (2018); Shannon (1949); Khrapchenko (1971); Håstad (1986, 1998); Tal (2014); Li & Yang (2022); Mulmuley & Sohoni (2001); Bürgisser, Ikenmeyer & Panova (2016); Liu & Pass (2020); Hirahara (2022); Impagliazzo, "A personal view of average-case complexity" (1995); Hartmanis & Hopcroft (1976); Aaronson, "P =? NP" (2016); Gasarch, "The third P =? NP poll" (2019).
About this partfrom its README
Part 26 of a sixty-one-part course in computer science (see the series plan and the syllabus), the second part of Act V, Limits and Secrets. In 1956 Gödel asked von Neumann whether finding a proof could be as easy as checking one. This part makes the question precise, develops scoped proof sketches, builds a bounded Cook–Levin encoding and concrete reductions, and distinguishes finite experiments from asymptotic theorems. New numerical payloads retain full inputs, models, certificates and cutoffs.
The instrument is explainer/cs/algo/complexity.py. It holds:
- a CDCL SAT solver (two watched literals, 1-UIP learning, VSIDS, phase saving, Luby restarts) and plain DPLL;
- SAT to 3-SAT; 3-SAT to independent set, clique and vertex cover; Karp's 3-colouring gadgets with k-colouring as CNF; Sipser's subset-sum digits, with maps from satisfying assignments to solutions of each;
- the Cook–Levin tableau for a small nondeterministic Turing machine: legal 2 × 3 windows generated from the machine, Tseitin-encoded, and decoded back from a model;
- Savitch's CANYIELD, TQBF evaluation and generalized geography;
- Pratt certificates; Schur and Pythagorean-triple colourings as CNF.
It is tested in tests/test_cs26_complexity.py: 19 tests include 300 random solver comparisons against an independent truth-table evaluator, all eight projected inputs of the colouring gadget, duplicate/empty clauses, integer domains, budgets, zero-step reachability, quantified-variable scope, malformed Pratt trees and false RUP proofs. These are finite implementation checks.
Numerical items use schema 2. Each payload binds the complete numerical source signature and the bytes of its artifacts. All 1,393 actual CDCL queries are retained: 719 SAT, 673 UNSAT and one UNKNOWN. Resolved answers have native Glucose 4.2 cross-checks; every positive model is evaluated directly. One Schur refutation has an independently checked RUP trace. Other native UNSAT results are cross-checks, not claims that their proof traces were checked. A conflict-budget cutoff is never inferred to be UNSAT from a None model.
The teaching APIs reject literal zero, out-of-range variables, nonpositive restart/conflict budgets, invalid quantifiers and oversized clauses in the at-most-three-literal reductions. DPLL handles empty clauses. Duplicate literals are normalized consistently. An empty 3-colouring clause produces a K4 obstruction. Savitch uses equality at zero steps and integer half-budgets. Geography maps arbitrary hashable vertex labels to dense internal bits; its winner is the initial placer, with the second player moving next. Memoization may use exponential space. Pratt construction accepts primes below 2⁶⁴ and uses trial division of p−1; malformed/cyclic checker inputs fail without looping. The checker certifies the order criterion independently of the constructor's primality screen.
- Finding against checking. Hook.
- Gödel's letter of 20 March 1956.
- A planted 3-colourable graph of 60 vertices and 112 edges. Full edge lists and both planted/solved colourings are retained. The displayed enumeration scenario multiplies 3⁶⁰ by the measured average full valid-colouring check; it is neither a measured search nor a lower bound.
- 1. What counts as efficient.
- n², n³, 2ⁿ and n! at a microsecond a step.
- Edmonds and Cobham (1965); robustness of P; the extended Church–Turing thesis.
- 2. More time, more problems.
- The time hierarchy theorem: constructible f,g ≥ n and f log f = o(g) imply DTIME(f) ⊊ DTIME(g). Padded descriptions absorb fixed machine constants and finite exceptions. The screen is a proof sketch, not the false unqualified TIME(f) ⊊ TIME(f log f) claim.
- Savitch for s ≥ log n; runs on paths of 4, 8 and 16 nodes have depths 3, 4 and 5, with 20, 443 and 47,038 calls. The illustrative three-configuration-slot count excludes the stored input graph, iterators and Python overhead. Whole configuration graphs have 2^{O(s)} vertices under the stated read-only-input convention.
- 3. NP.
- Verifiers and certificates; the equivalence with nondeterministic machines.
- Examples; Babai's quasi-polynomial graph isomorphism; AKS.
- 4. Reductions and completeness.
- Polynomial reductions, NP-hardness and completeness.
- Search reduces to decision: five yes/no questions find a satisfying assignment.
- 5. Cook–Levin.
- The NTM on 0010 has T = 6 rows and at most five transitions. Acceptance is absorbing and required in the final row. Its 408 legal local windows are specific to this fixed machine. All decoded traces are checked against whole-machine transitions and separate reachable-configuration layers.
- The four-part formula and why it is polynomial.
- The formulas built and solved for inputs of length 2 to 8: 3,416 to 23,324 variables. Full formulas and models are retained; host durations are illustrative. The bounded 0000 instance is UNSAT, also confirmed by direct configuration exploration.
- 6. The web of reductions.
- One 5-clause formula through independent set (15 vertices, 29 edges), clique and vertex cover.
- Through 3-colouring: 41 vertices and 75 edges, as 123 variables and 389 clauses for the solver. The colouring maps back to a satisfying assignment, and an unsatisfiable formula's graph is not 3-colourable.
- Through subset sum: 18 nine-digit numbers and the target 111133333, hit by the mapped subset.
- Karp's 21 problems as a family tree.
- 7. NP-completeness everywhere.
- Specified generalized decision versions of offline Tetris, Minesweeper consistency, Sudoku completion and lattice hydrophobic-polar folding. Fixed boards and physical protein behaviour require separate models.
- At work: scheduling, packing, dependency resolution, register allocation.
- 8. Strong and weak hardness.
- Subset-sum bitsets on 30 numbers retain sums 0..W inclusive, with all weights, target, full final bitset and explicit witness. Independent meet-in-the-middle witnesses confirm each target. Integer bit costs remain relevant; decimal digit growth is a numeric-range illustration, not an exact timing law.
- Strong numerical hardness; the positive-profit 0–1 knapsack FPTAS. Weak hardness alone does not guarantee an FPTAS. A strong-hardness obstruction to FPTAS needs polynomially bounded integer objectives on the hard restricted instances. Asymptotic bin-packing schemes have a different guarantee.
- 9. coNP and the polynomial hierarchy.
- Tautology; NP ∩ coNP and factoring.
- The complete Pratt tree for 2⁶¹ − 1 has 60 certificate nodes; a separate arithmetic checker performs 89 modular powers. Full trees for both factors of the displayed N are also retained. The decision language asks for a divisor 2 ≤ d ≤ k < N. NP and coNP are duals at PH level 1; quantified strings have polynomial bit length.
- 10. Space.
- TQBF by recursion (1,029 nodes at 16 variables against 131,071 in the full tree); Stockmeyer–Meyer.
- Generalized geography on a 9-vertex graph (11 positions).
- Hex, Go, chess and checkers; L, NL, NL = coNL, Reingold.
- 11. Time in square-root space.
- Hopcroft–Paul–Valiant; Cook–Mertz tree evaluation; Williams 2025: deterministic multitape TIME(t) ⊆ SPACE(√(t log t)) for t ≥ n. The table evaluates asymptotic functions with constants omitted, not measured/guaranteed memory cells. For constructible s ≥ n and fixed ε > 0, SPACE(s) is not contained in TIME(s^{2−ε}). Tree evaluation in L, or outside NL, is not settled by Cook–Mertz.
- 12. Between P and NP-complete.
- Ladner's theorem (sketch); the suspects; the CSP dichotomy for each fixed finite constraint language on a finite domain (Bulatov; Zhuk).
- 13. SAT in practice.
- CDCL step by step; DPLL against CDCL at the threshold.
- Finite random 3-SAT samples for n = 50, 100 and 150 (40, 40 and 20 trials per point), with every formula and status retained and Wilson 95% binomial intervals. A coarse finite plot neither identifies the limiting constant nor establishes a scaling exponent. See the dated 2026 update below.
- Local Schur 13/3 and 44/4 positive colourings are fully checked; the Schur 14/3 native proof has 92 checked RUP additions. The 45/4 teaching run exhausts 30,000 conflicts and remains UNKNOWN. Complete local Pythagorean colourings are checked; the 7,825 triple encoding is independently matched to Euclid parametrization. Published S(5) = 160 and the 7,825 boundary are separate results, whose huge proofs are not rerun here.
- 14. Why it is hard.
- Relativization (Baker–Gill–Solovay); natural proofs (Razborov–Rudich); algebrization (Aaronson–Wigderson).
- Williams's ACC⁰ lower bound.
- 15. Five possible worlds.
- Impagliazzo's worlds; what P = NP would mean; Gasarch's poll.
- Could the question be independent of set theory?
- 16. Frontier: complexity about complexity.
- Exact De Morgan formula sizes of all 256 three-input functions: majority 5 leaves, parity 10, against Khrapchenko's 9. Shannon's counting argument.
- Dated lower-bound examples: B₂ fan-in-two gate circuits differ from literal-leaf formulas. Li–Yang 2022 is a 3.1n−o(n) example, not a verified current-record survey. Superpolynomial SAT circuits would prove NP ⊄ P/poly, a sufficient stronger route to P ≠ NP, not a necessary equivalence. Five n is linear, not superlinear; geometric occurrence-obstruction limits do not reject all of GCT.
- Meta-complexity: ordinary MCSP versus partial MCSP. Hirahara 2022 proves randomized polynomial-time reduction hardness. Liu–Pass 2020 uses mild average hardness of exact Kᵗ on uniformly random strings for suitable polynomial t ≥ (1+ε)n; it is not an equivalence with public-key encryption.
- Open problems. Outro.
NotesDated research update: inspected 11 November 2026
- Carenini, ECCC TR26-229 reports an O(n^{1/2+1/k}) clause-count window and existence of a limiting threshold for every fixed k ≥ 3. The abstract and Theorem 1.1/Corollary 1.2 were inspected through the primary PDF viewer; direct file retrieval returned 503 and is recorded.
- OpenAI, Computing the Random 3-SAT Threshold, release dated 27 September 2026 credits Carenini for existence and reports a single finite algorithm approximating α₃ to arbitrary precision. Theorem 1.1 supplies no efficiency bound and does not evaluate or identify α₃ with 4.267.
- Vorobyev, arXiv:2610.10599v1, 6 October 2026 reports UNSAT with high probability at density 4.268, with a rational certificate and Lean formalization. The inspected introduction still describes convergence as open; this versioned statement differs from the existence reports above.
These are dated preprint claims. The exact statements were read; their complete proofs/formalizations were not reproduced in this episode. The older “existence remains open” wording therefore cannot serve as an undated current-status summary. Our local plots establish neither these claims nor an exact limiting value. / 这些是注明版本的预印本报告;本部分查阅了精确命题,没有重做完整证明或形式化。旧版“存在性仍开放”不能不加日期地充当当前状态;本地图像也没有证明这些主张或精确极限值。
Companion material in this repository
The syllabus's plan for this partfrom SYLLABUS.md, the plan of record
- Edmonds (1965) and Cobham: polynomial time as "efficient", and why it is a robust choice.
- The time hierarchy theorem by diagonalization (proved); space classes; Savitch, NSPACE(s) ⊆ SPACE(s²), by midpoint recursion (proved).
- NP: certificates and nondeterminism are equivalent; SAT, clique, Hamiltonian cycle, subset sum; graph isomorphism in quasi-polynomial time (Babai 2015).
- Polynomial reductions; hardness and completeness.
- Cook–Levin (1971/73): SAT is NP-complete, via the tableau proof (cells and 2 × 3 windows, animated).
- The reduction web: SAT → 3SAT → independent set → clique and vertex cover; 3SAT → 3-coloring (gadgets drawn); 3SAT → subset sum (digits); Hamiltonian cycle; Karp's 21 as a family tree.
- NP-completeness everywhere (Garey & Johnson): Tetris, Minesweeper, generalized Sudoku, scheduling, folding.
- Strong against weak NP-hardness; pseudo-polynomial algorithms (knapsack, Part 19).
- coNP; NP ∩ coNP (factoring lives there); the polynomial hierarchy and its collapses.
- Space:
- TQBF is PSPACE-complete;
- games: generalized geography, Go (Lichtenstein & Sipser), n × n chess, which is EXPTIME-complete;
- NL = coNL (Immerman–Szelepcsényi); L against P.
- Time in square-root space (Williams 2025, building on Cook & Mertz's tree evaluation) (verify).
- Ladner's theorem: if P ≠ NP, intermediate problems exist (sketch).
- SAT in practice (callback to AI, Built 2): CDCL; industrial verification; the Boolean Pythagorean triples proof (200 TB, 2016) and Schur number five.
- Why it's hard: relativization (Baker, Gill & Solovay 1975; oracles both ways), natural proofs (Razborov & Rudich), algebrization (Aaronson & Wigderson).
- Impagliazzo's five worlds (Algorithmica, Heuristica, Pessiland, Minicrypt, Cryptomania): where cryptography lives (Parts 29–30).
- If P = NP: Gödel's letter, and the consequences. Outro.
Computed: our reductions, implemented and verified (a SAT instance → 3-coloring → solved → mapped back); a Cook–Levin tableau for a tiny NTM; our CDCL solver on reduced instances; the 3-SAT phase transition with our solver; generalized geography. Visuals: the tableau grid with sliding windows; gadget graphs assembling; the reduction family tree; the five worlds as a map; the class zoo as nested sets, zoomed. In practice: recognizing NP-hard problems at work (scheduling, packing, configuration, dependency resolution) and reaching for SAT or ILP solvers, or heuristics. Reading: Sipser ch. 7–8; Arora & Barak, Computational Complexity: A Modern Approach ch. 1–6; Papadimitriou, Computational Complexity; Garey & Johnson, Computers and Intractability; Moore & Mertens ch. 4–6; Goldreich, P, NP, and NP-Completeness; Cook 1971; Karp 1972; Levin 1973; Aaronson, "P =? NP" (2016); Impagliazzo 1995; Fortnow, The Golden Ticket.
中文讲义
本讲的中文部分(与英文版对应)。
习题与解答
-
P、NP 与 coNP。 证明若 P = NP 则 NP = coNP;并证明若某个 NP 完全问题属于 coNP,则 NP = coNP。
解答
P 对补运算封闭(把多项式时间判定器的答案翻转即可)。若 P = NP,则 coNP = co-P = P = NP。对第二个结论,设 L 是 NP 完全的且 L ∈ coNP,任取 A ∈ NP。则有某个 f 使 A ≤ₚ L,同一个 f 也把 A 的补归约到 L 的补,而后者属于 NP。所以 A 的补属于 NP,即 A ∈ coNP; 于是 NP ⊆ coNP。反过来,若 B ∈ coNP,则它的补属于 NP ⊆ coNP,所以 B ∈ NP。两个类相等。
-
2-SAT 很容易。 每个 (a ∨ b) 产生 ¬a → b 与 ¬b → a;单文字可重复成二文字,空子句直接不可满足。若变量与其否定位于同一强连通分量,公式不可满足,否则利用分量拓扑序得到赋值,耗时线性。精确表达能力的障碍如下:任何 2-CNF 关系对逐坐标多数运算封闭,因为若一个二文字子句在三个满足赋值的多数值上为假,两文字各至少在两个赋值上为假,必有一个赋值使二者全假。存在量词投影也保持这种封闭性。但 3-OR 包含 100、010、001,不包含它们的多数值 000,因此不存在精确表达 3-OR 的存在量化 2-CNF 小部件。这不是对所有 NP 完全性归约的统一 AND 部件断言。
-
哈密顿路径。 把 3-SAT 归约到有向哈密顿路径,并明确阻止跨行绕行的机制。
解答
n 个变量、m 个子句使用连接点 b₀,…,bₙ。第 i 行有 vᵢ,₀,…,vᵢ,₃ₘ₊₂,相邻点双向相连;bᵢ₋₁ 指向该行两端,两端都指向 bᵢ。子句 j 的专用端口为 Lᵢⱼ = vᵢ,₃ⱼ₋₁、Rᵢⱼ = vᵢ,₃ⱼ。正出现增加 Lᵢⱼ → cⱼ → Rᵢⱼ,负出现则反向;原行内直接边保留。相邻端口对之间、首尾端口对与行端点之间,都有非端口分隔点。规模为 O(nm+n+m),任何覆盖全图的有向路径都必须从入度零的 b₀ 到出度零的 bₙ。
分隔点只有两个行内邻点,因此路径必须使用两侧关联边。每个端口已经使用一侧行边,剩余一次关联只能给配对端口或 cⱼ。若从一对进入 cⱼ 却从另一对离开,进入端口的未用配偶就无法补齐剩余关联,因为它的配偶与 cⱼ 都已占满;所以绕行必回到同一对。每行因此方向一致,左到右代表真。每个子句点都通过方向相容的文字被访问,得到满足赋值。反过来,按满足赋值选择各行方向,每个子句挑一个真出现,用两条绕行边代替对应直接边,即得到访问全部顶点一次的路径。无子句时只剩变量行。证据包对128个完整图做了独立真值表 SAT 与穷尽哈密顿搜索对照,包括三变量全部八个三文字子句的不可满足例子;有限核验支持实现,一般正确性来自上述配对端口论证。
-
由判定得到搜索。 证明若 SAT 能在多项式时间内判定,则满足赋值也能在多项式时间内找到。
解答
先问 φ 是否可满足;若否,停止。然后对 i = 1, …, n,问:在已选定 x₁, …, xᵢ₋₁ 并令 xᵢ = 1 时 φ 是否可满足。若是,就定 xᵢ = 1; 否则 xᵢ = 0 必定能扩展成满足赋值,因为带着之前选择的公式是可满足的。总共 n + 1 次调用判定器,每次的公式都不比 φ 大,所以是多项式时间。 第 4 章运行过它:四个变量用了五次调用。
-
动手:数独。 把数独归约到 SAT,用本部分的 CDCL 求解器解一道难题,并统计冲突次数。
解答
变量 x(r, c, v) 表示行、列、数值,共 729 个。每格至少一个值(81 个 9 文字子句),至多一个(81 × 36 个二元子句);每个数值在每行、 每列、每宫至少出现一次(243 个子句),至多一次(243 × 36 个)。共 324 个长子句和 11,664 个二元子句,再为每个已给数字加一个单元子句。 把变量编号为 81(r − 1) + 9(c − 1) + v,运行
complexity.cdcl(729, clauses),把为真的变量解码回网格,再检查每行、每列、每宫。 上面的英文解答给出了完整21提示题盘。运行python -m videos.cs.cs26.compute sudoku;保留运行的教学求解器冲突数为111,本机耗时见带来源签名的载荷。完整12,009个子句、SAT模型及解码网格全部保存,并独立检查每行、每列、每宫及已给数字。人类解题难度不是求解器复杂度保证。 -
★ 研究:有限尺寸交叉点与宽度。 对 n ≤ 300 估计50%交叉点与10%–90%窗口,报告二项抽样不确定性与求解截断。每点独立生成公式,未知状态单列,超时不能算作不可满足。比较冲突中位数峰值与有限交叉点,增加样本量、加密比值网格,并传播交叉点误差。少数小规模上的幂律拟合不能证明渐近指数。
起点。 1,300个实例采用三个不同变量、独立公平正负号,子句有放回抽样。n 为50、100时每点40次,为150时每点20次;载荷保留 Wilson 95%区间及全部冲突计数。Friedgut 的尖锐性针对缩窄窗口;Ding–Sly–Sun 2015对足够大的 k 识别极限预测。较新的存在性、可计算性和上界报告见下方2026年日期更新;本有限习题不证明这些结果。
Build the film
python -m videos.cs.cs26.compute # the part's numbers, into .cache/cs26
python tools/build.py cs26 # render and assemble the film
EXPLAINER_TTS=silent python tools/qa_scene.py cs26 Hook # one chapter, silent, with a contact sheet
Scenes: videos/cs/cs26. Setup: see the course page. Source of these notes: the README and the scenes' narration.
Build it
python -m videos.cs.cs26.compute # validate source/artifact signatures; recompute stale items
python -m unittest tests.test_cs26_complexity
python tools/build.py cs26 -q l # a 480p preview
python tools/build.py cs26 # 1080p