Yao's Minimax Principle: Game Tree Evaluation
Yao's Minimax Principle: Game Tree Evaluation
1
Yao’s Minimax Principle
Yao’s Minimax Principle
Assume
• Consider a problem over the inputs X and let A be the set of all
possible deterministic algorithms that correctly solve the problem.
• For any algorithm 𝑎 ∈ 𝐴 and input 𝑥 ∈ 𝑋, let c(a,x) be the cost of
algorithm a running on x.
• Let p be be a probability distributions over the algorithms A and let
A’ denote a random algorithm chosen according to p.
• Let q be a probability distribution over the inputs X and let X’
denote a random input chosen according to q.
Then
3
Yao’s Minimax Principle
Pf.
• Let 𝐶 = max 𝐸(𝑐 𝐴′, 𝑥 ).
𝑥∈𝑋
• For every input x, we have 𝑎 𝑝𝑎 𝑐(𝑎, 𝑥) ≤ 𝐶, Therefore,
𝑞𝑥 𝑝𝑎 𝑐(𝑎, 𝑥) ≤ 𝑞𝑥 𝐶 = 𝐶 𝑞𝑥 = 𝐶
𝑥 𝑥 𝑥
𝑎
𝑝𝑎 𝑞𝑥 𝑐(𝑎, 𝑥) ≤ 𝐶
𝑎
𝑥
𝑞𝑥 𝑐(𝑎, 𝑥) ≤ 𝐶
𝑥
4
Lower Bound For Sorting
5
Game Tree Evaluation
Definition of Game Tree
• A Game Tree Td,k is uniform tree in which the root and the internal
nodes has d children and every leaf is at distance 2k from the root.
• Internal nodes at even distance from the root are labeled MIN and
at odd distance are labeled MAX.
MIN
MAX MAX
0 1 0 0 0 1 0 1 0 1 0 0 0 1 0 1
Observations
• Every root-to-leaf path goes through the same number of MIN and
MAX nodes (including the root)
0 0 0 1
0 0 0 1 1 0 1 1
Game Tree Evaluation
0 1 1 1
0 0 0 1 1 0 1 1
Returned Value by the Root?
AND
OR OR
OR OR OR OR OR OR OR OR
0 1 0 0 0 1 0 1 0 1 0 0 0 1 0 1
A Deterministic Algorithm
Depth-first manner
always visit the left child before the right child
AND AND
OR OR OR OR
0 1 0 1 1 0 1 0
worst case – need to visit ALL 4k leaves a better case – visit 2 leaves is enough
A Randomized Algorithm
Coin toss
0.5 probability choosing the left child and 0.5 probability choosing the
right child
AND
OR OR
0 1 0 1
Expected cost
EAND_0 = EOR_1 = 3
Proof by induction:
consider k = 1
expected cost 3
Analysis of the Randomized Algorithm
AND
OR OR
0 0 0 1
Analysis of the Randomized Algorithm
OR OR
0 1 0 1
Analysis of the Randomized Algorithm
either gives 1 or 0
OR
T2,k-1 T2,k-1
Analysis of the Randomized Algorithm
either 1 or 0
Case II: OR-root gives 0
both subtrees give 0
E(T) 2 3k-1
OR
T2,k-1 T2,k-1
Analysis of the Randomized Algorithm
OR AND
T2,k
T2,k-1 T2,k-1
OR OR
AND
Case II: AND-root gives 1
both subtrees give 1
E(T2,k) 2 3/2 3k-1
= 3k OR OR
we will use Yao’s Minimax Principle and show a lower bound of n0.694
• This implies that every NOR-node in the tree has value 1 with probability
p, and independently from all other nodes at the same level.
Replacing AND and OR gates with NOR gates
AND NOR
OR OR NOR NOR
0 1 0 0 0 1 0 1 0 1 0 0 0 1 0 1 0 1 0 0 0 1 0 1 0 1 0 0 0 1 0 1
Lower Bound
We use Yao’s minimax principle and compute min 𝐸(𝑐 𝑎, 𝑋 ) where X is a random
𝑎∈𝐴
input where each leave is 1 with probability p and c(a,X) is the number of leaves
read by first-depth pruning algorithm a.
• Let W(h) denote the expected number of leaves to be read for evaluating a
node at distance h from the leaves. Then
𝑊 ℎ = 𝑝𝑊 ℎ − 1 + 1 − 𝑝 𝑊 ℎ − 1 + 𝑊 ℎ − 1 = 𝑊 ℎ − 1 + 1 − 𝑝 W(h − 1)
• The above comes from the fact that one of the two children has to be
evaluated for sure and with probability (1−p) it gets value 0, in which case
also the second child needs to be evaluated.
• Substituting h by log2 n, we get 𝑊(ℎ) = 𝑛0.694
References
References
30