In computational complexity theory, Yao's principle (also called Yao's minimax principle or Yao's lemma) is a way to prove lower bounds on the worst-case performance of randomized algorithms, by comparing them to deterministic (non-random) algorithms. It states that, for any randomized algorithm, there exists a probability distribution on inputs to the algorithm, so that the expected cost of the randomized algorithm on its worst-case input is at least as large as the cost of the best deterministic algorithm on a random input from this distribution. Thus, to establish a lower bound on the performance of randomized algorithms, it suffices to find an appropriate distribution of difficult inputs, and to prove that no deterministic algorithm can perform well against that distribution. This principle is named after Andrew Yao, who first proposed it.
Yao's principle may be interpreted in game theoretic terms, via a two-player zero-sum game in which one player, Alice, selects a deterministic algorithm, the other player, Bob, selects an input, and the payoff is the cost of the selected algorithm on the selected input. Any randomized algorithm R may be interpreted as a randomized choice among deterministic algorithms, and thus as a mixed strategy for Alice. Similarly, a non-random algorithm may be thought of as a pure strategy for Alice. By von Neumann's minimax theorem, Bob has a randomized strategy that performs at least as well against R as it does against the best pure strategy Alice might have chosen. The worst-case input against Alice's strategy has cost at least as large as Bob's randomly chosen input paired against Alice's strategy, which in turn has cost at least as large as Bob's randomly chosen input paired against any pure strategy.
The formulation below states the principle for Las Vegas randomized algorithms, i.e., distributions over deterministic algorithms that are correct on every input but have varying costs. It is straightforward to adapt the principle to Monte Carlo algorithms, i.e., distributions over deterministic algorithms that have bounded costs but can be incorrect on some inputs.
Consider a problem over the inputs
l{X}
l{A}
a\inl{A}
x\inl{X}
c(a,x)\geq0
a
x
Let
p
l{A}
A
p
q
l{X}
X
q
\underset{x\inl{X}}{max} E[c(A,x)]\geq\underset{a\inl{A}}{min} E[c(a,X)].
That is, the worst-case expected cost of the randomized algorithm is at least the expected cost of the best deterministic algorithm against input distribution
q
Let
C=\underset{x\inl{X}}{max} E[c(A,x)]
D=\underset{a\inl{A}}{min} E[c(a,X)]
\begin{align} C&=\sumxqxC\ &\geq\sumxqxE[c(A,x)]\\ &= \sumxqx\sumapac(a,x)\\ &=\sumapa\sumxqxc(a,x)\\ &=\sumapaE[c(a,X)]\\ &\geq\sumapaD=D. \end{align}
As mentioned above, this theorem can also be seen as a very special case of the Minimax theorem.