NIM - a two person game n objects are in one pile

Slides:



Advertisements
Similar presentations
Alpha-Beta Search. 2 Two-player games The object of a search is to find a path from the starting position to a goal position In a puzzle-type problem,
Advertisements

Adversarial Search We have experience in search where we assume that we are the only intelligent being and we have explicit control over the “world”. Lets.
Adversarial Search Reference: “Artificial Intelligence: A Modern Approach, 3 rd ed” (Russell and Norvig)
ICS-271:Notes 6: 1 Notes 6: Game-Playing ICS 271 Fall 2008.
Lecture 12 Last time: CSPs, backtracking, forward checking Today: Game Playing.
MINIMAX SEARCH AND ALPHA- BETA PRUNING: PLAYER 1 VS. PLAYER 2.
Games CPSC 386 Artificial Intelligence Ellen Walker Hiram College.
Artificial Intelligence in Game Design
State Space 4 Chapter 4 Adversarial Games. Two Flavors Games of Perfect Information ◦Each player knows everything that can be known ◦Chess, Othello Games.
Mahgul Gulzai Moomal Umer Rabail Hafeez
This time: Outline Game playing The minimax algorithm
Min-Max Trees Based on slides by: Rob Powers Ian Gent Yishay Mansour.
1 search CS 331/531 Dr M M Awais A* Examples:. 2 search CS 331/531 Dr M M Awais 8-Puzzle f(N) = g(N) + h(N)
ICS-271:Notes 6: 1 Notes 6: Game-Playing ICS 271 Fall 2006.
HEURISTIC SEARCH. Luger: Artificial Intelligence, 5 th edition. © Pearson Education Limited, 2005 Portion of the state space for tic-tac-toe.
Game Playing: Adversarial Search Chapter 6. Why study games Fun Clear criteria for success Interesting, hard problems which require minimal “initial structure”
1 Adversary Search Ref: Chapter 5. 2 Games & A.I. Easy to measure success Easy to represent states Small number of operators Comparison against humans.
Game Trees: MiniMax strategy, Tree Evaluation, Pruning, Utility evaluation Adapted from slides of Yoonsuck Choe.
Minimax Trees: Utility Evaluation, Tree Evaluation, Pruning CPSC 315 – Programming Studio Spring 2008 Project 2, Lecture 2 Adapted from slides of Yoonsuck.
Game Playing.
Game Playing Chapter 5. Game playing §Search applied to a problem against an adversary l some actions are not under the control of the problem-solver.
Game-playing AIs Part 1 CIS 391 Fall CSE Intro to AI 2 Games: Outline of Unit Part I (this set of slides)  Motivation  Game Trees  Evaluation.
Games. Adversaries Consider the process of reasoning when an adversary is trying to defeat our efforts In game playing situations one searches down the.
Game Playing. Introduction One of the earliest areas in artificial intelligence is game playing. Two-person zero-sum game. Games for which the state space.
Knowledge Search CPTR 314.
Game tree search Chapter 6 (6.1 to 6.3 and 6.6) cover games. 6.6 covers state of the art game players in particular. 6.5 covers games that involve uncertainty.
ARTIFICIAL INTELLIGENCE (CS 461D) Princess Nora University Faculty of Computer & Information Systems.
Artificial Intelligence in Game Design Board Games and the MinMax Algorithm.
Game playing Types of games Deterministic vs. chance
Adversarial Search and Game-Playing
Instructor: Vincent Conitzer
Last time: search strategies
AI Classnotes #5, John Shieh, 2012
Iterative Deepening A*
PENGANTAR INTELIJENSIA BUATAN (64A614)
CS Fall 2016 (Shavlik©), Lecture 11, Week 6
Adversarial Search and Game Playing (Where making good decisions requires respecting your opponent) R&N: Chap. 6.
Heuristic Search A heuristic is a rule for choosing a branch in a state space search that will most likely lead to a problem solution Heuristics are used.
Pengantar Kecerdasan Buatan
Adversarial Search.
Game Playing.
State Space 4 Chapter 4 Adversarial Games.
David Kauchak CS52 – Spring 2016
Game Playing in AI by: Gaurav Phapale 05 IT 6010
Artificial Intelligence
Artificial Intelligence Chapter 12 Adversarial Search
Alpha-Beta Search.
Game Playing: Adversarial Search
Kevin Mason Michael Suggs
Artificial Intelligence
Alpha-Beta Search.
Instructor: Vincent Conitzer
The Alpha-Beta Procedure
Introduction to Artificial Intelligence Lecture 9: Two-Player Games I
Alpha-Beta Search.
Pruned Search Strategies
Minimax strategies, alpha beta pruning
Alpha-Beta Search.
Game Playing: Adversarial Search
CSE (c) S. Tanimoto, 2007 Search 2: AlphaBeta Pruning
Based on slides by: Rob Powers Ian Gent
Game Playing Chapter 5.
Adversarial Search CMPT 420 / CMPG 720.
Alpha-Beta Search.
Minimax strategies, alpha beta pruning
Adversarial Search Game Theory.
CS51A David Kauchak Spring 2019
CS51A David Kauchak Spring 2019
Unit II Game Playing.
Minimax Trees: Utility Evaluation, Tree Evaluation, Pruning
Presentation transcript:

