Computational complexity theory is a foundational area of theoretical computer science that rigorously investigates the resources required to solve computational problems. A precise understanding of its formalism necessitates acquaintance with several core mathematical definitions, notations, and conceptual frameworks. These provide the language and tools necessary to articulate, analyze, and compare the computational difficulty of problems and the efficiency of algorithms.
1. Sets, Functions, and Relations
Sets
A set is a well-defined collection of distinct objects, called elements. In complexity theory, sets often represent collections of strings, numbers, or states. The standard notation for a set is uppercase letters, such as or
. For example,
commonly denotes an alphabet—a finite set of symbols.
– Example: If , then the set of all binary strings of length 3 is
.
Functions
A function assigns to every element
exactly one element
. Functions are fundamental for describing algorithms, transformations, and complexity measures.
– Example: The function maps natural numbers to their respective powers of two.
Relations
A relation is a subset of the Cartesian product of sets
and
. In the context of languages and decision problems, relations often describe the mapping between inputs and their associated outputs or certificates.
2. Alphabets, Strings, and Languages
Alphabet and Strings
An alphabet is a finite, non-empty set of symbols. A string over
is a finite sequence of symbols from
. The set of all strings over
is denoted
, where
represents the Kleene star operation.
– Example: For ,
is a string in
.
Languages
A language over
is any subset of
. In computational complexity, languages represent decision problems: for a string
, the question is whether
.
– Example: The language contains an even number of zeros
.
3. Decision Problems and Computational Models
Decision Problems
A decision problem asks a yes/no question about an input. Formally, it corresponds to a language : “Given
, is
?”
– Example: "Given a graph , does
have a Hamiltonian cycle?" is a decision problem.
Computational Models
Complexity theory formalizes computation using abstract machines. The most prominent is the Turing machine.
– Turing Machine (TM): An abstract model defined by a finite set of states, an infinite tape divided into cells, a tape head, and a transition function. A deterministic Turing machine (DTM) has a single transition for each state-symbol pair; a nondeterministic Turing machine (NTM) may have multiple transitions.
4. Asymptotic Notation
Asymptotic notation describes the limiting behavior of functions, important for expressing the resource usage (time, space) of algorithms as input size grows.
Big O Notation
– Definition: if there exist constants
and
such that for all
,
.
– Interpretation: grows no faster than
up to constant multiples for large
.
– Example: .
Omega and Theta Notations
– Big Omega ():
if for some
,
for all
.
– Big Theta ():
if
and
.
These notations enable formal comparison of algorithmic efficiency.
5. Complexity Measures
Time Complexity
Describes the number of computational steps (e.g., transitions of a Turing machine) required as a function of input size .
– Notation: or
for time taken on inputs of length
.
Space Complexity
Describes the amount of memory (tape cells used) as a function of input size.
– Notation: .
The resource bounds are typically considered in the asymptotic sense, for large input sizes.
6. Complexity Classes
Complexity classes group languages (problems) according to the resources needed to decide them.
P (Polynomial Time)
– Definition: The class of languages decidable by a deterministic Turing machine in polynomial time.
– Formalization: .
– Example: Sorting a list, checking if a number is prime.
NP (Nondeterministic Polynomial Time)
– Definition: The class of languages for which a solution can be verified in polynomial time by a deterministic Turing machine, or equivalently, decided by a nondeterministic Turing machine in polynomial time.
– Formalization: .
– Example: Satisfiability (SAT), Hamiltonian cycle.
Other Classes
– PSPACE: Languages decidable in polynomial space.
– EXPTIME: Languages decidable in exponential time.
7. Reductions
Reductions are mappings from one problem to another, demonstrating relative computational difficulty.
Many-One Reduction (
)
A language is many-one reducible to
(
) if there exists a computable function
such that
.
– Purpose: If is easy, and
, then
is at most as hard as
.
Polynomial-Time Reduction (
)
A polynomial-time computable reduction is used for comparing problems within and
. If
is computable in polynomial time, and
, then
.
8. NP-Completeness
A problem is NP-complete if:
1. It is in .
2. Every problem in is polynomial-time reducible to it.
Notation: is NP-complete if
and
.
– Example: The SAT problem is the canonical NP-complete problem.
9. Decision vs. Search Problems
While decision problems ask yes/no questions, search problems require finding an explicit solution. Complexity theory often focuses on decision problems, but search problems are closely related, particularly in cryptography and algorithm design.
10. Formal Language Theory
Complexity theory leverages formal language theory to represent and analyze problems.
– Regular languages: Recognized by finite automata.
– Context-free languages: Recognized by pushdown automata.
– Recursive (decidable) and recursively enumerable (semi-decidable) languages: Recognized by Turing machines with or without halting guarantees.
11. Notation for Turing Machines
A Turing machine is specified by a tuple
, where:
– : Finite set of states
– : Input alphabet (does not include blank symbol)
– : Tape alphabet (
), includes blank symbol
– : Transition function
– : Start state
– : Accept state
– : Reject state
The computation of on input
is denoted
.
12. Input Size
The length of the input, denoted , is measured as
, the number of symbols in the input string
. All complexity measures (time, space) are expressed as functions of
.
13. Universal Turing Machine
A universal Turing machine can simulate any Turing machine
on input
, given a description
and
. This forms the theoretical basis for the Church-Turing thesis.
14. Certificates and Verifiers
For problems, a verifier is a deterministic Turing machine
such that for any input
, there exists a certificate
(with
polynomial in
) satisfying
if and only if
is a "yes" instance.
– Example: For SAT, the certificate is a satisfying assignment.
15. Randomized Complexity Classes
– RP (Randomized Polynomial Time): Problems for which a probabilistic Turing machine can decide membership with one-sided error in polynomial time.
– BPP (Bounded-error Probabilistic Polynomial Time): Problems for which a probabilistic Turing machine can decide membership with two-sided error in polynomial time.
16. Oracle Machines
An oracle Turing machine has access to an "oracle" that instantly decides membership in a fixed language . This concept is used to study relative computability and separations between classes.
17. Hierarchy Theorems
Hierarchy theorems formalize the idea that more resources allow for the solution of more problems.
– Time Hierarchy Theorem: There exist problems solvable in more time but not less.
– Space Hierarchy Theorem: Analogous statement for space.
18. Completeness and Hardness
– Hardness: A problem is
-hard if every problem in class
reduces to
.
– Completeness: is
-complete if
and
is
-hard.
19. Boolean Circuits
Boolean circuits model computation as acyclic networks of logical gates. Circuit complexity studies the size (number of gates) and depth (levels of gates) needed to compute functions.
20. Encoding and Representation
All objects (Turing machines, graphs, formulas) must be encoded as strings over a finite alphabet for analysis within complexity theory. Standard encodings ensure uniform treatment and comparability of problems and algorithms.
—
Mastery of these definitions and formal notations is necessary for a precise and rigorous understanding of computational complexity theory. These formal tools underpin the classification of computational problems, the design and analysis of algorithms, and the study of cryptographic security assumptions.
Other recent questions and answers regarding EITC/IS/CCTF Computational Complexity Theory Fundamentals:
- Why is computational complexity theory important for understanding of the foundations of cryptography and cybersecurity?
- What is the role of the recursion theorem in the demonstration of the undecidability of ATM?
- Considering a PDA that can read palindromes, could you detail the evolution of the stack when the input is, first, a palindrome, and second, not a palindrome?
- Considering non-deterministic PDAs, the superposition of states is possible by definition. However, non-deterministic PDAs have only one stack which cannot be in multiple states simultaneously. How is this possible?
- What is an example of PDAs used to analyze network traffic and identify patterns that indicate potential security breaches?
- What does it mean that one language is more powerful than another?
- Are context-sensitive languages recognizable by a Turing Machine?
- Why is the language U = 0^n1^n (n>=0) non-regular?
- How to define an FSM recognizing binary strings with even number of '1' symbols and show what happens with it when processing input string 1011?
- How does nondeterminism impact transition function?
View more questions and answers in EITC/IS/CCTF Computational Complexity Theory Fundamentals