440 likes | 594 Views
CSC3160: Design and Analysis of Algorithms. Week 9 : Algorithmic issues in games. Instructor: Shengyu Zhang. Starting from examples…. First example: Prisoner’s dilemma . Two prisoners are on trial for a crime, each can either confess or remain silent.
E N D
CSC3160: Design and Analysis of Algorithms Week 9: Algorithmic issues in games Instructor: Shengyu Zhang
First example: Prisoner’s dilemma • Two prisoners are on trial for a crime, each can either confess or remain silent. • If both silent: both serve 2 years. • If only one confesses: he serves 1 year and the other serves 5 years. • If both confess: both serve 4 years. • Matrix: loss function • What would you do if you are Prisoner Blue? Red?
Example 1: Prisoner’s dilemma • By a case-by-case analysis, we found that both Prisoners would confess, regardless of what the other chooses. • Embarrassingly, they could have both chosen “Silent” to serve less years. • But people are selfish: They only care about their own payoff. • Resulting a dilemma: You pay two more years for being selfish.
Example 2: ISP routing game • Two ISPs. • The two networks can exchange traffic via points and . • Two flows from to . • Each edge costs 1. • Each ISP has choice to going via C or S.
Example 3: Pollution game • countries • Each country faces the choice of either controlling pollution or not. • Pollution control costs 3 for each country. • Each country that pollutes adds 1 to the cost of all countries. • What would you do if you are one of those countries? • Suppose countries don’t control. • For them: cost = • For others: cost =
Example 4: Battle of the sexes • A boy and a girl want to decide whether to watch a action or romantic movie. • The boy prefers action and the girl prefers romantic. • But they both like to spend the time together rather than separately. • What would you do?
Our Example: Coin guessing • Let’s play a game • I’ve a coin at my hand, $1 or $5. • You guess which is the case. • If you are right, you get it. • Otherwise you don’t get it.
Our Example: Coin guessing • I want to lose less. • You want to gain more. • How should I do?
A notion of being stable • In all previous games: • There are a number of players • Each has a set of strategies to choose from • Each aims to maximize his/her payoff, or minimize his/her loss. • Some combination of strategies is stable: No player wants to change his/her current strategy, provided that others don’t change. --- Nash Equilibrium.
Prisoners’ dilemma • ISP routing
Prisoners’ dilemma • ISP routing • Pollution game: All countries don’t control the pollution. • Battle of sexes: both are stable.
Formally • A game has players. • Each player has a set of strategies. • Let • : a joint strategy • :strategies by players other than
Each player has a payoff function • It depends on joint strategy , which includes all players’ strategies. • When (two players only), the 2 payoff functions are usually written in a matrix • Each entry has two numbers, giving the two payoff values for the joint strategy.
(Pure) Nash Equilibrium: joint strategy s.t. • In other words, • If all other players don’t change their strategies , player has no incentive to change her strategy either. • achieves .
Example 5: Penny matching. • Two players, each can exhibit one bit. • If the two bits match, then red player wins and gets payoff 1. • Otherwise, the blue player wins and gets payoff 1. • Find a pure NE? • Conclusion: There may not exist Nash Equilibrium in a game.
Our Example: Coin guessing • I want to lose less. • You want to gain more. • Any pure NE?
Mixed strategies • Consider the case that players pick their strategies randomly. • Player picks according to a distribution . • Then the joint strategy is distributed according to distribution . • . • Notation : draw from .
Mixed strategies • Care about: the expected payoff • Mixed Nash Equilibrium: A distribution s.t., ∀ different from only at • and same at other distributions . • i.e. , .
Existence of mixed NE: Penny Matching • A mixed NE: Both players take uniform distribution. • What’s the expected payoff for each player? • ½.
Our Example: coin guessing • Suppose I put $1 w/p . • You guess $1 w/p . • My expected loss is • If I take and you take , then my loss . • Can I lose less? • Can you gain more?
Existence of mixed NE • Nash, 1951: All games (with finite players and finite strategies for each player) have mixed NE.
3 strategies • How about Rock-Paper-Scissors? • Winner gets payoff and loser gets . • Both get in case of a tie. • Write down the payoff matrix? • Does it have a pure NE? • Find a mixed NE.
Example 6: Traffic light • Two cars are at an interaction at the same time. • If both cross, then a bad traffic accident. So payoff for each. • If only one crosses, (s)he gets payoff ; the other gets . • If both stop, both get .
Example 6: Traffic light • pure NE: one crosses and one stops. • Payoff or • Bad: not fair • (more) mixed NE: both cross w.p. . • Good: Fair • Bad: Low payoff: both • Worse: Positive chance of crash • Correlated equilibrium: randomly pick one and suggest to cross, the other one to stop.
Correlated Equilibrium • Recall that a mixed NE is a probability distribution . • A general distribution may not be decomposed into such product form. • Example: a public coin. • In other words, random variables may be correlated. • About correlation vs. causality.
Correlated Equilibrium • A general distribution on is a correlated equilibrium (CE) if drawn from , each player doesn’t want to change his/her strategy to any other . • You can also think of it as an extra partydrawing from and recommending player take strategy . Then player doesn’t want to change to take any other .
Formally, • Conditional expectation: drawn from conditioned on . • Conditional distribution: . • Or equivalently,
Example 6: Traffic light Correlated Equilibrium Payoff Matrix
Why algorithmic issues? • What if we have a large number of strategies? • Or large number of players?
Complexity of NE and CE • Given the utility functions, how hard is it to find one NE? • No polynomial time algorithm is known to find a NE. • But, there are polynomial-time algorithms for finding a correlated equilibrium.
is given • are variables/unknowns. • Constraints: , • Observation: all constraints are linear! • So we just want to find a feasible solution to a set of linear constraints. • --- linear programming.
We can actually find a solution to maximize a linear function of variables , such as the expected total payoff. • max s.t.,.
Cake cutting • Problem setting: • One cake, people(who want to split it). • Each person might value different portions of the cake differently. • Some like strawberries, some like chocolate, … • This valuation info is private. • Goal: divide the cake to make all people happy.
Cake cutting • A cake cutting protocol is fair if each person gets fraction by her measure. • No matter how other people behave. • A cake cutting protocol is envy-freeif each person thinks that she gets the most by her measure. • Envy-free fair. (See why?)
1. Alice cuts the cake into two equal pieces • by her measure • 2. Bob chooses a larger piece • by his measure • 3. Alice takes the other piece
envy-free • [Thm] The protocol is envy-free (and fair). • Proof. • Alice: gets exactly half, no matter which piece Bob chooses. • Bob: gets at least half, no matter how Alice cuts the cake.
General ? • Recursion. • Suppose that the people are . • 1. Let divide the cake. • How? Recursively. • 2. Now comes. • Each of divides her share into equal pieces. • takes a largest piece from each of . • Let’s try on board.
Fairness • [Thm] The protocol is fair. • Proof. • For : each gets . • : gets • ’s value of ’s share in Step 1. • Complexity? Let be the number of pieces. • recursion: • Try a few examples for small to convince yourself. • , and for general .
Moving Knife protocol • Dubins-Spanier, 1961 • Continuously move a knife from left to right. • 1. A player yells out "STOP" as soon as knife has passed over of the cake • by her measure. • 2. The player that yelled out is assigned that piece. (And she is out of the game; .) • break tie arbitrarily • 3. The procedure continues until all get a piece.
Fairness and complexity • [Thm] The protocol is fair. • Proof. • For the first who yells out: she gets . • For the rest: they have at least fraction to be divided among people. • Recursively: the next gets at least . • Complexity? • Only cuts into pieces.
Summary • Game theory. • Nash equilibrium. • Correlated equilibrium. • Computational complexity of finding a • Nash equilibrium • Correlated equilibrium • Fair division • Fair and envy-free cake cutting. • Algorithms for players.