SlideShare a Scribd company logo
1 of 20
CS 484 – Artificial Intelligence 1
Announcements
• Lab 1 is due today, September 20
• Homework 3 due Tuesday, September 25
• Current Event Volunteer?
Game Playing
Lecture 7
CS 484 – Artificial Intelligence 3
Kinds of Games
• Deterministic
• Turn-taking
• 2-player
• Zero-sum
• Perfect information
CS 484 – Artificial Intelligence 4
Game as Search Problem
• Initial State: board position and player to
move
• Successor Function: returns a list of legal
(move, state) pairs
• Terminal Test: determines when the game
is over
• Utility function: Gives a numeric value for
the terminal state
CS 484 – Artificial Intelligence 5
Game Trees
• Game trees are used to represent two-player
games.
• Alternate moves in the game are represented by
alternate levels in the tree (plies).
• Nodes in the tree represent positions.
• Edges between nodes represent moves.
• Leaf nodes represent won, lost or drawn positions.
CS 484 – Artificial Intelligence 6
Game Trees
This is an example of a
partial game tree for the
game tic-tac-toe.
Even for this simple game,
the game tree is very large.
CS 484 – Artificial Intelligence 7
Assumptions
• In talking about game playing systems, we
make a number of assumptions:
• The opponent is rational – will play to win.
• The game is zero-sum – if one player wins, the
other loses.
• Usually, the two players have complete
knowledge of the game. For games such as
poker, this is clearly not true.
CS 484 – Artificial Intelligence 8
Minimax
• Minimax is a method used to evaluate game
trees.
• A static evaluator is applied to leaf nodes,
and values are passed back up the tree to
determine the best score the computer can
obtain against a rational opponent.
CS 484 – Artificial Intelligence 9
Minimax – Animated Example
5 1 3 6 2
2 7
0
Max
Min
Max
5
5
6
7
0
6
6
3
3
3
1
The computer can
obtain 6 by
choosing the right
hand edge from the
first node.
CS 484 – Artificial Intelligence 10
Minimax Function
• MINIMAX-VALUE(n) =
• UTILITY(n)
if n is a terminal state
• maxs  Successors(n) MINIMAX-VALUE(s) if
n is a MAX node
• mins  Successors(n) MINIMAX-VALUE(s)
if n is a MIN node
CS 484 – Artificial Intelligence 11
Searching Game Trees
• Exhaustively searching a game tree is not usually
a good idea.
• Even for a game as simple as tic-tac-toe there are
over 350,000 nodes in the complete game tree.
• An additional problem is that the computer only
gets to choose every other path through the tree –
the opponent chooses the others.
CS 484 – Artificial Intelligence 12
Alpha-beta Pruning
• A method that can often cut off a half the
game tree.
• Based on the idea that if a move is clearly
bad, there is no need to follow the
consequences of it.
• alpha – highest value we have found so far
• beta – lowest value we have found so far
CS 484 – Artificial Intelligence 13
Alpha-beta Pruning –
Example.
• In this tree,
having examined
the nodes with
values 7 and 1
there is no need
to examine the
final node.
3
max
min
CS 484 – Artificial Intelligence 14
Bounded Lookahead
• For trees with high depth or very high branching
factor, minimax cannot be applied to the entire
tree.
• In such cases, bounded lookahead is applied:
• search is cut off at specified depth
• static evaluator applied.
• Horizon effect
CS 484 – Artificial Intelligence 15
Static Evaluation Functions
• A static evaluator assigns a score to a position:
• High positive = computer is winning
• Zero = even game
• High negative = opponent is winning
• It is most important that a static evaluator will give
a better score to a better position – the actual
values are not so important.
CS 484 – Artificial Intelligence 16
Creating Evaluation Function
• How likely are you to win from a given
position?
• Usually weighted linear functions
• Different scores are given to different position
and added together in a weighted fashion
• Possible chess function
• score = 9q + 5r + 3b + 3n + p
• q = # of queens, r = # of rooks, b = # of bishops,
n = # of knights, and p = # of pawns
CS 484 – Artificial Intelligence 17
Checkers
• In 1959, Arthur Samuel creates a computer
program that could play checkers to a high level
using minimax and alpha-beta pruning.
• Chinook, developed in Canada defeated the world
champion:
• Uses alpha-beta pruning.
• Has a database of millions of end games.
• Also has a database of openings.
• Uses heuristics and knowledge about the game.
CS 484 – Artificial Intelligence 18
Chess
• In 1997, Deep Blue defeated world champion,
Garry Kasparov.
• This has not yet been repeated.
• Current systems use parallel search, alpha-beta
pruning, databases of openings and heuristics.
• The deeper in a search tree the computer can
search, the better it plays.
CS 484 – Artificial Intelligence 19
Go
• Go is a complex game played on a 19x19 board.
• Average branching factor in search tree around
360 (compared to 38 for chess).
• The best computer programs cannot compete yet
with the best human players.
• Methods use pattern matching or selective search
to explore the most appropriate parts of the search
tree.
CS 484 – Artificial Intelligence 20
Games of Chance
• The methods described so far do not work
well with games of chance such as poker or
backgammon.
• Expectiminimax is a variant of minimax
designed to deal with chance.
• Nodes have expected values based on
probabilities.

