68 Computer science
Computer science
Are there problems whose answers are quick to check but hopelessly slow to find?
The mathematical side of computer science studies what can be computed and at what cost. It defines precise models of computation, designs algorithms and data structures, and proves limits on what any algorithm can achieve. It also covers the theory of programming languages and software, formal languages, databases, artificial intelligence and the use of computers in mathematical research.
Results come in two kinds. Upper bounds exhibit an algorithm and analyze its running time or memory use. Lower bounds and impossibility results show that no algorithm can do better, often by reducing one problem to another. The area borrows heavily from logic, combinatorics, probability and algebra, and it returns questions to them, such as the P versus NP problem.
How many comparisons to sort?
Eight distinct numbers can be arranged in orders. A sorting method that only compares pairs learns one yes or no answer per comparison, so comparisons can tell apart at most orders. Since , every such method needs at least 16 comparisons on some input. Merge sort needs at most 17 on eight numbers.
Central objects
- Algorithm
- A finite, precise procedure that transforms an input into an output.
- Turing machine
- A simple abstract computer with a tape and a finite set of rules, used to define computability.
- Complexity class
- A set of problems solvable within a given resource bound, such as P or NP.
- Reduction
- A way of transforming one problem into another, showing the second is at least as hard.
- Data structure
- A way of organizing data so that chosen operations are fast.
- Formal language
- A set of strings over a finite alphabet, often described by a grammar or an automaton.
- Boolean circuit
- A network of AND, OR and NOT gates computing a function of input bits.
Landmark theorems
- Undecidability of the halting problem1936
There is no algorithm that takes as input a Turing machine and an input string and correctly decides, in every case, whether the machine eventually halts on that input.
- Kleene's theorem
A language is accepted by some finite automaton if and only if it is described by some regular expression.
- Time hierarchy theorem
If and are time-constructible functions with , then some language is decidable by a deterministic Turing machine in time but not in time . In particular, P is strictly contained in EXP.
- Cook-Levin theorem1971
Boolean satisfiability is NP-complete: it lies in NP, and every problem in NP reduces to it in polynomial time.
- PCP theorem1992
Every language in NP has a verifier that uses random bits, reads only a constant number of bits of a proposed proof, always accepts a correct proof of a true statement, and rejects every proposed proof of a false statement with probability at least .
- AKS primality theorem2002
There is a deterministic algorithm that decides whether a given integer is prime in time polynomial in the number of its digits.
Open problems and frontiers
- P versus NP
Can every problem whose solutions can be verified in polynomial time also be solved in polynomial time?
- Exponent of matrix multiplication
Can two matrices be multiplied using arithmetic operations for every ?
- Complexity of integer factoring
Is there a polynomial-time algorithm on a classical computer that factors integers?
Environments in this area
No environment in this area yet. Each environment is a generator of Lean tasks with a verifier: see how they are built and add one.
Contribute an environment