2-satisfiability 2026-10-18
2-satisfiability restricts SAT to CNF in which each Boolean clause has at most two Boolean literals. The example in Boolean satisfiability problem is therefore a 2-SAT instance. Unlike general SAT and 3-SAT, 2-SAT has a polynomial-time algorithm; its tractability concerns finding a satisfying assignment or deciding that none exists, not merely checking a candidate. 3-SAT allows up to three Boolean literals per Boolean clause and is NP-complete, even though it includes many individually easy instances such as this one.[ref]
The key logical equivalence iswhere are Boolean literals. It expresses a two-Boolean literal Boolean clause as two logical implications. Representing these logical implications as edges in a directed graph gives a route to the polynomial-time algorithm. In the example, says both and : enabling the feature requires its component, and an absent component excludes the feature.
3-SAT 2026-10-06
3-SAT is the Boolean satisfiability problem restricted to Boolean formulas in conjunctive normal form with at most three Boolean literals per Boolean clause. It is NP-complete. A nonempty short Boolean clause can be padded to three positions by repeating a Boolean literal, without changing satisfiability.
Boolean literal Created 2026-10-06 Updated 2026-10-18
A Boolean literal is a Boolean variable or its logical negation . The two Boolean literals have opposite truth values: a Boolean valuation gives when false and true are encoded as zero and one. Thus makes the positive Boolean literal false and the negative Boolean literal true. A Boolean clause combines Boolean literals, and a Boolean-pair colouring gadget represents a Boolean variable and its logical negation by two vertices with opposite Boolean colours.
Boolean satisfiability problem Created 2026-09-24 Updated 2026-10-18
The Boolean satisfiability problem asks whether a Boolean formula has an assignment making it true. A complete assignment is a Boolean valuation: it gives every Boolean variable a truth value, consistently at all occurrences. A satisfying assignment, also called a model of a Boolean formula, makes the entire Boolean formula true. A solver's answer
SAT asserts that at least one satisfying assignment exists; UNSAT asserts that the input is an unsatisfiable Boolean formula. These are statements about existence, rather than the truth value under one particular Boolean valuation.For conjunctive normal form, or CNF, writeEach Boolean literal is a Boolean variable or its logical negation. Each Boolean clause uses inclusive logical disjunction: one true Boolean literal suffices. The outer logical conjunction requires every Boolean clause to succeed under the same Boolean valuation. Choosing a different Boolean valuation for each Boolean clause would answer a different question.
Consider the original three-Boolean variable exampleAt the Boolean valuation , the Boolean literals in have values , those in have values , and those in have values . Every Boolean clause therefore has truth value one, so has truth value one: this is a satisfying assignment.
An original satisfying assignment evaluated through Boolean literals, three Boolean clauses, and their logical conjunction
. Details. The complete truth table has Boolean valuations. Exactly two are satisfying assignments: and . In particular, satisfies the first two Boolean clauses but falsifies the third, so satisfying most Boolean clauses does not suffice for SAT. That different objective belongs to maximum satisfiability.
All eight Boolean valuations of the original CNF example, with its two satisfying assignments highlighted
. Details. A short proof of completeness avoids listing all eight rows. If , the Boolean clause forces , after which forces ; is already true. If , forces , after which forces ; is already true. These two cases exhaust the truth values of and produce precisely the two satisfying assignments above.
Verifying a satisfying assignment and finding a satisfying assignment are different tasks. Given a candidate, evaluate the Boolean formula once; finding a candidate requires choosing compatible truth values across all its Boolean clauses. The Cook-Levin theorem says that general SAT is NP-complete, even though a proposed satisfying assignment is efficiently checkable. Its proof encodes a bounded nondeterministic computation as a Boolean formula whose satisfying assignments describe accepting computations. Stephen A. Cook's 1971 paper established this connection between computational complexity theory and propositional logic.[ref]
The Complexity of Theorem-Proving Procedures by Stephen A. Cook. The Complexity of Theorem-Proving Procedures by Stephen A. Cook, 1971, §1, Theorem 1 and proof, pp. 2–3 of the revision-3 transcription: CNF encodes accepting computations
A concrete use is checking finite configuration rules. Let mean that an optional feature is enabled, that a fallback is selected, and that the feature's required component is installed. Require a feature or fallback, require the component whenever the feature is enabled, and forbid using the fallback with that component. Logical implication rewrites the second rule as ; De Morgan's laws rewrite the third rule as . Their logical conjunction is exactly , so its two satisfying assignments give the two allowed configurations. The usefulness of SAT lies in expressing local rules uniformly while demanding one globally consistent Boolean valuation. The conclusion concerns exactly these encoded rules.
Boolean variable Created 2026-10-06 Updated 2026-10-18
A Boolean variable takes one of two truth values, false or true, encoded as zero or one. It is an input to a Boolean formula; a Boolean literal uses the Boolean variable either positively or with logical negation. A Boolean valuation assigns one truth value to each distinct Boolean variable, so three distinct Boolean variables give eight possible complete assignments regardless of how often each appears.
Clause of a Boolean formula Created 2026-10-06 Updated 2026-10-18
A Boolean clause is an expression formed from Boolean literals, true when at least one Boolean literal is true. The empty Boolean clause is false. Repeating a Boolean literal does not change the truth value. A CNF Boolean formula is a logical conjunction of these Boolean clauses.
For , the only failing pair is : its two Boolean literals then both have truth value zero. The one-Boolean literal Boolean clause requires . A Boolean clause containing both and is a tautology, since one of those Boolean literals is true under every Boolean valuation. These observations separate Boolean clause satisfaction from the simultaneous satisfaction required by SAT.
Conjunctive normal form Created 2026-10-06 Updated 2026-10-18
A Boolean formula is in conjunctive normal form when it is a logical conjunction of Boolean clauses. It is true precisely when every Boolean clause is true under the same Boolean valuation; an empty logical conjunction is true. For example, has two Boolean clauses with widths two and one. Width counts Boolean literal occurrences within a Boolean clause, whereas the Boolean clause count counts the conjuncts. 2-SAT bounds width by two, and 3-SAT bounds width by three. A Boolean formula with an empty Boolean clause is an unsatisfiable Boolean formula.
Disjunctive normal form 2026-10-14
A Boolean formula is in disjunctive normal form when it is a disjunction of conjunctions of Boolean literals. Width bounds the number of literals in each conjunction, not the number of conjunctions. A depth- decision tree gives such a formula of width at most by taking the disjunction of its accepting leaf conditions; rejecting leaves give the dual conjunctive normal form.
Integer programming formulation of satisfiability Created 2026-10-14 Updated 2026-10-18
Encode each truth value by . A positive Boolean literal has value and its negation has value . The sum of literal values in a clause is at least one exactly when that clause is true. Thus the displayed inequalities, with objective zero, express Boolean satisfiability as a binary integer programming feasibility problem. For maximum satisfiability, introduce with and maximize . False clauses force zero indicators; true clauses permit indicators one, and maximization selects all of them. Hence the optimal objective equals the maximum number of true clauses.
In the residual unsatisfied formula, choose a Boolean literal contained in the largest number of clauses and make it true. Its opposite occurs in at most clauses, since it too was an eligible literal. The step permanently satisfies clauses; only clauses containing the opposite can become empty, so it loses at most clauses. Delete satisfied clauses and false literals and repeat. No satisfied clause or newly empty clause is counted twice. Summing gives total lost nonempty clauses at most total satisfied clauses . All initially nonempty clauses are eventually in one of these classes, so . Initial empty clauses can never be satisfied and are excluded from . This proves the approximation algorithm guarantee even with tautological clauses or repeated literals.
Partial Boolean assignment 2026-10-18
A partial Boolean assignment gives truth values to some of a Boolean formula's Boolean variables. An extension is a complete Boolean valuation agreeing on the assigned Boolean variables. In CNF, a Boolean clause containing a true assigned Boolean literal is already satisfied; a Boolean clause whose every Boolean literal is assigned false rules out all extensions. A Boolean clause with no true assigned Boolean literal and at least one unassigned Boolean variable is unresolved. An unresolved Boolean clause need not have a compatible extension with the other Boolean clauses.
For in Boolean satisfiability problem, setting already falsifies , so both choices of can be discarded. Setting only leaves unresolved and forces if a satisfying assignment is to survive; then forces . Branching on an unassigned Boolean variable into its two truth values and discarding branches with a false Boolean clause is sound: every satisfying assignment follows one branch and cannot extend a false Boolean clause. If all branches are eliminated, the original Boolean formula is an unsatisfiable Boolean formula.
Past exam of the mathematics course of the University of Cambridge 2003 iii Paper 37 1 Solution Created 2026-10-03 Updated 2026-10-14
A decision problem is in NP if every yes-instance has a complexity certificate of length bounded by a polynomial in the input length, and a deterministic verifier can check that certificate in polynomial time. More precisely, for some polynomial and verifier ,where runs in polynomial time. Equivalently, a nondeterministic machine decides the problem in polynomial time. A problem is NP-complete if it belongs to NP and is NP-hard: every problem in NP has a polynomial-time many-one reduction to it. Such a reduction maps instances to instances with if and only if is a yes-instance of the target problem.
For 3-SAT, the complexity certificate is one truth value for each Boolean variable. Check every Boolean literal, negate its variable's truth value when appropriate, evaluate the disjunction in each Boolean clause, and check their conjunction. This takes time linear in the encoded Boolean formula, apart from equally polynomial bookkeeping for variable names. A satisfying assignment passes; an unsatisfiable Boolean formula has no passing assignment. Thus 3-SAT belongs to NP.
For the diagram's three-colour clause gadget, name the three colours by the graph triangle . Each input is adjacent to , so each has colour or . Suppose that none has colour . Then all three have colour . Because is adjacent to and to , neither has colour . The edge forces these two colours to be and in some order. The graph triangle now forces to have colour . Since is adjacent to and , it must have colour . The graph triangle forces to have colour . But is adjacent to , which also has colour , contradicting a proper graph colouring. Therefore at least one input has colour .
To give the polynomial-time many-one reduction, use one common palette graph triangle . For each Boolean variable , create two graph vertices and join them to each other and to . This Boolean-pair colouring gadget forces them to have opposite colours . For each Boolean clause, introduce five fresh auxiliary graph vertices and the edges of the three-colour clause gadget, identifying its inputs with that clause's three Boolean literal vertices and using the common . In the notation of the diagram, its ten additional edges are the two triangles and , the bridge , and the three input edges. With variables and clauses the constructed undirected graph has vertices and at most edges. Repeated literals do not affect the argument. Its construction takes polynomial time.
A proper graph colouring defines a consistent truth assignment by declaring true precisely when its vertex has colour . The only-if result just proved makes every clause true. Conversely, a satisfying assignment colours every literal vertex consistently, and the supplied if-direction extends each satisfied clause's colours to its fresh auxiliary vertices. These extensions do not conflict, since different clauses share only already-coloured palette and literal vertices. Thus the Boolean formula is satisfiable exactly when the constructed undirected graph is three-colourable. Since 3-SAT is NP-complete, composition of reductions proves NP-hardness of the three-colourability problem.
Finally, a list of three colour labels, one for each graph vertex, is a complexity certificate for the three-colourability problem. Checking all edges takes time. Hence this problem is in NP as well, and the three-colourability problem is NP-complete.
Past exam of the mathematics course of the University of Cambridge 2010 iii Paper 35 4 Solution Created 2026-10-03 Updated 2026-10-14
Let encode the truth value of . For a Boolean literal , write if and if . A clause is true precisely when the sum of its literal values is at least one. Thus the integer programming formulation of satisfiability is the feasibility problemwith objective zero. Every feasible binary vector gives a satisfying assignment of the Boolean satisfiability problem, and conversely. An empty clause gives and hence infeasibility.
For maximum satisfiability, introduce binary variables marking clauses selected as satisfied and solveA false clause forces , while a true clause permits . At an optimum every permitted is one, since increasing it improves the objective without affecting another constraint. Therefore the objective is exactly the maximum number of simultaneously true clauses. Repeated literals cause no difficulty, and a clause containing both signs of a variable is always true.
For the literal-frequency greedy approximation for MAX-SAT, keep only clauses not already satisfied and remove literals made false. Count occurrence in clauses, rather than multiplicity within a clause. At a step let be the number of current clauses containing the chosen literal , and the number containing its opposite . Since has maximum clause frequency among all remaining literals, .
Setting true permanently satisfies exactly the clauses containing it. Some other clauses may become empty and are then permanently lost. Every newly empty clause previously contained , so their number satisfiesA clause containing both signs is satisfied and cannot be one of the lost clauses. Repeat this accounting at every step. Satisfied clauses are removed, so no success is counted twice; each lost nonempty original clause becomes empty at exactly one step. If is the total number satisfied and the number of initially nonempty clauses lost, summing the inequalities gives . Every initially nonempty clause eventually falls into one of these two classes. Writing their number as , we getEven an optimal assignment can satisfy at most clauses. ConsequentlyThus Greedy is a -approximation in the convention stated in the question. The proof also covers initial empty clauses by excluding them from ; they are unsatisfiable for every algorithm.
Past exam of the mathematics course of the University of Cambridge 2012 iii Paper 82 2 Solution Created 2026-10-03 Updated 2026-10-14
The printed interval has a typo: its right endpoint must be , rather than . Keep as an unnormalized indicator function; only is normalized to have integral one. Thus useWith the Boolean literal printed interval, the convolution vanishes at , so a sequence consisting entirely of is already a counterexample to the proposed majorization. For the corrected interval and every , all with belong to the support of . Hence there. Everywhere , giving , including interval endpoints.
Put . For , direct integration and the convolution theorem give the exact Fourier coefficientsIn particular,This also supplies the required justification of the Fourier series. The convolution is continuous: it is the overlap length of two moving intervals, divided by . Its Fourier coefficients are absolutely summable, so the corresponding Fourier series converges uniformly to a continuous function . Termwise integration gives ; the permitted uniqueness assertion applied to yields .
Let . Split the absolutely convergent Fourier series at the arbitrary real cutoff :There are fewer than low-frequency terms and each coefficient has magnitude at most . For the tail, and . ThereforeThis proves the requested interval discrepancy estimate without an unjustified sharp truncation of the Fourier series.
For a nonzero integer , let be the nearest integer to . The integer is nonzero, and . The suggested factorization yieldsThis is stronger than the stated lower bound for the fractional part, since the distance to the nearest integer is at most that fractional part. For , the geometric series and giveThus the low-frequency contribution is . Choose and ; these choices satisfy for every . Both and are , and so is . Hence
Past exam of the mathematics course of the University of Cambridge 2012 iii Paper 82 6 Solution Created 2026-10-03 Updated 2026-10-14
Use a Boolean circuit of unbounded-fan-in AND and OR gates, with negations pushed to the input Boolean literals. Its circuit depth is the largest number of AND/OR gates on an input-to-output path, and its circuit size counts these gates. Constants and Boolean literals may be supplied as inputs. Equivalent standard size conventions only enlarge the absolute constants. One can merge adjacent gates of the same type; the depth-reduction argument below keeps the two possible normal forms available at each gate.
A random restriction with parameter independently leaves each variable live with probability and otherwise fixes it to zero or one with probability each. The Håstad switching lemma states that for a width- DNF or conjunctive normal form ,Width bounds Boolean literals in a term or clause, not the number of terms. A decision tree of depth at most has both a DNF and a conjunctive normal form of width at most and has real multilinear degree at most . Indeed every leaf condition is a product of at most factors or ; sum the accepting leaves. The switching lemma controls the canonical decision tree, hence implies this representation bound.
We detail the Boolean circuit simplification parameters. First use a -random restriction. For a bottom AND gate, let count its live Boolean literals on the event that no fixed Boolean literal kills it. For distinct Boolean literals,Thus the probability of retaining more than live Boolean literals without becoming constant is at most . The same calculation applies to bottom OR gates, with the opposite killing value. Repeated Boolean literals are removed and contradictory Boolean literals make a constant gate. A union bound makes all nonconstant bottom gates width at most , except with probability at most .
Now apply successive restrictions, each retaining probability of the remaining variables. At a two-layer gate, the current bottom forms are width- DNFs or conjunctive normal forms. The Håstad switching lemma bounds its probability of failing to reduce to decision-tree depth at most by . Convert the successful decision tree into the opposite normal form, whose terms or clauses have width at most , and merge its outer gate with the adjacent gate of the same type. This removes one layer. Repeat upwards until the output has a depth- decision tree.
The bookkeeping matters: although a decision tree may give clauses, each subsequent switching event is charged to the corresponding original Boolean circuit gate, not to each newly created clause. The lemma permits any number of terms. Each original gate is charged once, so the sum of the failure probabilities is at most , without an extra exponential size factor. Conditioning on successful preceding stages is harmless because each next restriction is fresh and the width bound holds for every preceding success. For a general Boolean circuit the conjunctive normal form or DNF representation at a shared gate can be chosen separately for each outgoing use; no extra gates need to be counted as switching targets.
The composed restriction has live-variable probabilityFixed values are still unbiased and coordinates independent. We have proved the useful intermediate estimateFor , the initial bottom-gate argument alone gives this conclusion. This is a depth-reduction estimate, not the desired Fourier-tail theorem used as a black box.
Next derive exactly how restrictions affect the Fourier-Walsh transform. Let be the random live set and the fixed assignment outside . With , the restricted coefficient at isOrthogonality of the fixed-coordinate characters eliminates cross terms after averaging over . Thereforeand then averaging over gives the expected Fourier weight after a random restriction identityThe original high-degree tail is not preserved: each original coefficient is weighted by a binomial distribution survival probability. On successful restrictions the left-hand tail vanishes; on failures it is at most one by Parseval's identity and . Hence its expectation is at most .
Put . If , choose and the preceding value of . For every , the binomial distribution mean satisfiesIts variance is at most . The Chebyshev inequality givesThus the exact expectation identity bounds at least half the original tail above , andWhen the same bound follows from the trivial total-weight bound . We obtain explicit absolute constants,This supplies the requested overview of the Linial-Mansour-Nisan theorem with the actual switching scale, gate-count bookkeeping and restriction-to-Fourier calculation. The argument uses the unbounded-fan-in AND/OR Boolean circuit basis; allowing arbitrary gates would make the theorem false, since one parity gate could have all its nonconstant Fourier weight at level . The original theorem is Linial, Mansour and Nisan's circuit Fourier bound.
Past exam of the mathematics course of the University of Cambridge 2013 iii Paper 38 4 a Solution Created 2026-10-03 Updated 2026-10-07
Use the specified construction as a polynomial-time many-one reduction from 3-SAT. There are vertices and edges: one edge per variable pair, three edges per clause triangle in a graph, and three occurrence edges per clause. Any vertex cover must take at least one vertex from every variable pair and at least two from every clause triangle. Therefore every cover has at least vertices.
Given a satisfying Boolean valuation, include the vertex corresponding to the true Boolean literal in each variable pair. In each clause choose a true occurrence and omit its clause vertex, including the other two. Every variable edge and triangle edge is covered. An occurrence edge with an included clause endpoint is covered automatically; the only omitted occurrence vertex is joined to the included true-literal vertex. This is a vertex cover with exactly vertices.
Conversely, a cover of that size must use exactly one vertex in each variable pair and exactly two in each triangle. Declare a variable true precisely when its positive-literal vertex is included. Each clause has one omitted vertex. Its occurrence edge forces the corresponding literal vertex into the cover, so that literal is true. Every clause is therefore satisfied. ThusThe construction and target size are polynomial in the input length. Since 3-SAT is NP-complete, the decision problem is NP-hard. The usual “at most ” version has the same equivalence here because is an unavoidable lower bound. More generally, a cover with fewer than vertices can be padded to exactly . Verifying a proposed cover is polynomial, so the usual vertex-cover decision problem is also in NP and hence NP-complete.
Past exam of the mathematics course of the University of Cambridge 2015 iii Paper 38 4 e Solution Created 2026-10-03 Updated 2026-10-06
The three-colourability problem belongs to NP: a colour assignment is a polynomial-length complexity certificate, and all edges can be checked in time.
For NP-hardness, reduce 3-SAT to the three-colourability problem. Start with a palette graph triangle with vertices . Its colours are necessarily distinct, and name them by these vertices. For each Boolean variable , add vertices , join them to each other, and join each to . The graph triangle is the forcing component of the Boolean-pair colouring gadget, so the two literal vertices receive opposite colours .
For each Boolean clause, attach a fresh copy of the three-colour clause gadget, identify its with the palette vertex , and identify its three input vertices with the Boolean clause's Boolean literal vertices. Copies share only palette or literal vertices. A Boolean clause with one or two Boolean literals is padded to three by repeating a literal; an empty Boolean clause can be mapped immediately to the uncolourable graph .
Any graph colouring with three colours gives a truth assignment by reading colour as true. The three-colour clause gadget forbids three false inputs, so every Boolean clause is satisfied. Conversely, any satisfying truth assignment colours the literal pairs, and the extension property proved above independently colours the fresh auxiliary vertices of each clause. Thus the entire graph is three-colourable exactly when the formula is satisfiable.
There are vertices for variables and nonempty padded clauses, and edges. The construction is a polynomial-time many-one reduction. Using the permitted NP-completeness of 3-SAT, we obtain
Truth-table upper bound for circuit size 2026-10-07
OR together one minterm for each accepted length- input. Each minterm is an AND of the appropriate Boolean literals. There are at most minterms, and their negated input wires can be shared, giving bounded-fan-in gates. This is a nonuniform existence statement, not an algorithm for determining an undecidable truth table.
Verifying a satisfying assignment Created 2026-10-18 Updated 2026-10-25
For a CNF input with Boolean variables, Boolean clauses, and Boolean literal occurrences, first check that the supplied Boolean valuation gives each input Boolean variable exactly one truth value. Evaluate each Boolean literal by lookup or logical negation, each Boolean clause by logical disjunction, and the Boolean formula by logical conjunction. Indexed Boolean variables and constant-cost lookups give an operation count; with a finite binary string encoding the check still takes polynomial time. Thus a satisfying assignment is a certificate in computational complexity for SAT, proving that SAT belongs to NP. Finding it by exhaustive checking can require candidate Boolean valuations; this enumeration cost is not a lower bound on every possible SAT algorithm.[ref]
CS 252, Lecture 8: Constraint Satisfaction Problems (Carnegie Mellon University). CS 252, Lecture 8: Constraint Satisfaction Problems, p. 3, §3 opening paragraph: assignments as certificates and membership in NP