More Related Content

Similar to 484-7.ppt

AI3391 Artificial intelligence Session 15 Min Max Algorithm.pptx
AI3391 Artificial intelligence Session 15  Min Max Algorithm.pptxAI3391 Artificial intelligence Session 15  Min Max Algorithm.pptx
AI3391 Artificial intelligence Session 15 Min Max Algorithm.pptxAsst.prof M.Gokilavani
 
AI3391 Artificial Intelligence Session 18 Monto carlo search tree.pptx
AI3391 Artificial Intelligence Session 18 Monto carlo search tree.pptxAI3391 Artificial Intelligence Session 18 Monto carlo search tree.pptx
AI3391 Artificial Intelligence Session 18 Monto carlo search tree.pptxAsst.prof M.Gokilavani
 
AI3391 Artificial Intelligence UNIT III Notes_merged.pdf
AI3391 Artificial Intelligence UNIT III Notes_merged.pdfAI3391 Artificial Intelligence UNIT III Notes_merged.pdf
AI3391 Artificial Intelligence UNIT III Notes_merged.pdfAsst.prof M.Gokilavani
 
chess-algorithms-theory-and-practice_ver2017.pdf
chess-algorithms-theory-and-practice_ver2017.pdfchess-algorithms-theory-and-practice_ver2017.pdf
chess-algorithms-theory-and-practice_ver2017.pdfrajdipdas12
 
games, infosec, privacy, adversaries .ppt
games, infosec, privacy, adversaries .pptgames, infosec, privacy, adversaries .ppt
games, infosec, privacy, adversaries .pptMuhammadAbdullah311866
 
CptS 440/ 540 AI.pptx
CptS 440/ 540 AI.pptxCptS 440/ 540 AI.pptx
CptS 440/ 540 AI.pptxDrDejaVu2
 
It is an artificial document, please. regarding Ai topics
It is an artificial document, please. regarding Ai topicsIt is an artificial document, please. regarding Ai topics
It is an artificial document, please. regarding Ai topicschougulesup79
 
AI subject - Game Theory and cps ppt pptx
AI subject  - Game Theory and cps ppt pptxAI subject  - Game Theory and cps ppt pptx
AI subject - Game Theory and cps ppt pptxnizmishaik1
 
AI3391 Artificial Intelligence Session 14 Adversarial Search .pptx
AI3391 Artificial Intelligence Session 14 Adversarial Search .pptxAI3391 Artificial Intelligence Session 14 Adversarial Search .pptx
AI3391 Artificial Intelligence Session 14 Adversarial Search .pptxAsst.prof M.Gokilavani
 
Adversarial search
Adversarial searchAdversarial search
Adversarial searchDheerendra k
 
Game playing (tic tac-toe), andor graph
Game playing (tic tac-toe), andor graphGame playing (tic tac-toe), andor graph
Game playing (tic tac-toe), andor graphSyed Zaid Irshad
 

Similar to 484-7.ppt (20)

Games.4
Games.4Games.4
Games.4
 
