AND-NOT circuit value problem 2026-10-07
The circuit value problem restricted to AND and NOT gates remains P-complete. Replace each OR by , using a constant-size gadget. Gate indices and gadget positions can be emitted in logarithmic space, and assignments are preserved. Constants, when needed, can be represented by fixed-valued input nodes.
L (complexity) Created 2026-09-24 Updated 2026-10-03
NL (complexity) Created 2026-09-24 Updated 2026-10-03
Past exam of the mathematics course of the University of Cambridge 2013 iii Paper 59 2 b Solution Created 2026-10-03 Updated 2026-10-07
Here a directed cycle has at least one edge. If zero-length paths were treated as cycles, an edgeless one-vertex graph would already satisfy the predicate; that convention would give the trivial nonempty-graph predicate instead of the intended directed cycle detection problem.
For NL membership, guess a starting vertex , follow a guessed directed walk for between one and edges, and accept if it returns to . Store only the start, current vertex and step counter. A graph with a nonempty closed walk contains a simple directed cycle of at most edges, including a self-loop if present. Thus the algorithm uses logarithmic space and is complete for the predicate.
For hardness, reduce the directed graph reachability problem to cycle detection. Form and add the single backward arcAll layering arcs advance exactly one layer, including the waiting arcs , so the layered graph alone is a Directed acyclic graph. Any cycle in the augmented graph must contain the backward arc and therefore contains a path from to .
If is reachable from in , use a simple path of length at most and pad it with waits to exactly steps. It becomes the required layered path and closes to a cycle. Conversely, projecting such a layered path and deleting waits gives a walk from to in . This includes the case , where reachability has a zero-length witness but the augmented graph has a genuinely positive-length cycle.
There are vertices and polynomially many arcs. A transducer enumerates pairs/layers and checks old adjacency by scanning its input, using only bits. Hence this is a logspace many-one reduction, proving
Past exam of the mathematics course of the University of Cambridge 2013 iii Paper 59 3 d Solution Created 2026-10-03 Updated 2026-10-07
The class NC1 consists of languages having polynomial-size, bounded-fan-in Boolean circuit families of depth . Under a uniform convention one requires the wiring to be constructible in logarithmic space; the construction below meets that requirement as well as the nonuniform one.
Write a length- binary input with most significant bit first as . Since ,Represent residues zero, one and two by two bits, respectively . Each input produces residue zero when it is zero; when it is one it produces residue one or two according to the parity of . This uses only constants and wires.
A two-residue addition modulo three is a fixed function of four Boolean variables and has a constant-size, constant-depth bounded-fan-in Boolean circuit. Define its unused encodings arbitrarily; valid inputs always produce a valid residue encoding. Use a balanced binary tree of these adders, padding with zero residues to a power of two. There are adders and layers. A final constant-size gate checks that the residue is .
This balanced finite-monoid reduction circuit is uniform: leaf signs follow index parity and internal connections follow the indices in the balanced tree, all calculable in logarithmic space. Leading zeros cause no difficulty; the empty input can be assigned the zero-integer constant convention. Consequently
Past exam of the mathematics course of the University of Cambridge 2024 iii Paper 124 2 i Solution Created 2026-09-24 Updated 2026-09-25
A decision problem is NL-complete when and every language has a deterministic logarithmic space many-one reduction to .
The directed graph reachability problem is the standard example. It lies in NL because a machine stores the current vertex and a counter, nondeterministically guesses at most successive edges, and accepts upon reaching ; this uses space. For hardness, given an NL machine and input , construct its configuration graph. Its configurations have logarithmic length, adjacency can be computed in logarithmic space, andAdding one target joined from every accepting configuration gives the required logarithmic-space reduction.