Artificial Intelligence
CS 444 – Spring 2019
- Dr. Kevin Molloy
Department of Computer Science James Madison University
Artificial Intelligence Game Playing Continued Lecture 9 CS 444 - - PowerPoint PPT Presentation
Artificial Intelligence Game Playing Continued Lecture 9 CS 444 Spring 2019 Dr. Kevin Molloy Department of Computer Science James Madison University Outline Moving forward with game playing How to play games of chance Example
CS 444 – Spring 2019
Department of Computer Science James Madison University
Pruning is an example of metareasoning – computing about what to compute This type of pruning does not impact optimality of the decision (but does mean some of the nodes may not have the correct values). Even with perfect ordering, time complexity = O(bm/2) (m is max depth) Chess is still impossible (3550 possibilities) Idea: obtain value of a state (move) without reaching the leaf states
Standard approach:
Chess Example: Suppose we have 100 seconds, explore 104nodes/seconds 106 nodes per move ≈ 35 8/2 !-" reaches depth 8 ⟹ pretty good chess program
For chess, typically linear weighted sum
Eval(s) = w1f1(s) + w2f2(s) + … + wnfn(s) e.g. w1 = 9 with f1(s) (difference in the #
Behavior is preserved under any monotonic transformation of eval. Only order matters.
Chess: Deep blue defeated Gary Kasparov in a six-game match in 1997. The computer searched 200 million positions per second, and was able to extend some search lines up to 40 ply. Go: branching factor is between 250 and 361 (compared to chess at 35). Pattern knowledge is used instead of search trees. AlphaGo, which employs deep learning, is now competing at the world championship
In nondeterministic games, chance is introduced by dice, card-shuffling, etc. Here is a simplified example with coin-flipping:
New type of node in our tree We will call this a chance node.
If state is a Max node then return highest ExpectiMiniMax-Value of Successor(state) Just like MiniMax, except we must also handle chance nodes: If state is a Min node then return lowest ExpectiMiniMax-Value of Successor(state) If state is a chance node then return average ExpectiMiniMax-Value of Successor(state)
Backgammon ≈ 20 legal moves (can be 6,000 in 1-1- roll) Depth 4 = 20 x (21 x 20)3 ≈ 1.2 x 109 Dice rolls increase b: 21 possible distinct rolls with 2 dice. Time complexity: O(bm nm), where n is the number of distinct roll Does it pay to look ahead? As depth increases, probability of reaching a given node shrinks, thus, its value is diminished. Thus, !-" pruning is not as effective. TDGammon uses depth-2 search and good EVAL and plays at the World champion level
Monte Carlo simulation can be used to “evaluate” a state From a start date, have the algorithm play against itself, using random dice rolls Imperfect Information: From a start date, have the algorithm play against itself, using random dice rolls. Ideas for poker? Generate random hands for your opponent and count how many times you win.
Ghost makes the best move 2/3 of the time, but 1/3 of the time makes the worst move. Fill in the blank nodes