AI3391 Artificial intelligence Session 15 Min Max Algorithm.pptx
AI3391 Artificial intelligence Session 15  Min Max Algorithm.pptxAI3391 Artificial intelligence Session 15  Min Max Algorithm.pptx
AI3391 Artificial intelligence Session 15 Min Max Algorithm.pptx
 
AI3391 Artificial Intelligence Session 18 Monto carlo search tree.pptx
AI3391 Artificial Intelligence Session 18 Monto carlo search tree.pptxAI3391 Artificial Intelligence Session 18 Monto carlo search tree.pptx
AI3391 Artificial Intelligence Session 18 Monto carlo search tree.pptx
 
AI3391 Artificial Intelligence UNIT III Notes_merged.pdf
AI3391 Artificial Intelligence UNIT III Notes_merged.pdfAI3391 Artificial Intelligence UNIT III Notes_merged.pdf
AI3391 Artificial Intelligence UNIT III Notes_merged.pdf
 
chess-algorithms-theory-and-practice_ver2017.pdf
chess-algorithms-theory-and-practice_ver2017.pdfchess-algorithms-theory-and-practice_ver2017.pdf
chess-algorithms-theory-and-practice_ver2017.pdf
 
games, infosec, privacy, adversaries .ppt
games, infosec, privacy, adversaries .pptgames, infosec, privacy, adversaries .ppt
games, infosec, privacy, adversaries .ppt
 
M6 game
M6 gameM6 game
M6 game
 
l3.pptx
l3.pptxl3.pptx
l3.pptx
 
CptS 440/ 540 AI.pptx
CptS 440/ 540 AI.pptxCptS 440/ 540 AI.pptx
CptS 440/ 540 AI.pptx
 
Game playing.ppt
Game playing.pptGame playing.ppt
Game playing.ppt
 
It is an artificial document, please. regarding Ai topics
It is an artificial document, please. regarding Ai topicsIt is an artificial document, please. regarding Ai topics
It is an artificial document, please. regarding Ai topics
 
Capgemini 1
Capgemini 1Capgemini 1
Capgemini 1
 
Computer Chess 2004
Computer Chess 2004Computer Chess 2004
Computer Chess 2004
 
AI subject - Game Theory and cps ppt pptx
AI subject  - Game Theory and cps ppt pptxAI subject  - Game Theory and cps ppt pptx
AI subject - Game Theory and cps ppt pptx
 
AI Lecture 5 (game playing)
AI Lecture 5 (game playing)AI Lecture 5 (game playing)
AI Lecture 5 (game playing)
 
AI3391 Artificial Intelligence Session 14 Adversarial Search .pptx
AI3391 Artificial Intelligence Session 14 Adversarial Search .pptxAI3391 Artificial Intelligence Session 14 Adversarial Search .pptx
AI3391 Artificial Intelligence Session 14 Adversarial Search .pptx
 
Two player games
Two player gamesTwo player games
Two player games
 
adversial search.pptx
adversial search.pptxadversial search.pptx
adversial search.pptx
 
Adversarial search
Adversarial searchAdversarial search
Adversarial search
 
Game playing (tic tac-toe), andor graph
Game playing (tic tac-toe), andor graphGame playing (tic tac-toe), andor graph
Game playing (tic tac-toe), andor graph
 

Recently uploaded

How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceanilsa9823
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 

Recently uploaded (20)

How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 

