SLIDE 1
ECE 4524 Artificial Intelligence and Engineering Applications - - PowerPoint PPT Presentation
ECE 4524 Artificial Intelligence and Engineering Applications - - PowerPoint PPT Presentation
ECE 4524 Artificial Intelligence and Engineering Applications Meeting 5: Two-Player Games and MiniMax Search Reading: AIAMA 5.1-5.2 Todays Schedule: Formally define games Example games Adversarial search MiniMax algorithm
SLIDE 2
SLIDE 3
Define games and adversarial search
A game is a multi-agent environment where actions are (usually) taken in turns. Agents do not have full control over the environment and so must
◮ take into account contingencies, other agent’s actions ◮ take into account competition, other agent’s goals
This leads to adversarial search.
SLIDE 4
Game Terminology
Lets use tic-tac-toe to help explain the terminology. A game tree is made up of
◮ Initial State ◮ Player(s) ◮ Actions(s) ◮ Results(s,a) ◮ Terminal-Test(s) ◮ Utility(s,p)
SLIDE 5
Game Terminology
Lets use tic-tac-toe to help explain the terminology. A game tree is made up of
◮ Initial State ◮ Player(s) ◮ Actions(s) ◮ Results(s,a) ◮ Terminal-Test(s) ◮ Utility(s,p)
SLIDE 6
Game Terminology
Lets use tic-tac-toe to help explain the terminology. A game tree is made up of
◮ Initial State ◮ Player(s) ◮ Actions(s) ◮ Results(s,a) ◮ Terminal-Test(s) ◮ Utility(s,p)
SLIDE 7
Example NIM
Nim is a simple game that is useful to illustrate game play. Here is the variation we will consider. There three piles of tokens with initially a given number in reach pile. The players take turns removing tokens under the following rules:
◮ Each turn the player must take at least one token, and ◮ You can take multiple tokens, but only from the same pile.
The game is won by the player taking the last tiles (none remain after the turn).
SLIDE 8
Warmup #1
Consider the following initial condition for Nim Pile 1 = 3, Pile 2 = 4, Pile 3 = 5 defined as (3,4,5) What are the states of the game at the next ply depth written as triplets of numbers?
SLIDE 9
Other Examples: Checkers and Chess
SLIDE 10
Game On!
Lets play some Nim to get an idea of strategy. Pick a partner and play a few rounds starting at 3,4,5. Sketch your game tree.
SLIDE 11
Cartoon Example
Consider the following game tree with the utility filled in at the terminal nodes. Assume the max player goes first. What is the rational move to make?
SLIDE 12
Minimax Search
SLIDE 13
Warmup #2
Suppose a Nim game starts with configuration (1,1,1) and that max goes first. Perform minimax search assuming a win for max has utility +1 and -1 if min wins. What is the backed-up minimax value?
SLIDE 14
Exercise
Assuming max goes first, what it the rational action to take?
SLIDE 15
Time limits and real-time decisions
◮ Most games have a time limit and a state space that prohibits
reaching terminal states.
◮ So, we cut-off the search at a specific depth and use a
heuristic, called the evaluation function, to estimate what would be the backed-up value. This is required for many games, e.g. chess.
SLIDE 16
Is there something smarter we can do?
SLIDE 17
Extensions to games of chance
Stochastic games have an element of chance, for example from the roll of a the dice. We can introduce chance-nodes to account for this. The backed-up value is then the Expected Utility.
SLIDE 18
Example: Dice based 21
SLIDE 19
Practical Applications of Adversarial Search
So this is all not just fun-and-games (pun intended).
◮ Game theory is important in many areas, notably economics ◮ It is often useful to model the environment as an adversarial
agent, i.e. contigency plans
◮ Games of chance are good models of Sequential Decision
Problems
SLIDE 20