Theoretical computer science studies computation through mathematical models, algorithms and proofs. Computability theory asks which problems admit algorithms at all; computational complexity theory asks what resources solving them requires. Automata theory, mathematical logic and formal languages describe machines and representations. For example, a finite-state automaton recognizes a language using finitely many states, while a Turing machine provides a more general model with unbounded working storage. Separating a problem's specification from a particular implementation makes it possible to prove both algorithmic upper bounds and impossibility results.
Automata theory studies abstract machines, the formal languages they recognize and transformations between machine descriptions. The machine's permitted memory and transition rules determine its power. A finite-state automaton stores only one of finitely many states; a pushdown automaton additionally has a stack, while a Turing machine has unbounded working storage.
For example, a two-state finite-state automaton recognizes binary strings containing an even number of ones: reading1 switches state, reading0 preserves it, and the initial state is accepting. In contrast, recognizing all strings requires remembering an unbounded count, which a finite-state automaton cannot do. A pushdown automaton can push once per and pop once per . These comparisons separate language recognition from implementation details and motivate closure properties, minimization and decidability questions.
A model of computation specifies how inputs are represented, which states and operations are available, how execution proceeds and what counts as its output and resource cost. Examples include Turing machines, random-access machines, Boolean circuits and the lambda calculus. A mathematical algorithmic claim is interpreted within such a model, even when the model is left implicit.
For example, adding two integers is one instruction in a unit-cost machine model. In a bit-cost model, operating on arbitrarily long integers requires time depending on their encoded lengths. A bound counting arithmetic operations therefore need not be a bound on bit complexity. Likewise, a circuit family can supply separate hardware for each input length, while a uniformity requirement asks one algorithm to generate those circuits. Stating the model makes efficiency comparisons meaningful and separates questions of computability from the cost of a chosen representation.
A formal language over a fixed finite alphabet is a set of finite words. Here contains every finite word over , including the empty word . A formal language may contain finitely or infinitely many such words.[ref]
For example, over contains , ab and aaabbb, but not abab. The notation specifies a set of permitted words; it does not itself give a running time for deciding membership. The empty language contains no words, whereas contains one.
Concatenation of formal languages combines permitted words from two formal languages. Automata theory and computability theory ask which machine models can recognize such sets, while computational complexity theory asks what resources membership decisions require.
A parallel string-rewriting system: at each generation, every symbol is replaced simultaneously by its assigned word. Symbols can also encode drawing commands such as moving forward or turning. Large recursively defined drawings can be queried without expanding the whole word by precomputing the length, displacement, and rotation of each expanded block.
A binary string is a finite word over the alphabet . There are strings of length . Finite binary strings have an effective bijection with natural numbers, so computable enumerability and immunity apply to sets of strings.
A binary string with zeroes and ones is determined by its one-positions, giving possibilities. Sum for and apply the hockey-stick identity. Equivalently, distribute at most ones among the gaps around the zeroes and add a slack count; stars and bars counts nonnegative counts summing to .
A self-delimiting code permits a decoder to identify the end of a code without an external length marker. Encoding a binary word of length by ones, a zero and the word uses bits. This yields an description of a natural number in an incompressibility proof.
For formal languages over the same alphabet, concatenate each word over an alphabet in with each word over an alphabet in . This operation is associative, has identity and absorbing element the empty language.
The formal language containing no words over an alphabet. It differs from the language containing only the empty word, which is a multiplicative identity for concatenation of formal languages.
A Turing machine is a model of computation with finite control, a tape of cells and a head scanning one cell at a time. An instruction of a Turing machine uses the current state and scanned symbol to determine a new state, a written symbol and a head movement. The finite transition rules form the machine's description; the tape supplies storage without a fixed global bound.
In a standard input convention, a finite word occupies part of an otherwise blank tape. A Turing machine configuration records the state, head position and tape contents, so the next-configuration relation determines each computation step. A machine can accept, reject or continue indefinitely. Recognizing a formal language permits nontermination on some nonmembers; deciding it requires an answer on every input.
The separation between a finite rule table and unbounded reusable storage makes the model useful for proving general statements about algorithms. Alan Turing's 1936 paper introduced this style of machine to analyze effective calculation; its original examples produce successive digits of numbers.[ref] Multitape Turing machines change the storage organization and possible step counts while retaining the same computability power.
An oracle Turing machine is a Turing machine with an additional query operation for a fixed formal language . It writes a finite query on a designated tape and receives the membership answer in one oracle step. Writing the query still takes ordinary machine work. The oracle's internal solution procedure is excluded from the cost model.
For example, a machine with an oracle for Boolean satisfiability can ask whether a given Boolean formula has a satisfying assignment. By fixing variables one at a time and querying satisfiability again, it can recover an assignment with at most one additional query per variable. The example turns decision access into search access; it does not provide an ordinary fast satisfiability solver. Oracles let computability theory and computational complexity theory compare problems while making the granted information explicit.[ref]
A designated tape alphabet symbol occupying unused cells of a Turing machine. It is excluded from the input alphabet, so a finite input word occupies a finite region of an otherwise blank tape.
A finite string describing a Turing machine's states, alphabets, transition rules and designated initial and halting states. Standard encodings have a decidable language of valid descriptions. A syntactic property of an encoding need not be an extensional property of programs; for example, adding an unreachable state changes state count without changing the accepted formal language.
A Turing machine with a fixed finite number of tapes and a head for each tape. One transition reads the scanned symbols, updates them and moves the heads. This model accepts the same computably enumerable languages as a single-tape Turing machine, but step counts can differ.
A Turing machine with one read-write tape. Every multitape Turing machine can be simulated by a single-tape Turing machine, using delimited tape portions and marked head positions. The simulation preserves the accepted formal language and whether a computation halts, while possibly increasing time complexity.
A deterministic single-tape Turing machine that leaves every scanned symbol unchanged and moves one cell right after every nonhalting transition. Such machines decide exactly the regular languages. A deterministic finite automaton simulates the finite control, with accepting states determined by the blank-only continuation after the input; conversely, a machine simulating a deterministic finite automaton halts on the first blank.
An instantaneous description records the current control state, head position, and tape contents. For a tape blank outside a finite window, a word records the symbols to the left of the head and from the scanned cell rightward, with unrecorded cells blank. If is empty, the head scans an implicit blank. Extra outer blanks can represent the same infinite tape. The instruction of a Turing machine determines its successor description.
For a Turing machine, the one-step binary relation between Turing machine configurations specified by its Turing machine instructions. Its reflexive transitive closure describes any finite number of computation steps, including zero.
For a deterministic single-tape Turing machine, an instruction reads a state and scanned tape symbol , writes , changes state to , and moves the head one cell left, one cell right, or not at all according to . The state and tape alphabets are finite; an undefined transition halts. A dedicated terminal state can be introduced by directing undefined transitions to it without changing whether computation halts.
Encode the cells immediately left of the head in a reversed positional stack , and the current and right cells in . Quotient and remainder by the alphabet base read and remove cells; multiplication by that base pushes a cell. The resulting local tape transitions are primitive recursive, which makes them directly implementable on Church numerals.
A modular machine of modulus acts on pairs in . Each instruction or has and , and at most one instruction is assigned to each residue pair . The two transition types are and . These finite arithmetic operations can encode a Turing machine; a designated terminal configuration can have a nonrecursive halting set.
A modular machine can be encoded by HNN extensions of . The kernel of has a free basis of a group . Associated-subgroup maps send these basis elements according to the two arithmetic transition types. In the resulting group, membership of in the subgroup generated by and the instruction stable letters is equivalent to . One more HNN extension centralizes that finitely generated subgroup, converting membership to equality and hence to the word problem for a group.
For a modular machine whose is terminal, is the set of configurations whose forward computation reaches exactly , including the zero-step computation there. It may differ from the set of configurations stopping at any terminal configuration. Determinism makes membership invariant along each instruction edge.
In a deterministic computation, every configuration and input symbol determine at most one next configuration.
A reversible computation has an injective transition function, so its preceding configuration can be recovered from its current configuration. Any finite classical computation can be simulated reversibly while retaining enough workspace to uncompute its temporary results.
A reversible circuit is composed of bijective gates. The Toffoli gate is universal for reversible Boolean computation when ancillary bits are available.
A nondeterministic computation may have several possible next configurations and accepts when at least one computation path accepts.
An oracle machine may query membership in a fixed language in one computation step.
A function oracle supplies access to an unknown function : given an allowed input , one query returns . Query complexity counts these accesses separately from known local computation. A classical query receives one definite answer; a quantum oracle specifies coherent access through a unitary operator, allowing inputs in quantum superposition. The distinction is part of the access model, not a change to the mathematical function.
A Boolean quantum oracle preserves and adds a one-bit value into an answer qubit by exclusive or. On known computational-basis states, its output determines the same value as a classical function oracle query.
A relativized complexity class allows every machine defining to query the same oracle .
A Boolean operation is a Boolean function taking truth values encoded as bits: means false and means true. These operations supply the concrete two-valued interpretation of a Boolean algebra. A Boolean valuation fixes the inputs; a truth table lists every possible input. With two input bits there are four rows.
The basic logical connectives are logical conjunction (AND, , both true), logical disjunction (OR, , at least one true), exclusive or (XOR, , exactly one true), and logical negation (NOT, , the opposite value). OR is inclusive: it accepts the case where both inputs are true.[ref]
For an original program-condition example, let mean “the backup is recent” and mean “the backup is verified”. A rule requiring a recent, verified backup uses logical conjunction; one accepting either qualification uses logical disjunction. A rule flagging a mismatch between the two qualifications uses exclusive or. A recent, verified backup gives : AND and OR accept it, while XOR does not flag it. The last row of the truth table makes this difference explicit.
The same small Boolean operations build larger tests and Boolean circuits. In a programming language, the value of a condition and the procedure for evaluating it both matter. For Boolean operands, Python's and, or, and not implement these logical connectives. Evaluation proceeds from the left; and skips its right operand if the left is false, and or skips it if the left is true. More generally, and and or return an operand, whereas not returns a Boolean.[ref]
For example, the Python condition denominator != 0 and numerator / denominator > 2 avoids division by zero because the logical conjunction's second test is evaluated only when the first succeeds. Reversing the tests preserves the abstract truth table for defined operands but can raise a division-by-zero error handled through exception handling. A rewrite involving a side effect must also preserve the needed evaluation behavior.
Events turn Boolean operations into operations on sets. For a die with sample space , let be the event “even outcome” and the event “outcome at least four”. At outcome , use the indicator functions and . Then
Thus logical conjunction becomes set intersection, logical disjunction becomes set union, exclusive or becomes symmetric difference, and logical negation becomes the complement of a set within . Outcome four satisfies both events, so inclusive logical disjunction includes it and exclusive or excludes it. If the die is fair, these four events have probabilities , , , and , respectively. No assumption of independent events is needed for the set identities; indeed and here are not independent, since .
Exclusive or returns one exactly when its two input bits differ. Its truth table gives , , , and . The identities
express exclusive or using logical conjunction, logical disjunction, and logical negation. The first expression accepts at least one input and then excludes both; the second explicitly lists the two accepted input pairs.
For numerical bits, exclusive or is addition in modular arithmetic modulo two:
The binary operation is commutative and associative, because addition modulo two has those properties. It satisfies , , and . These identities explain why a bit can be toggled and restored with the same operation.
On binary strings of equal length, bitwise exclusive or applies the one-bit rule separately at each position. For example,
A bit mask of toggles exactly the middle two bits. Applying the mask twice restores the original binary string: each selected bit changes twice, and each unselected bit stays fixed. This positional operation is distinct from taking the exclusive or of the overall truth values of two integers.
For bits , repeated exclusive or computes the parity of the number of ones:
An induction proves this: the first bit gives its own parity, and appending a zero preserves it while appending a one changes it. The binary string has three ones, so its parity bit is one. Append that parity bit to obtain , whose six bits have even parity. Flipping the second bit produces and changes the combined exclusive or to one, detecting an error. Flipping the third bit as well produces , with four ones and combined exclusive or zero: an even number of flips can escape this check.
For three inputs, repeated exclusive or means an odd number of true inputs, rather than exactly one: . The “exactly one” description applies to the two-input exclusive or. This distinction matters when translating a requirement that exactly one option be selected into a program condition.
Logical negation exchanges zero and one: and . For a numerical bit , this is ; applying logical negation twice restores . It acts on the entire propositional formula in its scope. Parentheses therefore matter: says that neither condition holds, while also accepts every case where holds. At their values are zero and one.
On a set, logical negation becomes taking a complement in a fixed universal set. In Boolean operations on events, “not even” selects . “Not both even and at least four” selects ; it does not require both qualifications to fail. De Morgan's laws make the scope of these compound negations precise.
A one-input logic gate that complements a bit.
De Morgan's laws exchange logical conjunction and logical disjunction when a logical negation moves across them:
Here denotes logical equivalence: the two propositional formulas agree under every Boolean valuation.[ref]
A complete verification uses the four rows of a truth table. In input order , both sides of the first logical equivalence have output sequence ; both sides of the second have . A proof in words is equally short: failure of “both” means at least one failure, whereas failure of “at least one” means both fail. The differing middle rows explain why simply pushing logical negation inward without changing AND to OR is wrong.
For the events in Boolean operations on events, the corresponding set identities are
One can prove these identities by checking an arbitrary set element : its two membership truth values obey De Morgan's laws. The same reasoning works for any two subsets of a common universal set.
Figure 1.
De Morgan's laws shade the same set whether a compound event is complemented first or its component events are complemented first
. Details.
For a nested program test, let mean “backup recent”, mean “backup verified”, and mean “manual override authorized”. Rejecting when neither an acceptable backup nor an override is present gives
The transformed condition reads “backup stale or unverified, and no override”. Apply the second of De Morgan's laws at the outside, then the first at the inner logical conjunction. For it rejects; changing only to one makes it accept. With Boolean operands in Python, not ((recent and verified) or override) and ((not recent) or (not verified)) and (not override) have the same result and inspect the operands in the same order, with the same skipped operands.
For a Boolean function of input bits, define its De Morgan dual by complementing every input, applying , and complementing the output:
De Morgan's laws say that the De Morgan dual of logical conjunction is logical disjunction, and conversely. The constant zero Boolean function becomes constant one. This is different from merely negating the output: for AND, output logical negation gives one at , whereas the De Morgan dual gives zero there.
Taking the De Morgan dual twice restores the original Boolean function:
Here each input is complemented twice as well. For a Boolean formula built from AND, OR, NOT and constants, its De Morgan dual can therefore be obtained by exchanging AND with OR and zero with one throughout, leaving input names and NOT in place. A structural induction proves the rule: it holds for an input and each constant, De Morgan's laws handle the two binary logical connectives, and double logical negation handles NOT. This symmetry lets one translate a complex test systematically instead of guessing where its failures occur.
Computational complexity theory studies the resources required to solve families of computational problems. A statement specifies an input encoding and a model of computation, then measures resources such as running time, computer memory or query complexity as the encoded input length grows. An algorithm's upper bound describes one method; a problem lower bound constrains every permitted algorithm in the stated model.
For decision problems, a complexity class collects problems with a shared resource guarantee. P uses deterministic polynomial time; NP permits polynomially bounded witnesses checked in polynomial time. The distinction separates finding an answer from verifying a supplied certificate.[ref]
The cost model is part of the mathematics. Bit complexity charges for arithmetic on operands of growing size, while a comparison model counts comparisons of keys. A polynomial-time algorithm also need not be practical at every scale: its exponent and constants still affect actual running time. These distinctions make complexity bounds useful for comparing both mathematical possibilities and concrete implementations.
An interactive proof system is a protocol in which a prover in an interactive proof exchanges messages with a verifier in an interactive proof to establish a public statement. The verifier is a randomized algorithm running in polynomial time; the prover need not have that resource bound. Completeness of an interactive proof and soundness of an interactive proof specify acceptance behavior on true and false statements.[ref]
For a decision problem represented by a set , write the acceptance bounds as
The first condition supplies an honest proving strategy; the second constrains every cheating strategy, including adaptive answers. The bounds need a useful separation between and .
Graph non-isomorphism gives a concrete protocol. Given two graphs on the same number of vertices, the verifier secretly chooses a uniform bit , randomly relabels using a permutation, and sends the result . The prover guesses which input graph was chosen; the verifier accepts exactly when the guess equals .[ref]
If the graphs are non-isomorphic, an unrestricted prover can identify the correct isomorphism class and always answer correctly. If they are isomorphic, the two ways of generating have identical probability distributions, so gives no information about and any guess succeeds with probability . The verifier's secret random choice creates the test. This soundness argument alone makes no claim that the protocol is a zero-knowledge proof.
A verifier in an interactive proof is the efficient participant that evaluates a public statement using messages from a prover in an interactive proof and its own random choices. Its algorithm specifies which challenge to send, how to process the response and when to accept or reject. In the standard model it runs in probabilistic polynomial time in the public input length.[ref]
The verifier's guarantee concerns more than one successful conversation. Completeness of an interactive proof requires a suitable honest prover to succeed on true statements. Soundness of an interactive proof bounds success of every cheating strategy on false statements. A verifier that accepts whenever it receives any message meets neither requirement merely by being fast.
For an original checking example, suppose a response claims a graph isomorphism between two20-vertex graphs encoded by adjacency matrices. Checking that the vertex mapping is a bijection and that all adjacency entries agree with their mapped entries verifies that response. It does not require searching through all vertex permutations.
An interactive proof system can use such inexpensive checks in a randomized conversation. The verifier's random choices must follow the specified protocol: exposing a challenge too early, reusing randomness in an unjustified way or changing the acceptance rule can alter its mathematical guarantees.
A prover in an interactive proof is the participant that sends messages intended to convince a verifier in an interactive proof of a public statement. Formally it is a strategy: its next response can depend on the public input, the preceding conversation and any private information or randomness it has. The basic interactive proof system model does not impose the verifier's polynomial time bound on this strategy.[ref]
An honest prover follows a designated strategy supporting completeness of an interactive proof. A cheating prover may depart from it; soundness of an interactive proof must still hold for every allowed cheating strategy. Calling a participant a prover therefore does not mean that its assertions are trusted.
A cryptographic witness can make an otherwise difficult response easy to produce. For an original composition example, let be a known graph isomorphism. If the prover sends for a chosen permutation , it can supply as an isomorphism from to , or as an isomorphism from to . Neither response requires solving a new isomorphism search problem from scratch.
Thus a theoretical allowance of unlimited prover computation is different from a claim about implementation cost. Some protocols have efficient honest provers when the witness is supplied; others are studied primarily for the verification power they demonstrate.
Soundness of an interactive proof bounds how often a verifier in an interactive proof can be induced to accept a false statement. For every false input and every cheating prover in an interactive proof strategy , an acceptance bound requires
In the usual interactive proof system definition, the quantifier includes computationally unrestricted cheating strategies. Bounding only one tested strategy is insufficient.[ref]
An original repetition example shows why conditional bounds matter. Suppose a single fair bit is reused in two tests, and both accept exactly when . Each test separately accepts with probability , but both accept with probability , not . Merely multiplying marginal probabilities would be wrong.
Instead, if every next test has acceptance probability at most conditional on every preceding accepting history, the chain rule for probabilities gives
with the first term unconditional and zero-probability histories handled trivially. For and , the bound is . The relevant protocol must justify those conditional bounds, rather than assuming that repetition automatically makes every transcript independent.
Soundness protects the false-statement side of verification. It neither guarantees acceptance of true statements nor establishes that a successful interaction hides a cryptographic witness; those are separate completeness and zero-knowledge proof questions.
Completeness of an interactive proof guarantees that true statements can convince the verifier in an interactive proof when the designated prover in an interactive proof follows the protocol. For an interactive proof system for a set , a bound requires
Perfect completeness means acceptance probability one on every true input. This is different from soundness of an interactive proof, which concerns every cheating strategy on false inputs.[ref]
An original three-run example shows that a repetition rule changes the guarantee. Suppose three independent runs on a true statement each accept with probability . Requiring all three to accept gives
Accepting when a majority does gives
The coefficient counts which one of the three runs rejects in an exactly-two-acceptance outcome. These stipulated independent trials illustrate the aggregation rule; the soundness of the majority rule must be assessed separately.
Thus lowering the chance of false acceptance is not the only design objective. A verifier that always rejects has excellent false-statement behavior but no useful completeness. A successful proof system needs both sides of its acceptance guarantee.
Proof complexity measures resources needed to express proofs in a specified propositional proof system. Typical quantities include the total number of symbols, the number of inference steps and the space needed to retain intermediate formulas. A short theorem statement can require a much longer proof, and changing the allowed rules can change the required length dramatically.
For example, a resolution refutation of an unsatisfiable clause set derives the empty clause by resolving pairs of clauses on opposite literals. Verifying a supplied derivation is a local computation on its lines; searching for those lines can be much harder. A lower bound must therefore identify the proof rules and the family of clause sets to which it applies.
More generally, a propositional proof system can be represented by a polynomial-time computable map whose range is exactly the propositional tautologies. Every tautology then has a proof, and every produced formula is valid. If one such system had polynomial-length proofs for every tautology, tautologies would have polynomially checkable certificates, implying . Conversely that equality would provide such a certificate-based system. This connects proof length to computational verification.
A propositional proof system specifies efficiently checkable certificates for logical tautologies. In the functional formulation, it is a polynomial-time computable surjection from finite binary strings onto the encoded tautologies: the input is a proof and the output is the formula proved. Soundness means no false formula is output; completeness means every logical tautology has some proof.
For example, a truth table can certify by checking its two assignments. The same method for variables may require rows, so efficient verification in the proof's length does not imply short proofs in the formula's length. Proof complexity asks which formulas require long certificates in particular systems. Searching for a proof and checking a supplied proof are different computational tasks.[ref]
Pseudorandomness means that specified tests cannot effectively distinguish a generated distribution from a genuinely random reference distribution. The allowed tests and their advantage are part of the definition. Passing a few frequency tests does not imply security against every feasible computation.
A pseudorandom generator expands a uniformly chosen -bit seed to bits. For a test , its distinguishing advantage is
Here denotes a uniformly sampled -bit string. There are at most generated strings, so an unrestricted test for membership in the generator's range distinguishes with advantage at least . The useful claim is therefore computational indistinguishability for a restricted test class, not equality of the two distributions. Such a generator can replace random choices in an algorithm when the relevant computation is among the tests it fools.[ref]
Two indexed families of probability distributions and are computationally indistinguishable when every allowed efficient test has only negligible distinguishing advantage:
Here negligible means eventually smaller than for every fixed positive . The probabilities include the sampled input and the test's randomness; the model must specify whether tests are uniform algorithms or nonuniform Boolean circuits.
The claim limits an observer's power. Two distributions can be far apart for an unrestricted observer yet indistinguishable to polynomial-time observers. This is the security goal for a pseudorandom generator: its output should look uniform even though a short seed reaches only a small fraction of all possible outputs.[ref]
A pseudorandom generator is a deterministic, efficiently computable function with , whose output on a uniform seed is computationally indistinguishable from a uniform -bit string. Its security is relative to a specified class of tests.
For example, suppose a generator maps 128 seed bits to 256 output bits. Its range contains at most strings out of possibilities. Enumerating the range would distinguish it almost perfectly, but requires infeasible work at this size. A secure construction must resist efficient tests that avoid enumeration as well. Merely copying the seed twice fails immediately: a test compares the two halves. Useful generators enable randomized algorithms or cryptographic protocols to expand a limited supply of random seed material.[ref]
The number of elementary operations on bits required by an algorithm. Arithmetic-operation counts treat operations on entire integers as units, whereas bit complexity charges for the sizes of their operands. An algorithm using few multiplications can therefore require substantially more bit operations when the operands grow. State the model when comparing bounds for repeated squaring or dynamic programming counts.
Parameterized complexity studies an algorithm's resource use as a function of both the encoded input length and a distinguished nonnegative integer parameter . A small solution size, a dimension or a structural property of a graph can serve as the parameter. Fixed-parameter tractability allows arbitrary computable dependence on while keeping the exponent of independent of .
A kernelization is a polynomial-time algorithm mapping a parameterized decision problem instance to an equivalent instance of the same problem, with both encoded length and parameter bounded by a computable function of . Equivalent means that both instances have the same yes/no answer. The bound need not be a polynomial in ; a polynomial kernel is the stronger requirement that it is. For a decidable problem, exhaustively solving the bounded output leaves only a computable dependence on , so kernelization yields fixed-parameter tractability.
A parameterized decision problem is fixed-parameter tractable if an algorithm decides every instance of encoded length and parameter in running time at most , for a computable function and a constant independent of . The distinction is in the exponent: has this form, whereas an bound alone does not establish fixed-parameter tractability. Branching on an uncovered edge gives a fixed-parameter tractable vertex cover decision problem.
Decide whether all input elements are distinct. In the comparison model, this needs comparisons in the worst case. An accepting decision-tree leaf for distinct keys must force a total order: incomparable keys could otherwise be made equal consistently with its strict comparison outcomes. Thus the possible orders require different accepting leaves, giving a decision-tree depth of at least even for three-way comparisons.
A model in which an algorithm learns the relative order or equality of input keys by comparisons. Lower-bound reductions must preserve the information available to each comparison; transforming numbers and allowing stronger tests without justification can change the model. For intervals built from integers, every endpoint comparison can be simulated by comparing original keys and then fixed offsets.
A single comparison returning one of three outcomes: less than, equal to, or greater than. A comparison model may count this as one operation even when a programming language expresses the outcomes using multiple Boolean tests. Binary search on ordered keys uses one such comparison per inspected position.
Given two weighted formula utility representations with binary rational numbers as weights, decide whether their values agree on every Boolean valuation. This problem is co-NP-complete.
For membership, a valuation witnessing unequal values certifies non-equivalence. Evaluate all propositional formulas and add their weights exactly in polynomial time. For hardness, compare the one-rule base with the empty base. They are equivalent exactly when is an unsatisfiable Boolean formula. Thus even very small weighted rule bases express a universal equivalence question.
The class of decision problems whose complements belong to NP. Equivalently, negative instances admit polynomially bounded witnesses verifiable in polynomial time. A problem is co-NP-complete when it is in co-NP and every problem in co-NP has a polynomial-time reduction to it. Unsatisfiability of a propositional formula is a basic example: its complement is the NP-complete Boolean satisfiability problem.
The number of accesses to an unknown input needed to solve a specified task. The input might be a string with individually readable entries, or an implicitly supplied function. A complete statement specifies deterministic, randomized, or quantum access, the accepted error, and worst-case or expected cost. Quantum query complexity permits coherent input access through a quantum oracle.
Suppose an unknown function on has exactly one essential variable. Query the diagonal inputs to find two coordinates values giving distinct outputs; at most function-evaluation oracle calls suffice because the unary dependence is nonconstant. A query taking value on an index subset and outside it then tests whether the essential coordinate lies in . Repeated halving locates it in at most further queries. If , no query is needed.
For a matching lower bound with fixed , restrict to when and otherwise. Every query has only two possible replies. A binary decision tree distinguishing the possible essential indices needs at least leaves and depth . Integer outputs in the unrestricted problem need not be binary; the restricted family is what makes this query complexity argument valid.
In exact classical identification of an unknown linear Boolean function , a function oracle call returns one bit . The query complexity is exactly for . Queries on the standard basis inputs reveal , proving sufficiency. For necessity, a depth- decision tree has at most answer histories and must distinguish hidden binary strings; hence , even with adaptive inputs. A reversible circuit that preserves and updates a known target by exclusive or reveals the same one bit per call.
There is also a useful linear algebra proof. Along a fixed history, the chosen inputs form the rows of a matrix over the two-element finite field, and the replies specify . If there are queries, the rank-nullity theorem gives a nonzero vector with . Then and give identical replies throughout this history. This also explains why adaptive choices cannot evade the bound: equal earlier replies force the same later choices.
Communication complexity studies how much information distributed parties must exchange to compute a function of their separately held inputs. Local computation is free; the resource being counted is communicated bits or qubits, with the allowed shared randomness, quantum entanglement or other correlations specified separately. For a Boolean function , a one-way exact protocol has the receiver output correctly for every input after a single message. One-bit computation using Popescu–Rohrlich boxes shows that this resource measure changes drastically if ideal superquantum boxes are available.
For even positive , share the maximally entangled state . Each party applies a phase oracle from its input binary string, producing . Its overlap with is the displayed expression because the Hamming distance counts exactly the negative signs. Under the promise , the output either equals or is orthogonal to it. Sending one subsystem lets the receiver distinguish the cases with the projective measurement . The transmitted system needs qubits, including when is not a power of two.
A promise problem consists of disjoint sets of YES and NO instances. An algorithm or verifier must obey its correctness guarantees only on their union. Energy problems with separated thresholds are naturally promise problems because intermediate-energy instances require no prescribed answer.
Quantum complexity theory studies resources needed by quantum circuits and quantum algorithms, including time, workspace, and quantum query complexity. Its models specify which input oracles and gate implementations are available; counting oracle calls is different from counting all elementary gates.
BQP is the class of promise problems decided by uniform polynomial-size quantum circuits with bounded error. Completeness and soundness are conventional; BQP error reduction shows that other fixed separated thresholds give the same class.
Independent runs of a BQP algorithm with fresh ancilla qubits can be combined by a classical threshold rule. If completeness exceeds soundness by , a Hoeffding inequality bounds the error after runs by . Polynomial repetition handles inverse-polynomial gaps. This does not automatically preserve the restricted gate and measurement rules of a stoquastic circuit.
A quantum witness is a polynomial-size quantum state supplied to a verifier as evidence for a YES instance. The verifier fixes its own ancilla qubits independently. Pure quantum witnesses suffice when maximizing a linear acceptance functional on density operators. Quantum witnesses are not generally restricted to basis vectors or product states.
StoqMA is a restricted quantum-verifier class using stoquastic circuits and polynomial-size quantum witnesses. A YES instance has a quantum witness accepted with probability at least ; on a NO instance every quantum witness has acceptance at most , with an inverse-polynomial gap . An optimal quantum witness can be chosen with nonnegative amplitudes, since the witness acceptance operator is entrywise nonnegative. The quantum witness is generally a superposition, rather than a computational basis vector. The stoquastic acceptance floor explains the lower limit for a nontrivial soundness promise.
QMA is the class of promise problems with a polynomial-size quantum witness checked by a uniform polynomial-size quantum circuit. YES instances have an accepting witness with probability at least ; NO instances have acceptance at most for every witness, including mixed states. The verifier's acceptance is linear in the witness density operator. Inverse-polynomial or exponentially small error can be obtained through QMA error reduction.
For quantum witness embedding , verifier unitary and accepting projector , the witness acceptance operator is the positive contraction . The maximum acceptance over normalized quantum witnesses is by the Rayleigh quotient. Restricting to basis quantum witnesses only tests its diagonal entries and need not find that maximum.
For a positive witness acceptance operator on dimension , large trace powers approximate its largest eigenvalue. With an -qubit QMA quantum witness and , the usual NO instances give and YES instances give a value above . A closed product-index expansion computes the trace by recomputation with polynomial storage, avoiding logarithms and roots in a real-arithmetic implementation.
Starting from completeness and soundness , run an odd number of parallel copies and take majority. The QMA parallel repetition with entangled witnesses argument proves soundness for arbitrary repeated witnesses. Exponential Markov's inequality gives majority error at most . Hence copies suffice for error , with polynomial overhead when the target error is inverse-polynomial or exponentially small in input length.
Independent verifier circuits on witness registers induce a threshold acceptance effect built from tensor products of and , where is the quantum verifier acceptance operator. In a product eigenbasis of , the effect's eigenvalues are threshold probabilities for independent Bernoulli random variables with parameters given by the selected eigenvalues of . Bounding every parameter on a NO instance bounds the effect's operator norm, even if the actual submitted witness is entangled. Independence is used only for the spectral calculation, not assumed for the witness.
A verifier with clean ancillas and a designated output measurement induces an effect on the witness register. Its acceptance probability is , and the largest possible acceptance is . Spectral bounds on make the soundness quantifier over all witnesses, including entangled repeated witnesses, explicit.
The quantum query complexity of a task counts uses of an input oracle by a quantum circuit, for a specified success probability. Known gates and workspace operations are not counted as oracle queries, although they contribute to the circuit's full runtime. An efficient query bound therefore need not, by itself, be an efficient gate bound.
A quantum oracle supplies coherent access to a function through a specified unitary operator. For a function with binary string output, the standard construction retains the input and adds the output into an answer quantum register by bitwise exclusive or. This operation is its own inverse, even when the function is not injective. A Boolean quantum oracle is the single-output-bit case; Simon's algorithm uses several answer qubits. Other encodings, such as a modular-addition quantum oracle or a phase gate encoding, require their own explicit query conventions.
A phase oracle encodes a Boolean function in the signs of computational basis states. Its diagonal entries have modulus one, so it is a unitary operator. The usual convention changes the sign when . A complemented convention instead changes the sign when , with ; denotes exclusive or. The two conventions differ by a global phase when used without coherent control, but the global phase of a controlled quantum gate makes that difference observable when the quantum oracle is controlled.
An unrestricted Boolean function on inputs cannot be classified as constant or nonconstant with certainty using a single phase oracle query, even with quantum ancillas. Write a purified query input as with and . The zero constant function leaves it unchanged; the function supported only at produces a vector with inner product with it. Perfect discrimination of pure states requires orthogonality, forcing for all and thus , a contradiction. This is an exact quantum query complexity obstruction for all nonconstant inputs, rather than the restricted promise used by the Deutsch-Jozsa algorithm.
After input-bit queries, every probability amplitude is a polynomial of degree at most , because the bit-query matrix entries are affine in the input bits. An acceptance probability is a sum of squared absolute amplitudes and has polynomial degree at most . Multilinear reduction on the Boolean cube does not increase degree. Exact acceptance therefore implies . For bounded error the acceptance polynomial only approximates the Boolean function; its exact representing degree is not the relevant bound.
The least worst-case number of input-oracle calls made by a quantum circuit that computes a Boolean function with zero error on every input. Known unitary gates and classical processing do not count toward this quantity; their runtime is a separate cost.
One exact parity query determines whether the first two bits agree. If they agree, a second query reads one of them; otherwise it reads the third bit. Those values respectively determine the three-bit majority function. The matching lower bound follows from its degree-three multilinear polynomial.
Given a function with an -bit output, accessed through the unitary operator , quantum collision finding asks for distinct inputs with equal outputs. Here is bitwise exclusive or on the -bit answer quantum register. The distinctness requirement excludes the uninformative pair . For a two-to-one function on inputs, Grover search algorithm methods yield a cube-root quantum query complexity, despite a square-root cost for finding a partner of just one preselected input.
Query a known set of inputs and store its output table. If no function collision occurs there, each of its distinct outputs has exactly one partner in the complement, for a two-to-one function. A compute-phase-uncompute construction marks those partners using two function queries and reversible table comparison. Known-subset Grover search then uses such phase queries. Including table preparation and a final verification query gives
Choosing balances both terms and gives . The Grover rotation angle rounding bound gives success tending to one. This is a query bound; it does not make reversible table lookup free in a gate or physical-memory cost model.
The decision tree model computes a function by adaptively querying coordinates of an input. Each internal node specifies a query, its outgoing branches represent possible answers, and a leaf supplies the output. Later queries may depend on earlier answers. The number of queries on the longest root-to-leaf path is the decision-tree depth.[ref]
For example, consider the Boolean function that returns one if any of its input bits is one. Querying in order can stop at the first one, but the all-zero input requires all queries: an unread bit might still change the output. Thus the worst-case query complexity is .
If the input bits are independent and fair, that same procedure uses only
queries on average. Worst-case depth and average cost therefore answer different questions, and an average requires a specified input probability distribution.
A decision tree represents a deterministic computation of a known Boolean function by inspecting input bits. Each internal vertex of its binary tree names a coordinate to query, its two outgoing edges carry answers 0 and 1, and each leaf carries the output 0 or 1. Starting at the root of a tree, read the named bit, follow its answer edge, and repeat until a leaf is reached. Correctness requires the leaf's label to equal for every input .[ref]
The next coordinate, or the decision to stop, can depend on earlier answers: this is adaptive querying. The same input always follows the same graph path; adaptivity does not require randomness. A correct leaf must have the same output for every completion of the observed bits. Thus a decision tree can stop as soon as the observations form a query certificate. Querying an already known coordinate adds no information, so we use decision trees without repeated coordinates on a graph path; an efficient tree also removes queries made after the output is already forced.
The motivation is exact computation with shortcuts. If inspecting an input entry is expensive, the question is how much of the input must actually be read. The decision-tree query cost counts these inspections, while local calculations on known values are free in this model; this cost need not equal an implementation's time complexity. Here the Boolean function is specified in advance and must be computed exactly on every input. Decision tree learning instead fits a predictor from data, with a different objective.
A binary decision tree represents a procedure whose internal nodes ask two-outcome questions and whose leaves specify results. A path records the answers obtained so far; its length counts the questions on that execution. Distinguishing possibilities requires at least leaves, so a depth- binary tree can distinguish at most outcomes. This gives for an exact worst-case identification problem. The bound relies on the questions really having only two outcomes; comparisons with an equality branch need a stated convention.
Three votes give a small but revealing majority function:
Our decision tree queries , then . If these bits agree, return their common value: two equal votes already force the majority function. If they disagree, query and return its value. The first two queries have a fixed order, but whether a third query occurs is adaptive.
Figure 1.
An exact three-bit majority decision tree: equal first answers stop after two queries
. Details.
Each internal label in the diagram names the next bit to inspect. Each leaf lists its output, decision-tree query cost , and compatible inputs; an asterisk denotes an unread bit. The two shallow leaves each cover two inputs, while each deeper leaf covers one. Reading every bit would also compute the majority function, but would miss these exact shortcuts.
All eight inputs give the following exhaustive check. The parity column is the parity of , computed by exclusive or; its decision-tree query cost is justified under parity lower bound for Boolean queries.
Majority function outputQueried coordinates for the majority functionMajority function query countParity outputParity query count00002030010213010031301113031000313101130311012031111213
The worst inputs for this decision tree are , exactly those with . Its actual depth is three. Every exact decision tree for this majority function has depth at least three: after the first query, an adversary can answer the second distinct query with the opposite bit, leaving the last bit decisive. Consequently its optimal decision-tree depth is , even though some inputs finish sooner. Every input has a two-bit query certificate, namely two agreeing votes; locating those votes can require a third query. This separates having a short query certificate from finding one.
For three bits, the Boolean function outputs one when is odd, where denotes exclusive or. Unlike the three-bit majority decision tree, an exact decision tree computing parity must inspect all three bits on every input. If any coordinate is unread, two completions differing only at that coordinate follow the same observed graph path but have opposite parity. A single leaf cannot correctly label both.
The same argument works for bits: parity needs all queries on every input, whatever their order. Thus its decision-tree depth is , its expected query cost is for every input probability distribution, and each coordinate revealment is one. The algorithm remains required to be correct on the whole Boolean cube, even if the chosen probability distribution assigns some inputs zero probability; a promise restricting permitted inputs would be a different computational problem.
For a particular decision tree , its decision-tree query cost is the number of queries along the graph path followed by input . Its actual tree depth is
The query vertices count as operations; each is followed by one answer edge. Thus a leaf reached after queries has graph path length , and a tree consisting only of an output leaf has depth zero. With no repeated coordinates, . The decision-tree depth minimizes over all correct decision trees for ; measures the chosen algorithm, while measures the Boolean function.
Choose an input probability distribution and let have that distribution. Then is a random variable even when the decision tree is deterministic. Its probability mass function describes how often each path length occurs, and its expected value is the expected query cost. None of these quantities changes the actual maximum depth of .
Figure 1.
Uniform three-bit inputs: query-count distributions and coordinate revealment for majority and parity
. Details.
The left panel aggregates the eight inputs from the three-bit majority decision tree: four cost two queries and four cost three. Parity always costs three. The right panel asks a different question, which coordinates are inspected: the majority function algorithm always queries coordinates 1 and 2, but queries coordinate 3 only on disagreements. These are probabilities of inspection, not probabilities that a bit equals one.
For a fixed decision tree and input probability distribution , its expected query cost is
Under the discrete uniform distribution on the eight three-bit inputs, the three-bit majority decision tree has
This is an exact average, not a fractional query made during one execution. It is also optimal among exact deterministic decision trees under this discrete uniform distribution: one observed bit never determines the majority function; whichever two distinct coordinates are inspected first, their values disagree with probability , forcing a third query. In comparison, querying all three bits unconditionally has the same actual depth three but expected query cost three.
For an arbitrary input probability distribution, the same fixed three-bit majority decision tree gives . For three independent random variables, each a Bernoulli random variable with common one-probability , this becomes ; the value depends on . Averaging over inputs should also be distinguished from averaging over an algorithm's internal random choices at a fixed input.[ref]
The coordinate revealment of coordinate for a decision tree under input probability distribution is
It depends on the chosen decision tree and the probability distribution, not just on the Boolean function. Since no coordinate is queried twice on a graph path, indicator functions give
The second equality uses linearity of expectation; it does not require independence of random variables or a product measure. The cited paper defines these inspection probabilities and their sum for product measures; the displayed indicator function argument extends the identity to any input probability distribution.[ref]
For the three-bit majority decision tree under the discrete uniform distribution, , whose sum is . Reading coordinate 3 first, then coordinate 1, and stopping on agreement gives the same majority function, depth and expected query cost, but coordinate revealments . The asymmetry belongs to the chosen query order. Parity gives for every exact decision tree without repeated queries. If repeated queries were charged, inspection probabilities would count distinct coordinates; total query count would instead require expected multiplicities.
The decision-tree depth of a Boolean function is the smallest possible maximum number of input coordinates queried along any root-to-leaf graph path of a decision tree computing :
The actual depth of a particular decision tree can exceed this optimum. A constant function admits a depth-zero tree even though an inefficient algorithm could inspect its entire input before returning that constant. Expected query cost and coordinate revealment additionally require an input probability distribution; does not. The three-bit majority decision tree and three-bit parity both have optimal decision-tree depth three, although only the former has the two-query shortcuts described above.
A query certificate fixes some input coordinates to their values in a chosen input and must force the output for every completion. The smallest such size is ; maximizing over accepted or rejected inputs gives or , and maximizing both gives . A one-sided maximum over an empty output class is defined as zero. This is query certificate complexity, distinct from polynomial verification of a witness in NP.
For a Boolean function and a chosen input , a set of coordinates is a query certificate if every agreeing with on has . It fixes actual input bits rather than supplying an independently guessed certificate to an NP verifier. Minimizing its size at each input and then maximizing gives query certificate complexity.
A Boolean function is evasive when every deterministic decision tree computing it has a worst-case path that queries all input bits. The alternating-sum criterion for decision-tree evasiveness is one sufficient method for proving this lower bound.
A leaf reached before all input bits are queried leaves at least one coordinate free. Flipping that coordinate pairs its inputs with opposite alternating signs and equal output. Thus every such leaf contributes zero. If the total alternating sum is nonzero, a depth below is impossible.
To prove that a threshold function requires every input bit in the worst case, an adversary answers queries while keeping completions on both sides of the threshold possible. If this remains true until the final unqueried bit, every decision tree has depth equal to the number of variables.
A computational problem specifies what counts as a valid output for each permitted input. A binary relation can express this requirement: means that is a valid answer to . The computational problem is the specification; an algorithm is a proposed way to satisfy it.
For example, given an array and value , under the promise that occurs, a search problem can request any index with . Repeated values may give several valid outputs. The related decision problem only asks whether an occurrence exists and requires a yes-or-no answer. Stating the encoding, permitted instances and required answer prevents these tasks from being confused when comparing running time or verification costs.
An input is the finite data supplied to a computation.
Articles were limited to the first 100 out of 354 total.

Articles by others on the same topic (1)

Theoretical computer science is a branch of computer science that focuses on the mathematical and abstract foundations of computing. It encompasses a variety of topics and concepts that explore the capabilities, limitations, and behavior of computational systems. Some of the key areas within theoretical computer science include: 1. **Algorithms and Complexity**: This area studies the efficiency of algorithms and classifies problems based on their computational complexity. It explores concepts such as P versus NP, NP-completeness, and various complexity classes (e.g.