484-7.ppt

  • 1. CS 484 – Artificial Intelligence 1 Announcements • Lab 1 is due today, September 20 • Homework 3 due Tuesday, September 25 • Current Event Volunteer?
  • 3. CS 484 – Artificial Intelligence 3 Kinds of Games • Deterministic • Turn-taking • 2-player • Zero-sum • Perfect information
  • 4. CS 484 – Artificial Intelligence 4 Game as Search Problem • Initial State: board position and player to move • Successor Function: returns a list of legal (move, state) pairs • Terminal Test: determines when the game is over • Utility function: Gives a numeric value for the terminal state
  • 5. CS 484 – Artificial Intelligence 5 Game Trees • Game trees are used to represent two-player games. • Alternate moves in the game are represented by alternate levels in the tree (plies). • Nodes in the tree represent positions. • Edges between nodes represent moves. • Leaf nodes represent won, lost or drawn positions.
  • 6. CS 484 – Artificial Intelligence 6 Game Trees This is an example of a partial game tree for the game tic-tac-toe. Even for this simple game, the game tree is very large.
  • 7. CS 484 – Artificial Intelligence 7 Assumptions • In talking about game playing systems, we make a number of assumptions: • The opponent is rational – will play to win. • The game is zero-sum – if one player wins, the other loses. • Usually, the two players have complete knowledge of the game. For games such as poker, this is clearly not true.
  • 8. CS 484 – Artificial Intelligence 8 Minimax • Minimax is a method used to evaluate game trees. • A static evaluator is applied to leaf nodes, and values are passed back up the tree to determine the best score the computer can obtain against a rational opponent.
  • 9. CS 484 – Artificial Intelligence 9 Minimax – Animated Example 5 1 3 6 2 2 7 0 Max Min Max 5 5 6 7 0 6 6 3 3 3 1 The computer can obtain 6 by choosing the right hand edge from the first node.
  • 10. CS 484 – Artificial Intelligence 10 Minimax Function • MINIMAX-VALUE(n) = • UTILITY(n) if n is a terminal state • maxs  Successors(n) MINIMAX-VALUE(s) if n is a MAX node • mins  Successors(n) MINIMAX-VALUE(s) if n is a MIN node
  • 11. CS 484 – Artificial Intelligence 11 Searching Game Trees • Exhaustively searching a game tree is not usually a good idea. • Even for a game as simple as tic-tac-toe there are over 350,000 nodes in the complete game tree. • An additional problem is that the computer only gets to choose every other path through the tree – the opponent chooses the others.
  • 12. CS 484 – Artificial Intelligence 12 Alpha-beta Pruning • A method that can often cut off a half the game tree. • Based on the idea that if a move is clearly bad, there is no need to follow the consequences of it. • alpha – highest value we have found so far • beta – lowest value we have found so far
  • 13. CS 484 – Artificial Intelligence 13 Alpha-beta Pruning – Example. • In this tree, having examined the nodes with values 7 and 1 there is no need to examine the final node. 3 max min
  • 14. CS 484 – Artificial Intelligence 14 Bounded Lookahead • For trees with high depth or very high branching factor, minimax cannot be applied to the entire tree. • In such cases, bounded lookahead is applied: • search is cut off at specified depth • static evaluator applied. • Horizon effect
  • 15. CS 484 – Artificial Intelligence 15 Static Evaluation Functions • A static evaluator assigns a score to a position: • High positive = computer is winning • Zero = even game • High negative = opponent is winning • It is most important that a static evaluator will give a better score to a better position – the actual values are not so important.
  • 16. CS 484 – Artificial Intelligence 16 Creating Evaluation Function • How likely are you to win from a given position? • Usually weighted linear functions • Different scores are given to different position and added together in a weighted fashion • Possible chess function • score = 9q + 5r + 3b + 3n + p • q = # of queens, r = # of rooks, b = # of bishops, n = # of knights, and p = # of pawns
  • 17. CS 484 – Artificial Intelligence 17 Checkers • In 1959, Arthur Samuel creates a computer program that could play checkers to a high level using minimax and alpha-beta pruning. • Chinook, developed in Canada defeated the world champion: • Uses alpha-beta pruning. • Has a database of millions of end games. • Also has a database of openings. • Uses heuristics and knowledge about the game.
  • 18. CS 484 – Artificial Intelligence 18 Chess • In 1997, Deep Blue defeated world champion, Garry Kasparov. • This has not yet been repeated. • Current systems use parallel search, alpha-beta pruning, databases of openings and heuristics. • The deeper in a search tree the computer can search, the better it plays.
  • 19. CS 484 – Artificial Intelligence 19 Go • Go is a complex game played on a 19x19 board. • Average branching factor in search tree around 360 (compared to 38 for chess). • The best computer programs cannot compete yet with the best human players. • Methods use pattern matching or selective search to explore the most appropriate parts of the search tree.
  • 20. CS 484 – Artificial Intelligence 20 Games of Chance • The methods described so far do not work well with games of chance such as poker or backgammon. • Expectiminimax is a variant of minimax designed to deal with chance. • Nodes have expected values based on probabilities.