Lably
Skip to content

Yao's principle

Equivalence of average-case and expected complexity

  • 13 min read
  • 4 chapters

Related on Lably

Through Probability distribution, Expected value and Permutation

  • The optimal performance that can be obtained by a deterministic algorithm on a random input (its average-case complexity), for a probability distribution on inputs chosen to be as hard as possible and for an algorithm chosen to work as well as possible against that distribution
  • The optimal performance that can be obtained by a random algorithm on a deterministic input (its expected complexity), for an algorithm chosen to have the best performance on its worst case inputs, and the worst case input to the algorithm

Yao's principle is often used to prove limitations on the performance of randomized algorithms, by finding a probability distribution on inputs that is difficult for deterministic algorithms, and inferring that randomized algorithms have the same limitation on their worst case performance.

This principle is named after Andrew Yao, who first proposed it in a 1977 paper. It is closely related to the minimax theorem in the theory of zero-sum games, and to the duality theory of linear programs.

Formulation

Yao's principle is formulated in terms of an arbitrary real valued cost measure c(A,x) of an algorithm A on an input x, such as its running time, for which one wishes to study the expected value over randomized algorithms and random inputs. The algorithms used in this cost measure are drawn from a finite set A of deterministic algorithms; a typical way to make a problem have only a finite set of algorithms is to restrict its inputs to a single size. The inputs, too, should be drawn from a finite set X, which can be made finite in the same way. Then, each probability distribution over A corresponds to a randomized algorithm that first makes a random choice from A according to that distribution and then follows the chosen algorithm; in this way, the class of randomized algorithms for the same problem can be modeled as the class R of all probability distributions over A. Finally, the formulation of Yao's principle involves the class of all probability distributions on inputs in X, denoted as D. Then, Yao's principle states that:

maxD∈DminA∈AEx∼D[c(A,x)]=minR∈Rmaxx∈XE[c(R,x)].

Here, E is notation for the expected value, and x∼D means that x is a random variable distributed according to D. The left hand side of the formula gives the optimal performance that can be obtained by a deterministic algorithm A on a random input x (its average-case complexity), for a probability distribution D on inputs that is as hard as possible and with A being the algorithm that performs best against D. The right hand side gives the optimal performance that can be obtained by a random algorithm R on a deterministic input x (its expected complexity), when R has the best performance on its worst case inputs, and when x is a worst case input to R. The finiteness of A and X allows D and R to be interpreted as simplices of probability vectors, whose compactness implies that the minima and maxima in these formulas exist.

Another version of Yao's principle weakens it from an equality to an inequality, but at the same time generalizes it by relaxing the requirement that the algorithms and inputs come from a finite set. The direction of the inequality allows it to be used when a specific input distribution has been shown to be hard for deterministic algorithms, converting it into a lower bound on the cost of all randomized algorithms. In this version, for every input distribution D∈D, and for every randomized algorithm R in R, minA∈AEx∼D[c(A,x)]≤maxx∈XE[c(R,x)]. That is, the best possible deterministic performance against distribution D is a lower bound for the performance of each randomized algorithm R against its worst-case input. This version of Yao's principle can be proven through the chain of inequalities minA∈AEx∼D[c(A,x)]≤Ex∼D[c(R,x)]≤maxx∈XE[c(R,x)], each of which can be shown using only linearity of expectation and the principle that min≤E≤max for all distributions. By avoiding maximization and minimization over D and R, this version of Yao's principle can apply in some cases where X or A are not finite. Although this direction of inequality is the direction needed for proving lower bounds on randomized algorithms, the equality version of Yao's principle, when it is available, can also be useful in these proofs. The equality of the principle implies that there is no loss of generality in using the principle to prove lower bounds: whatever the actual best randomized algorithm might be, there is some input distribution through which a matching lower bound on its complexity can be proven.

Sign in to keep reading

3 more chapters are free with a Lably account.

More in Computing and communication