HOME

TheInfoList



OR:

In
computational complexity theory In theoretical computer science and mathematics, computational complexity theory focuses on classifying computational problems according to their resource usage, and explores the relationships between these classifications. A computational problem ...
, the average-case complexity of an
algorithm In mathematics and computer science, an algorithm () is a finite sequence of Rigour#Mathematics, mathematically rigorous instructions, typically used to solve a class of specific Computational problem, problems or to perform a computation. Algo ...
is the amount of some computational resource (typically time) used by the algorithm, averaged over all possible inputs. It is frequently contrasted with
worst-case complexity In computer science (specifically computational complexity theory), the worst-case complexity measures the resources (e.g. running time, memory) that an algorithm requires given an input of arbitrary size (commonly denoted as in asymptotic notat ...
which considers the maximal complexity of the algorithm over all possible inputs. There are three primary motivations for studying average-case complexity. First, although some problems may be intractable in the worst-case, the inputs which elicit this behavior may rarely occur in practice, so the average-case complexity may be a more accurate measure of an algorithm's performance. Second, average-case complexity analysis provides tools and techniques to generate hard instances of problems which can be utilized in areas such as
cryptography Cryptography, or cryptology (from "hidden, secret"; and ''graphein'', "to write", or ''-logy, -logia'', "study", respectively), is the practice and study of techniques for secure communication in the presence of Adversary (cryptography), ...
and
derandomization A randomized algorithm is an algorithm that employs a degree of randomness as part of its logic or procedure. The algorithm typically uses uniformly random bits as an auxiliary input to guide its behavior, in the hope of achieving good performan ...
. Third, average-case complexity allows discriminating the most efficient algorithm in practice among algorithms of equivalent best case complexity (for instance
Quicksort Quicksort is an efficient, general-purpose sorting algorithm. Quicksort was developed by British computer scientist Tony Hoare in 1959 and published in 1961. It is still a commonly used algorithm for sorting. Overall, it is slightly faster than ...
). Average-case analysis requires a notion of an "average" input to an algorithm, which leads to the problem of devising a
probability distribution In probability theory and statistics, a probability distribution is a Function (mathematics), function that gives the probabilities of occurrence of possible events for an Experiment (probability theory), experiment. It is a mathematical descri ...
over inputs. Alternatively, a
randomized algorithm A randomized algorithm is an algorithm that employs a degree of randomness as part of its logic or procedure. The algorithm typically uses uniformly random bits as an auxiliary input to guide its behavior, in the hope of achieving good performan ...
can be used. The analysis of such algorithms leads to the related notion of an expected complexity.


History and background

The average-case performance of algorithms has been studied since modern notions of computational efficiency were developed in the 1950s. Much of this initial work focused on problems for which worst-case polynomial time algorithms were already known. In 1973,
Donald Knuth Donald Ervin Knuth ( ; born January 10, 1938) is an American computer scientist and mathematician. He is a professor emeritus at Stanford University. He is the 1974 recipient of the ACM Turing Award, informally considered the Nobel Prize of comp ...
published Volume 3 of the
Art of Computer Programming Art is a diverse range of cultural activity centered around ''works'' utilizing creative or imaginative talents, which are expected to evoke a worthwhile experience, generally through an expression of emotional power, conceptual ideas, tec ...
which extensively surveys average-case performance of algorithms for problems solvable in worst-case polynomial time, such as sorting and median-finding. An efficient algorithm for -complete problems is generally characterized as one which runs in polynomial time for all inputs; this is equivalent to requiring efficient worst-case complexity. However, an algorithm which is inefficient on a "small" number of inputs may still be efficient for "most" inputs that occur in practice. Thus, it is desirable to study the properties of these algorithms where the average-case complexity may differ from the worst-case complexity and find methods to relate the two. The fundamental notions of average-case complexity were developed by
Leonid Levin Leonid Anatolievich Levin ( ; ; ; born November 2, 1948) is a Soviet-American mathematician and computer scientist. He is known for his work in randomness in computing, algorithmic complexity and intractability, average-case complexity, fou ...
in 1986 when he published a one-page paper defining average-case complexity and completeness while giving an example of a complete problem for , the average-case analogue of .


Definitions


Efficient average-case complexity

The first task is to precisely define what is meant by an algorithm which is efficient "on average". An initial attempt might define an efficient average-case algorithm as one which runs in expected polynomial time over all possible inputs. Such a definition has various shortcomings; in particular, it is not robust to changes in the computational model. For example, suppose algorithm runs in time on input and algorithm runs in time on input ; that is, is quadratically slower than . Intuitively, any definition of average-case efficiency should capture the idea that is efficient-on-average if and only if is efficient on-average. Suppose, however, that the inputs are drawn randomly from the uniform distribution of strings with length , and that runs in time on all inputs except the string for which takes time . Then it can be easily checked that the expected running time of is polynomial but the expected running time of is exponential. To create a more robust definition of average-case efficiency, it makes sense to allow an algorithm to run longer than polynomial time on some inputs but the fraction of inputs on which requires larger and larger running time becomes smaller and smaller. This intuition is captured in the following formula for average polynomial running time, which balances the polynomial trade-off between running time and fraction of inputs: : \Pr_ \left _A(x) \geq t \right\leq \frac for every and polynomial , where denotes the running time of algorithm on input , and is a positive constant value. Alternatively, this can be written as : E_ \left \frac \right\leq C for some constants and , where . In other words, an algorithm has good average-case complexity if, after running for steps, can solve all but a fraction of inputs of length , for some .


Distributional problem

The next step is to define the "average" input to a particular problem. This is achieved by associating the inputs of each problem with a particular probability distribution. That is, an "average-case" problem consists of a language and an associated probability distribution which forms the pair . The two most common classes of distributions which are allowed are: #Polynomial-time computable distributions (-computable): these are distributions for which it is possible to compute the cumulative density of any given input . More formally, given a probability distribution and a string it is possible to compute the value \mu(x) = \sum\limits_ \Pr /math> in polynomial time. This implies that is also computable in polynomial time. #Polynomial-time samplable distributions (-samplable): these are distributions from which it is possible to draw random samples in polynomial time. These two formulations, while similar, are not equivalent. If a distribution is -computable it is also -samplable, but the converse is not true if ≠ .


AvgP and distNP

A distributional problem is in the complexity class if there is an efficient average-case algorithm for , as defined above. The class is occasionally called in the literature. A distributional problem is in the complexity class if is in and is -computable. When is in and is -samplable, belongs to . Together, and define the average-case analogues of and , respectively.


Reductions between distributional problems

Let and be two distributional problems. average-case reduces to (written ) if there is a function that for every , on input can be computed in time polynomial in and #(Correctness) if and only if #(Domination) There are polynomials and such that, for every and , \sum\limits_ D_n(x) \leq p(n)D'_(y) The domination condition enforces the notion that if problem is hard on average, then is also hard on average. Intuitively, a reduction should provide a way to solve an instance of problem by computing and feeding the output to the algorithm which solves . Without the domination condition, this may not be possible since the algorithm which solves in polynomial time on average may take super-polynomial time on a small number of inputs but may map these inputs into a much larger set of so that algorithm no longer runs in polynomial time on average. The domination condition only allows such strings to occur polynomially as often in .


DistNP-complete problems

The average-case analogue to -completeness is -completeness. A distributional problem is -complete if is in and for every in , is average-case reducible to . An example of a -complete problem is the Bounded Halting Problem, (for any -computable ''D'') defined as follows: BH = \ In his original paper, Levin showed an example of a distributional tiling problem that is average-case -complete. A survey of known -complete problems is available online. One area of active research involves finding new -complete problems. However, finding such problems can be complicated due to a result of Gurevich which shows that any distributional problem with a flat distribution cannot be -complete unless = . (A flat distribution is one for which there exists an such that for any , .) A result by Livne shows that all natural -complete problems have -complete versions. However, the goal of finding a natural distributional problem that is -complete has not yet been achieved.


Applications


Sorting algorithms

As mentioned above, much early work relating to average-case complexity focused on problems for which polynomial-time algorithms already existed, such as sorting. For example, many sorting algorithms which utilize randomness, such as
Quicksort Quicksort is an efficient, general-purpose sorting algorithm. Quicksort was developed by British computer scientist Tony Hoare in 1959 and published in 1961. It is still a commonly used algorithm for sorting. Overall, it is slightly faster than ...
, have a worst-case running time of , but an average-case running time of , where is the length of the input to be sorted.


Cryptography

For most problems, average-case complexity analysis is undertaken to find efficient algorithms for a problem that is considered difficult in the worst-case. In cryptographic applications, however, the opposite is true: the worst-case complexity is irrelevant; we instead want a guarantee that the average-case complexity of every algorithm which "breaks" the cryptographic scheme is inefficient. Thus, all secure cryptographic schemes rely on the existence of
one-way functions One-way or one way may refer to: *One-way traffic, a street either facilitating only one-way traffic, or designed to direct vehicles to move in one direction * One-way travel, a trip that does not return to its origin Music *One Way (American b ...
. Although the existence of one-way functions is still an open problem, many candidate one-way functions are based on hard problems such as
integer factorization In mathematics, integer factorization is the decomposition of a positive integer into a product of integers. Every positive integer greater than 1 is either the product of two or more integer factors greater than 1, in which case it is a comp ...
or computing the
discrete log In mathematics, for given real numbers a and b, the logarithm \log_b(a) is a number x such that b^x=a. Analogously, in any group G, powers b^k can be defined for all integers k, and the discrete logarithm \log_b(a) is an integer k such that b^k=a. ...
. Note that it is not desirable for the candidate function to be -complete since this would only guarantee that there is likely no efficient algorithm for solving the problem in the worst case; what we actually want is a guarantee that no efficient algorithm can solve the problem over random inputs (i.e. the average case). In fact, both the integer factorization and discrete log problems are in , and are therefore not believed to be -complete. The fact that all of cryptography is predicated on the existence of average-case intractable problems in is one of the primary motivations for studying average-case complexity.


Other results

Yao's principle In computational complexity theory, Yao's principle (also called Yao's minimax principle or Yao's lemma) relates the performance of randomized algorithms to deterministic (non-random) algorithms. It states that, for certain classes of algorithms, ...
, from a 1978 paper by
Andrew Yao Andrew Chi-Chih Yao ( zh , c = 姚期智 , p = Yáo Qīzhì; born December 24, 1946) is a Chinese computer scientist, physicist, and computational theorist. He is currently a professor and the dean of Institute for Interdisciplinary Informati ...
, shows that for broad classes of computational problems, average-case complexity for a hard input distribution and a deterministic algorithm adapted to that distribution is the same thing as expected complexity for a fast randomized algorithm and its worst-case input. In 1990, Impagliazzo and Levin showed that if there is an efficient average-case algorithm for a -complete problem under the uniform distribution, then there is an average-case algorithm for every problem in under any polynomial-time samplable distribution.R. Impagliazzo and L. Levin, "No Better Ways to Generate Hard NP Instances than Picking Uniformly at Random," in Proceedings of the 31st IEEE Sympo- sium on Foundations of Computer Science, pp. 812–821, 1990. Applying this theory to natural distributional problems remains an outstanding open question. In 1992, Ben-David et al. showed that if all languages in have good-on-average decision algorithms, they also have good-on-average search algorithms. Further, they show that this conclusion holds under a weaker assumption: if every language in is easy on average for decision algorithms with respect to the uniform distribution, then it is also easy on average for search algorithms with respect to the uniform distribution. Thus, cryptographic one-way functions can exist only if there are problems over the uniform distribution that are hard on average for decision algorithms. In 1993, Feigenbaum and Fortnow showed that it is not possible to prove, under non-adaptive random reductions, that the existence of a good-on-average algorithm for a -complete problem under the uniform distribution implies the existence of worst-case efficient algorithms for all problems in . In 2003, Bogdanov and Trevisan generalized this result to arbitrary non-adaptive reductions. These results show that it is unlikely that any association can be made between average-case complexity and worst-case complexity via reductions.


See also

*
Probabilistic analysis of algorithms In analysis of algorithms, probabilistic analysis of algorithms is an approach to estimate the computational complexity of an algorithm or a computational problem. It starts from an assumption about a probabilistic distribution of the set of all pos ...
*
NP-complete problems In computational complexity theory, NP-complete problems are the hardest of the problems to which ''solutions'' can be verified ''quickly''. Somewhat more precisely, a problem is NP-complete when: # It is a decision problem, meaning that for any ...
*
Worst-case complexity In computer science (specifically computational complexity theory), the worst-case complexity measures the resources (e.g. running time, memory) that an algorithm requires given an input of arbitrary size (commonly denoted as in asymptotic notat ...
*
Amortized analysis In computer science, amortized analysis is a method for analyzing a given algorithm's complexity, or how much of a resource, especially time or memory, it takes to execute. The motivation for amortized analysis is that looking at the worst-case ...
*
Best, worst and average case In computer science, best, worst, and average cases of a given algorithm express what the resource usage is ''at least'', ''at most'' and ''on average'', respectively. Usually the resource being considered is running time, i.e. time complexity, b ...


References


Further reading

Pedagogical presentations: * * * * The literature of average case complexity includes the following work: * *.. *. *. *. *. See als
1989 draft
*. *. *. *. *{{citation , last1 = Cox , first1 = Jim , last2 = Ericson , first2 = Lars , last3 = Mishra , first3 = Bud , series = Technical Report TR1995-711 , publisher = New York University Computer Science Department , title = The average case complexity of multilevel syllogistic , url = http://www.cs.nyu.edu/csweb/Research/TechReports/TR1995-711/TR1995-711.pdf , year = 1995. Randomized algorithms Analysis of algorithms