Presentation is loading. Please wait.

Presentation is loading. Please wait.

Games of Chance Introduction to Artificial Intelligence COS302 Michael L. Littman Fall 2001.

Similar presentations


Presentation on theme: "Games of Chance Introduction to Artificial Intelligence COS302 Michael L. Littman Fall 2001."— Presentation transcript:

1 Games of Chance Introduction to Artificial Intelligence COS302 Michael L. Littman Fall 2001

2 Administration Rush hour (10/22). Today not part of midterm (10/24), just final.

3 Uncertainty in Search We’ve assumed everything is known: starting state, neighbors, goals, etc. Often need to make decisions even though some things are uncertain. Complicates things…

4 Types of Uncertainty Opponent: What will other player do? MinimaxMinimax Outcome: Which neighbor get? Model via probability distributionModel via probability distribution State: Where are we now? Hidden informationHidden information Transition: What are the rules? Need to use learning to find outNeed to use learning to find out

5 Nim-Rand Pile of sticks. Lose if take last stick.Lose if take last stick. On your turn, take 1 or 2.On your turn, take 1 or 2. Flip a coin. If H, take 1 more.Flip a coin. If H, take 1 more. Which type of uncertainty?

6 Value of a Game Without randomness: maximize your winnings in the worst case. With randomness: maximize your expected winnings in the worst case. Want to do well on average. What games are like this?

7 Nim-Rand Tree (|||)-Xcc (||)-Y (|)-Y(|)-Y()-Y c ()-X()-X()-X (|)-X +1 1 2 +1 1 2 ()-X ()-Y

8 Nim-Rand Values (|||)-Xcc (||)-Y (|)-Y(|)-Y()-Y c ()-X()-X()-X (|)-X +1 1 2 +1 1 2 ()-X ()-Y +1 +1 +1 +1 +1+1 +0 +0 +0.5 +0 +0.5

9 Search Model States, terminal states (G), values for terminal states (V). X states (maximizer), Y states (minimizer), Z states (chance) For all s in Z, for all s’ in N(s) P(s’|s) is the probability of reaching s’ from s.

10 Game Value (no loops) Gameval(s) = { If (G(s)) return V(s) Else if s in X return max s’ in N(s) Gameval(s’) Else if s in Y return min s’ in N(s) Gameval(s’) Else return sum s’ in N(s) P(s’|s) Gameval(s’) }

11 Games with Loops No known poly time algorithm. Approximated by value iteration: For all s, if G(s), L(s) = V(s), else 0 Repeat until changes are small: for all s, L(s) = max, min, avg L(s’), s’ in N(s) depending on s in X, Y, or Z.

12 Hidden Information Games like Poker, 2-player bridge, Scrabble ™, Diplomacy, Stratego Don’t fit game tree model, even when chance nodes included.

13 Pure Strategies X: I : 1=L, 4=L II : 1=L, 4=R III : 1=R, 4=L IV : 1=R, 4=R Y: I : 2=L, 3=R II : 2=M, 3=R III : 2=R, 3=R X-1 +7+3 +5 +4 Y-2 Y-3 X-4 L R L R L M R R

14 Matrix Form Summarizes all decisions in one for each, chosen simultaneously X- I X- II X- III X- IV Y- I 7722 Y- II 3322 Y- III 422

15 Value of Matrix Game X picks column with largest min Y picks row with smallest max X- I X- II X- III X- IV Y- I 7722 Y- II 3322 Y- III 422

16 Minimax Von Neumann proved zero-sum matrix game, minimax=maximin. Given perfect information (no state uncertainty), there exists optimal pure strategy for each player.

17 Game w/ Chance Nodes X-1 +4-20 -5 +3 +10 c Y-3 c L R 0.5 R L 0.8 0.2 Use expected values X- I X- I (L) X- II X- II (R) Y- I Y- I (L)-8 -2 -2 Y- II Y- II (R)-8+3

18 More General Matrices What game tree leads to this matrix? Does von Neumann’s theorem still hold? X- I X- I (L) X- II X- II (R) Y- I Y- I (L)10 Y- II Y- II (R)01

19 Hidden Info. Matrices X picks L or R, keeping the choice hidden from Y. Y makes a choice. X’s choice is revealed and game ends. X- I X- I (L) X- II X- II (R) Y- I Y- I (L)10 Y- II Y- II (R)01

20 Micro Poker X is dealt high or low card, holds/folds. Y folds/sees. High card wins Y can’t see X’s card. c -20 +10-40 +30 +10 X-L X-H Y fold hold 0.5 Y see fold see hold

21 Matrix Form Player X can guarantee itself +1 on average. How? It can even announce its strategy. X- I X- I (fold) X- II X- II (hold) Y- I Y- I (fold)-5+10 Y- II Y- II (see)+5-5

22 Mixed Strategies Pick a number p. X: With prob. p, fold; else hold. Since Y doesn’t know what’s coming, the response will sometimes work, sometimes not.

23 Guess a Probability X announces p=1/3. Y’s pick? X- I X- I (fold) X- II X- II (hold) Y- I Y- I (fold)-5+10 Y- II Y- II (see)+5-5 Fold: +5 See: -1 2/3 see see

24 Guess a Probability X announces p=2/3. Y’s pick? X- I X- I (fold) X- II X- II (hold) Y- I Y- I (fold)-5+10 Y- II Y- II (see)+5-5 Fold: +0 See: +1 2/3 fold fold

25 All Strategies What should X pick for p to maximize its worst case? p=0.6 Payoff +1 see fold p

26 Randomizing Y If Y random, answer is the same. No matter what, X can guarantee itself +1. see fold

27 Bluffing c -20 +10-40 +30 +10 X-L X-H Y fold hold 0.5 Y see fold see hold X: On a low card, bluff with prob. 0.4. Y: On hold, fold with prob. 0.4.

28 Solving 2x2 Game X- I with prob. p X’s expected gain vs. Y- I : m 11 p+m 12 (1-p) vs. Y- II : m 21 p+m 22 (1-p) X- I X- II Y- I m 11 m 12 Y- II m 21 m 22 Maximize the minimum. Try p=0, p=1, where lines meet.

29 Solving General mxn Linear program: p 1,…,p n. p 1 +…+p n = 1, p i  0 Maximize X’s gain, g vs Y- I : m 11 p 1 + … +m n1 p n  g vs Y- II : m 12 p 1 + … +m n2 p n  g … Against all Y strategies.

30 Issues Can we solve poker? More than 2 playersMore than 2 players Not zero sum (collude)Not zero sum (collude) Huge state spaceHuge state space Poker: Opponent modeling Bridge: Use simulation to approximate

31 What to Learn Minimax value in games of chance and the DFS algorithm for computing it. Converting games to matrix form. Solve 2x2 game.

32 Homework 5 (due 11/7) 1.The value iteration algorithm from the Games of Chance lecture can be applied to deterministic games with loops. Argue that it produces the same answer as the “Loopy” algorithm from the Game Tree lecture. 2.Write the matrix form of the game tree below.

33 Game Tree X-1 +2 +4 Y-2 Y-3 X-4 L R L R L R +5 L +2 R


Download ppt "Games of Chance Introduction to Artificial Intelligence COS302 Michael L. Littman Fall 2001."

Similar presentations


Ads by Google