NIM - a two person game n objects are in one pile each player divides a pile into two unequal piles; this continues until no more divisions are possible The loser is the person who cannot make any more legal moves

Let’s Play NIM Start with the 7 objects shown on the previous slide. Devise a winning strategy so that you will win no matter what choices are made by your opponent. Please note that you have the right to select NOT going first

A Minimax approach to NIM We alternate moves between players labeled Min and Max; Max is the player trying to win and Min is the opponent attempting to minimize Max’s score Since we can search clear to leaves, we label wins for Min with 0 and wins for Max with 1; we propogate moves up the tree Max always gets the max of the children Min always gets the min of the children Who can win this game?

Another game of NIM Start with 8 initial objects Draw the complete search space Label the initial node as Max and calculate the values for each state Determine if there is a winning strategy for either player

Using a fixed ply depth Most games are so complex you cannot analyze the entire search space, rather you look a fixed number of plys ahead You start at the leaves and work backwards maximizing or minimizing as appropriate The value at the start node will tell the player which move to take

Minimax for Tic-tac-toe The heuristic attempts to measure the conflict between the two players, namely, the number of winning lines open to max minus the number of lines open to min A forced win for max evaluates to + and a forced win for min to -

The start game The first two plys are shown The choices for max are -1 to the left, -2 in the center, or +1 on the right clearly the right path (mark in the center) is superior

After the first two moves Again we go two plys deep Each leaf state has been evaluated and the values propogated up the tree The best move for max is the lower left corner

Continuing the game O blocks X by marking the upper right corner; every alternative for X loses except to block O by marking the upper left corner Clearly this will be a winning move for X since two squares can produce 3 in a row and O can only block one of them

Another Minimax Search Perform a minimax search on this tree

Alpha-beta pruning As the minimax search proceeds, it is possible to discontinue to search at certain points when no better results are possible We will cover alpha-beta pruning conceptually

A pruned Minimax tree

Practicing alpha beta pruning Perform a minimax search with alpha beta pruning on this tree

Samuel’s Checkers Program The first (1959) significant program involving a two opponent game There was a complex heuristic aixi that summed up the weighted value of various individual values based on piece advantage, piece location, control of center, etc. If the selected move resulted in a loss, the highest weight values were “blamed” and their weights reduced; this, in effect, implemented a simple learning algorithm Since the approach was basically hill climbing, the program was susceptible to being lead into traps

Complexity issues Let B be the average branching factor and L the path length, then the total number of states is T = B + B2 + B3 + … + BL = B (BL - 1) (B - 1) As seen in the graph below, the value of B has a dramatic effect on the overall complexity

Variation in informedness In general, if a heuristic is more informed it will be more complex to compute it will reduce the rule application cost by cutting down the search space Summing up these two conflicting values produces a graph with a minimum that represents the problem solving cost

Think of a Game Think of a game where it is possible to have simple strategies or very complex strategies Assume you have a fixed amount of time before being forced to make a decision Would the most complex strategy be the best strategy? If not, why not?