Title: Study Group Randomized Algorithms
1Study GroupRandomized Algorithms
2Topics Covered
- Game Tree Evaluation
- its expected run time is better than the
worst-case complexity of any deterministic
algorithm - demonstrates a technique to derive a lower bound
on running time of any randomized algorithm for a
problem - Introduction to Game Theory
- leads to the Minimax Principle
3Definition 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 - each leaf is associated with a value
4Example of a Game Tree T2,2
5Observations
- Every root-to-leaf path goes through the same
number of MIN and MAX nodes (including the root) - If the depth of the tree is 2k, there are 22k
4k leaves
6Game Tree Evaluation
- MIN (AND) Node
- returns the lesser of the two children
7Game Tree Evaluation
- MAX (OR) Node
- returns the greater of the two children
8What is the value returned by the root?
9A Deterministic Algorithm
- Depth-first manner
- always visit the left child before the right
child
10A Randomized Algorithm
- Coin toss
- 0.5 probability choosing the left child and 0.5
probability choosing the right child
11Design Rationale
- Suppose AND node were to return 0
- at least one of the leaves is 0
- if deterministic algorithm is used, your opponent
can always hide this 0 and make your algorithm
visit both leaves - if randomized algorithm is used, you foils your
opponents strategy. The expected number of
steps (leaf visits) is 3/2 - Similar for OR node were to return 1
12Design Rationale
- Expected cost
- EAND_0 EOR_1 3/2
- What if AND(OR) node were to return 1(0)?
- both children are 1(0), it seems that the
randomized algorithm doesnt improve much since
we need to visit both children anyway - however, it benefits the parent level
13Analysis of the Randomized Algo.
- Claim
- The expected cost of the randomized algorithm
for evaluating any T2,k game tree is at most 3k - Proof by induction
- consider k 1
- expected cost ? 3
14Analysis of the Randomized Algo.
- Case I root evaluated to 0
- at least one of the subtrees (OR nodes) gives 0
- you have 0.5 probability that this particular
node is checked first - E(T) ½ ? 2 ½ ? (3/2 2)
- 2.75
15Analysis of the Randomized Algo.
- Case II root evaluated to 1
- both subtrees give 1
- E(T) 2 ? 3/2
- 3
- Both cases give ? 3 expected cost, so the claim
is true for k1
16Analysis of the Randomized Algo.
- Assume that for all T2,k-1, the expected cost ?
3k-1 - First, consider the OR-root tree
17Analysis of the Randomized Algo.
- Case I OR-root gives 1
- at least one subtree gives 1
- 0.5 probability we use it first
- E(T) ? ½ ? 3k-1 ½ ? 2 ? 3k-1
- 3/2 ? 3k-1
- Case II OR-root gives 0
- both subtrees give 0
- E(T) ? 2 ? 3k-1
18Analysis of the Randomized Algo.
- Now, consider the AND-root game tree, T2,k
19Analysis of the Randomized Algo.
- Case I AND-root gives 0
- at least one subtree gives 0
- 0.5 probability we use it first
- E(T2,k) ? ½ ? 2 ? 3k-1
- ½ ? (3/2 ? 3k-1 2 ? 3k-1)
- 2.75 ? 3k-1 ? 3k
- Case II AND-root gives 1
- both subtrees give 1
- E(T2,k) ? 2 ? 3/2 ? 3k-1
- 3k
20Analysis of the Randomized Algo.
- Proved the claim
- The expected cost of the randomized algorithm
for evaluating any T2,k game tree is at most 3k - A tree has n 4k leaves, then k log4n.
Substitute log4n for k in the expected cost, then
the cost ? 3log4n. By xlogab blogax, the cost
? nlog43 n0.793
21Question
- Our randomized algorithm for the game tree
evaluation of any uniform binary tree with n
leaves is n0.793. Can we establish that no
randomized algorithm can have a lower expected
running time?
YES! Using Yaos technique ? the Minimax
Theorem ? Game Theory Basics
22Introduction to Game Theory
- Consider the stone-paper-scissors game between 2
players - loser pays 1 to the winner
- payoff matrix M Mij denotes the payoff by the
Column player to the Row player
23Two-person Zero-sum Game
- Zero-sum game
- the net amount won by C and R is exactly zero,
i.e., the amount of money is not increased or
decreased among them - Every two-person zero-sum game can be represented
by a n?m payoff matrix
24Pure Strategy v.s. Mixed Strategy
- Pure (Deterministic) strategy
- always uses the same strategy or a deterministic
pattern, e.g., R always chooses stone while C
always chooses paper - Mixed (Randomized) strategy
- the strategy chosen by a player is randomized,
i.e., a probability distribution among all
possible strategies
25Pure Optimal Strategy
- Zero-information game
- the strategy chosen by the opponent is unknown
- Naturally, the goal of the row (column) player is
to maximize (minimize) the payoff - If R chooses strategy i, then she is guaranteed a
payoff of minjMij, regardless of what Cs
strategy is - Optimal strategy for R is an strategy i that
maximize minjMij.
26Pure Optimal Strategy
- Similarly, the optimal strategy of C is
- If C chooses strategy j, then he is guaranteed a
loss of no more than maxiMij, regardless of what
Rs strategy is - Optimal strategy for C is an strategy j that
minimize maxiMij. - Let Vr maximinjMij and Vc minjmaxiMij be the
lower bound of payoff R can get and the upper
bound of loss C can ensure respectively
27Inequality for All Payoff Matrix
- Minimax Inequality
- maximinjMij ? minjmaxiMij
- Proof
28Saddle-point
- If Vr Vc, we say the game has a solution and
the value of the game is V Vr Vc - the solution is also known as the saddle-point of
the game - If no saddle-point exists, it means there is no
clear-cut pure optimal strategy for any player
29Mixed Strategy Game
- The Row player picks a vector p (p1, , pn),
which is a probability distribution on the rows
of M. (i.e., pi is the probability that R will
choose strategy i) - Similarly, the Column player picks a vector q
(q1, , qm), i.e., qj is the probability that R
will choose strategy j)
30Mixed Optimal Strategy
- Expected Payoff
- Epayoff pT M q
- R aims to maximize it while C aims to minimizes
it - As before, let Vr maxpminq pT M q be the lower
bound of the expected payoff R can get using a
strategy p - Let VC minqmaxp pT M q be the upper bound of
the expected payoff C need to pay using a
strategy q
31von Neumanns Mininmax Theorem
- For any two person, zero-sum game specified by a
matrix M - maxpminqptMq minqmaxppTMq
- the optimal strategy for R will yield the same
payoff as the optimal strategy for C! - if either player uses his optimal strategy, the
opponent cannot improve the payoff