SlideShare a Scribd company logo
Game Playing in Artificial Intelligence
1. Games are fun
2. They have well-defined rules
3. They provide advanced, existing test-beds for developing
several ideas.
4. It’s a good reasoning problem, formal and nontrivial.
5. Direct comparison with humans and other computer
programs is easy
Artificial Intelligence - CMT310 2
1. Sequence of moves to play
2. Rules that specify possible moves
3. Rules that specify a payment for each move
4. Objective is to maximize your payment
02.02.16Artificial Intelligence 3
4
 Unpredictable opponent  specifying a move
for every possible opponent reply
 Time limits  unlikely to find goal, must
approximate
5
Opponent’s Move
Generate New Position
Generate Successors
Game
Over?
Evaluate Successors
Move to Highest-Valued Successor
Game
Over?
no
no yes
yes
Two-Player Game
23-Mar-2009Artificial Intelligence - CMT310 6
 The term "game" means a sort of conflict in which n individuals or groups
(known as players) participate.
 A list of "rules" stipulates the conditions under which the game begins.
 A game is said to have "perfect information" if all moves are known to each of
the players involved.
 A "strategy" is a list of the optimal choices for each player at every stage of a
given game.
 A "move" is the way in which game progresses from one stage to
another, beginning with an initial state of the game to the final state. The total
number of moves constitute the completeness of the game.
 The payoff or outcome, refers to what happens at the end of a game.
 Minimax - good outcomes.
 Maximin - bad outcomes.
 The primary game theory is the Mini-Max Theorem says:
"If a Minimax of one player corresponds to a Maximin of the other
player, then that outcome is the best both players can hope for."
 Two players: A and B
 A moves first and they take turns until the game is over.
Winner gets award, loser gets penalty.
 Games as search:
◦ Initial state: e.g. board configuration of chess
◦ Successor function: list of (move, state) pairs specifying
legal moves.
◦ Terminal test: Is the game finished?
◦ Utility function: Gives numerical value of terminal states.
E.g. win (+1), lose (-1) and draw (0)
 A uses search tree to determine next move.
23-Mar-2009Artificial Intelligence - CMT310 8
23-Mar-2009Artificial Intelligence - CMT310 9
 MiniMax rule: Decision Making in Multi-agent Systems
 Perfect play for deterministic, perfect-information games.
• Idea: make the move for player MAX which has the most
benefit assuming that MIN makes the best move for MIN
in response
• This is computed by a recursive process
• The backed-up value of each node in the tree is
determined by the values of its children
• For a MAX node, the backed-up value is the
maximum of the values of its children (i.e. the best
for MAX)
• For a MIN node, the backed-up value is the minimum
of the values of its children (i.e. the best for MIN)
10
The computer is Max.
The opponent is Min.
At the leaf nodes, the
utility function
is employed. Big value
means good, small is bad.
computer’s
turn
opponent’s
turn
computer’s
turn
opponent’s
turn
leaf nodes
are evaluated
11
 utility function: the function applied to leaf
nodes
 backed-up value
◦ of a max-position: the value of its largest successor
◦ of a min-position: the value of its smallest successor
 minimax procedure: search down several
levels; at the bottom level apply the utility
function, back-up values all the way up to the
root node, and that node selects the move.
23-Mar-2009Artificial Intelligence - CMT310 12
Consider a 2-ply (two step) game:
Max want’s largest outcome --- Min want’s smallest.
1. Start with the current position as a MAX node.
2. Expand the game tree a fixed number of ply (half-moves).
3. Apply the evaluation function to the leaf positions.
4. Calculate back-up up values bottom-up.
5. Pick the move which was chosen to give the MAX value at the root.
13
 Complete? Yes (if tree is finite)
 Optimal? Yes (against an optimal opponent)
 Time complexity? O(bm)
 Space complexity? O(bm) (depth-first exploration)
23-Mar-2009Artificial Intelligence - CMT310 14
 Eliminating a branch without consideration is called
pruning
◦ Want to visit as many board states as possible (Can be used for entire
search or cutoff search)
 Want to avoid whole branches (prune them)
 Because they can’t possibly lead to a good score
 A way to improve the performance of the Minimax Procedure
 Basic idea: “If you have an idea which is surely bad, don’t take the
time to see how truly awful it is”
23-Mar-2009Artificial Intelligence - CMT310 15
2 7 1
=2
>=2
<=1
?
• We don’t need to compute the
value at this node.
23-Mar-2009Artificial Intelligence - CMT310 16
 3MAX
MIN =3
3 12 8 2
X X
 2
14
 14
5
 5
2
=2
=3
 Traverse the search tree in depth-first order
 For each MAX node n, α(n)=maximum child value found
so far
◦ Starts with –
◦ Increases if a child returns a value greater than the current
α(n)
◦ Lower-bound on the final value
 For each MIN node n, β(n)=minimum child value found
so far
◦ Starts with +
◦ Decreases if a child returns a value less than the current
β(n)
◦ Upper-bound on the final value
 MAX cutoff rule: At a MAX node n, cut off search if
α(n)>=β(n)
 MIN cutoff rule: At a MIN node n, cut off search if
β(n)<=α(n)
23-Mar-2009Artificial Intelligence - CMT310 17
23-Mar-2009Artificial Intelligence - CMT310 18
function ALPHA-BETA-SEARCH(state) returns an action
inputs: state, current state in game
vMAX-VALUE(state, - ∞ , +∞)
return the action in SUCCESSORS(state) with value v
function MAX-VALUE(state, , ) returns a utility value
if TERMINAL-TEST(state) then return UTILITY(state)
v  - ∞
for a,s in SUCCESSORS(state) do
v  MAX(v,MIN-VALUE(s,  , ))
if v ≥  then return v
  MAX( ,v)
return v
23-Mar-2009Artificial Intelligence - CMT310 19
function MIN-VALUE(state,  , ) returns a utility value
if TERMINAL-TEST(state) then return UTILITY(state)
v  + ∞
for a,s in SUCCESSORS(state) do
v  MIN(v,MAX-VALUE(s,  , ))
if v ≤  then return v
  MIN( ,v)
return v
 Properties
 Pruning does not affect final
result

 Good move ordering improves
effectiveness of pruning

 With "perfect ordering," time
complexity = O(bm/2)
 doubles depth of search
 A simple example of the value
of reasoning about which
computations are relevant (a
form of metareasoning)

 Effectiveness
 Guaranteed to compute same
root value as Minimax
 Worst case: no pruning, same
as Minimax (O(bd))
 Best case: when each player’s
best move is the first option
examined, you examine only
O(bd/2) nodes, allowing you
to search twice as deep!
 For Deep Blue, alpha-beta
pruning reduced the average
branching factor from 35-40
to 6.
23-Mar-2009Artificial Intelligence - CMT310 20
23-Mar-2009Artificial Intelligence - CMT310 21
APPLICATIONS
 Training Simulators
 Military simulations
 Management simulations
 Economic simulations
 Education
 Entertainment
 Virtual Environments
Movies

More Related Content

What's hot

Minimax
MinimaxMinimax
Minimax
sabairshad4
 
Adversarial Search
Adversarial SearchAdversarial Search
Adversarial Search
Megha Sharma
 
Adversarial search
Adversarial searchAdversarial search
Adversarial search
Shiwani Gupta
 
The Ring programming language version 1.7 book - Part 74 of 196
The Ring programming language version 1.7 book - Part 74 of 196The Ring programming language version 1.7 book - Part 74 of 196
The Ring programming language version 1.7 book - Part 74 of 196
Mahmoud Samir Fayed
 
Game playing
Game playingGame playing
Game playing
NivethaS35
 
The Ring programming language version 1.4.1 book - Part 19 of 31
The Ring programming language version 1.4.1 book - Part 19 of 31The Ring programming language version 1.4.1 book - Part 19 of 31
The Ring programming language version 1.4.1 book - Part 19 of 31
Mahmoud Samir Fayed
 
The Ring programming language version 1.8 book - Part 76 of 202
The Ring programming language version 1.8 book - Part 76 of 202The Ring programming language version 1.8 book - Part 76 of 202
The Ring programming language version 1.8 book - Part 76 of 202
Mahmoud Samir Fayed
 
2018 06-19 paris cybersecurity meetup
2018 06-19 paris cybersecurity meetup2018 06-19 paris cybersecurity meetup
2018 06-19 paris cybersecurity meetup
Raphaël Laffitte
 
Learning to Play Complex Games
Learning to Play Complex GamesLearning to Play Complex Games
Learning to Play Complex Gamesbutest
 
Support Vector Machine Derivative
Support Vector Machine DerivativeSupport Vector Machine Derivative
Support Vector Machine Derivative
Saif Ali Kheraj
 
Computational Linguistics week 10
 Computational Linguistics week 10 Computational Linguistics week 10
Computational Linguistics week 10
Mark Chang
 
adders/subtractors, multiplexers, intro to ISA
adders/subtractors, multiplexers, intro to ISAadders/subtractors, multiplexers, intro to ISA
adders/subtractors, multiplexers, intro to ISA
i i
 
The Ring programming language version 1.9 book - Part 80 of 210
The Ring programming language version 1.9 book - Part 80 of 210The Ring programming language version 1.9 book - Part 80 of 210
The Ring programming language version 1.9 book - Part 80 of 210
Mahmoud Samir Fayed
 
Softmax
SoftmaxSoftmax
NTU ML TENSORFLOW
NTU ML TENSORFLOWNTU ML TENSORFLOW
NTU ML TENSORFLOW
Mark Chang
 
The Ring programming language version 1.3 book - Part 52 of 88
The Ring programming language version 1.3 book - Part 52 of 88The Ring programming language version 1.3 book - Part 52 of 88
The Ring programming language version 1.3 book - Part 52 of 88
Mahmoud Samir Fayed
 
Modelling and implementation of 9tka game with MaxN algorithm
Modelling and implementation of 9tka game with MaxN algorithmModelling and implementation of 9tka game with MaxN algorithm
Modelling and implementation of 9tka game with MaxN algorithm
TELKOMNIKA JOURNAL
 
The Ring programming language version 1.9 book - Part 60 of 210
The Ring programming language version 1.9 book - Part 60 of 210The Ring programming language version 1.9 book - Part 60 of 210
The Ring programming language version 1.9 book - Part 60 of 210
Mahmoud Samir Fayed
 

What's hot (20)

Minimax
MinimaxMinimax
Minimax
 
Adversarial Search
Adversarial SearchAdversarial Search
Adversarial Search
 
Adversarial search
Adversarial searchAdversarial search
Adversarial search
 
The Ring programming language version 1.7 book - Part 74 of 196
The Ring programming language version 1.7 book - Part 74 of 196The Ring programming language version 1.7 book - Part 74 of 196
The Ring programming language version 1.7 book - Part 74 of 196
 
Game playing
Game playingGame playing
Game playing
 
The Ring programming language version 1.4.1 book - Part 19 of 31
The Ring programming language version 1.4.1 book - Part 19 of 31The Ring programming language version 1.4.1 book - Part 19 of 31
The Ring programming language version 1.4.1 book - Part 19 of 31
 
The Ring programming language version 1.8 book - Part 76 of 202
The Ring programming language version 1.8 book - Part 76 of 202The Ring programming language version 1.8 book - Part 76 of 202
The Ring programming language version 1.8 book - Part 76 of 202
 
2018 06-19 paris cybersecurity meetup
2018 06-19 paris cybersecurity meetup2018 06-19 paris cybersecurity meetup
2018 06-19 paris cybersecurity meetup
 
Game theory
Game theoryGame theory
Game theory
 
Learning to Play Complex Games
Learning to Play Complex GamesLearning to Play Complex Games
Learning to Play Complex Games
 
3D Space Shooting Game
3D Space Shooting Game3D Space Shooting Game
3D Space Shooting Game
 
Support Vector Machine Derivative
Support Vector Machine DerivativeSupport Vector Machine Derivative
Support Vector Machine Derivative
 
Computational Linguistics week 10
 Computational Linguistics week 10 Computational Linguistics week 10
Computational Linguistics week 10
 
adders/subtractors, multiplexers, intro to ISA
adders/subtractors, multiplexers, intro to ISAadders/subtractors, multiplexers, intro to ISA
adders/subtractors, multiplexers, intro to ISA
 
The Ring programming language version 1.9 book - Part 80 of 210
The Ring programming language version 1.9 book - Part 80 of 210The Ring programming language version 1.9 book - Part 80 of 210
The Ring programming language version 1.9 book - Part 80 of 210
 
Softmax
SoftmaxSoftmax
Softmax
 
NTU ML TENSORFLOW
NTU ML TENSORFLOWNTU ML TENSORFLOW
NTU ML TENSORFLOW
 
The Ring programming language version 1.3 book - Part 52 of 88
The Ring programming language version 1.3 book - Part 52 of 88The Ring programming language version 1.3 book - Part 52 of 88
The Ring programming language version 1.3 book - Part 52 of 88
 
Modelling and implementation of 9tka game with MaxN algorithm
Modelling and implementation of 9tka game with MaxN algorithmModelling and implementation of 9tka game with MaxN algorithm
Modelling and implementation of 9tka game with MaxN algorithm
 
The Ring programming language version 1.9 book - Part 60 of 210
The Ring programming language version 1.9 book - Part 60 of 210The Ring programming language version 1.9 book - Part 60 of 210
The Ring programming language version 1.9 book - Part 60 of 210
 

Similar to 1.game

AI_unit3.pptx
AI_unit3.pptxAI_unit3.pptx
AI_unit3.pptx
G1719HarshalDafade
 
Unit_I_Introduction(Part_III).ppt
Unit_I_Introduction(Part_III).pptUnit_I_Introduction(Part_III).ppt
Unit_I_Introduction(Part_III).ppt
ganesh15478
 
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
Asst.prof M.Gokilavani
 
21CSC206T_UNIT3.pptx.pdf ARITIFICIAL INTELLIGENCE
21CSC206T_UNIT3.pptx.pdf ARITIFICIAL INTELLIGENCE21CSC206T_UNIT3.pptx.pdf ARITIFICIAL INTELLIGENCE
21CSC206T_UNIT3.pptx.pdf ARITIFICIAL INTELLIGENCE
udayvanand
 
Chess engine presentation
Chess engine presentationChess engine presentation
Chess engine presentation
TanushreeSharma34
 
ch_5 Game playing Min max and Alpha Beta pruning.ppt
ch_5 Game playing Min max and Alpha Beta pruning.pptch_5 Game playing Min max and Alpha Beta pruning.ppt
ch_5 Game playing Min max and Alpha Beta pruning.ppt
SanGeet25
 
Topic - 6 (Game Playing).ppt
Topic - 6 (Game Playing).pptTopic - 6 (Game Playing).ppt
Topic - 6 (Game Playing).ppt
SabrinaShanta2
 
cs-171-07-Games and Adversarila Search.ppt
cs-171-07-Games and Adversarila Search.pptcs-171-07-Games and Adversarila Search.ppt
cs-171-07-Games and Adversarila Search.ppt
Samiksha880257
 
Gameplaying in artificial intelligence
Gameplaying in artificial intelligenceGameplaying in artificial intelligence
Gameplaying in artificial intelligenceoceanparkk
 
Game Playing in Artificial Intelligence
Game Playing in Artificial IntelligenceGame Playing in Artificial Intelligence
Game Playing in Artificial Intelligence
lordmwesh
 
cai
caicai
Two player games
Two player gamesTwo player games
Two player games
Subash Chandra Pakhrin
 
9SearchAdversarial (1).pptx
9SearchAdversarial (1).pptx9SearchAdversarial (1).pptx
9SearchAdversarial (1).pptx
umairshams6
 
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
nizmishaik1
 
Game playing
Game playingGame playing
Game playing
Tribhuvan University
 
MINI-MAX ALGORITHM.pptx
MINI-MAX ALGORITHM.pptxMINI-MAX ALGORITHM.pptx
MINI-MAX ALGORITHM.pptx
NayanChandak1
 
0-miniproject sem 4 review 1(1)(2).pptx
0-miniproject sem 4 review 1(1)(2).pptx0-miniproject sem 4 review 1(1)(2).pptx
0-miniproject sem 4 review 1(1)(2).pptx
AhishektttPhm
 
Adversarial search
Adversarial searchAdversarial search
Adversarial search
pramod naik
 

Similar to 1.game (20)

AI_unit3.pptx
AI_unit3.pptxAI_unit3.pptx
AI_unit3.pptx
 
Unit_I_Introduction(Part_III).ppt
Unit_I_Introduction(Part_III).pptUnit_I_Introduction(Part_III).ppt
Unit_I_Introduction(Part_III).ppt
 
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
 
21CSC206T_UNIT3.pptx.pdf ARITIFICIAL INTELLIGENCE
21CSC206T_UNIT3.pptx.pdf ARITIFICIAL INTELLIGENCE21CSC206T_UNIT3.pptx.pdf ARITIFICIAL INTELLIGENCE
21CSC206T_UNIT3.pptx.pdf ARITIFICIAL INTELLIGENCE
 
Games.4
Games.4Games.4
Games.4
 
Chess engine presentation
Chess engine presentationChess engine presentation
Chess engine presentation
 
ch_5 Game playing Min max and Alpha Beta pruning.ppt
ch_5 Game playing Min max and Alpha Beta pruning.pptch_5 Game playing Min max and Alpha Beta pruning.ppt
ch_5 Game playing Min max and Alpha Beta pruning.ppt
 
Topic - 6 (Game Playing).ppt
Topic - 6 (Game Playing).pptTopic - 6 (Game Playing).ppt
Topic - 6 (Game Playing).ppt
 
cs-171-07-Games and Adversarila Search.ppt
cs-171-07-Games and Adversarila Search.pptcs-171-07-Games and Adversarila Search.ppt
cs-171-07-Games and Adversarila Search.ppt
 
Adversarial search
Adversarial search Adversarial search
Adversarial search
 
Gameplaying in artificial intelligence
Gameplaying in artificial intelligenceGameplaying in artificial intelligence
Gameplaying in artificial intelligence
 
Game Playing in Artificial Intelligence
Game Playing in Artificial IntelligenceGame Playing in Artificial Intelligence
Game Playing in Artificial Intelligence
 
cai
caicai
cai
 
Two player games
Two player gamesTwo player games
Two player games
 
9SearchAdversarial (1).pptx
9SearchAdversarial (1).pptx9SearchAdversarial (1).pptx
9SearchAdversarial (1).pptx
 
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
 
Game playing
Game playingGame playing
Game playing
 
MINI-MAX ALGORITHM.pptx
MINI-MAX ALGORITHM.pptxMINI-MAX ALGORITHM.pptx
MINI-MAX ALGORITHM.pptx
 
0-miniproject sem 4 review 1(1)(2).pptx
0-miniproject sem 4 review 1(1)(2).pptx0-miniproject sem 4 review 1(1)(2).pptx
0-miniproject sem 4 review 1(1)(2).pptx
 
Adversarial search
Adversarial searchAdversarial search
Adversarial search
 

Recently uploaded

ethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.pptethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.ppt
Jayaprasanna4
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Dr.Costas Sachpazis
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation & Control
 
Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwood
seandesed
 
LIGA(E)11111111111111111111111111111111111111111.ppt
LIGA(E)11111111111111111111111111111111111111111.pptLIGA(E)11111111111111111111111111111111111111111.ppt
LIGA(E)11111111111111111111111111111111111111111.ppt
ssuser9bd3ba
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
Kamal Acharya
 
power quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptxpower quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptx
ViniHema
 
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang,  ICLR 2024, MLILAB, KAIST AI.pdfJ.Yang,  ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
MLILAB
 
Halogenation process of chemical process industries
Halogenation process of chemical process industriesHalogenation process of chemical process industries
Halogenation process of chemical process industries
MuhammadTufail242431
 
Democratizing Fuzzing at Scale by Abhishek Arya
Democratizing Fuzzing at Scale by Abhishek AryaDemocratizing Fuzzing at Scale by Abhishek Arya
Democratizing Fuzzing at Scale by Abhishek Arya
abh.arya
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
JoytuBarua2
 
Forklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella PartsForklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella Parts
Intella Parts
 
WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234
AafreenAbuthahir2
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
Pratik Pawar
 
Event Management System Vb Net Project Report.pdf
Event Management System Vb Net  Project Report.pdfEvent Management System Vb Net  Project Report.pdf
Event Management System Vb Net Project Report.pdf
Kamal Acharya
 
DESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docxDESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docx
FluxPrime1
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Sreedhar Chowdam
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
karthi keyan
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Teleport Manpower Consultant
 
addressing modes in computer architecture
addressing modes  in computer architectureaddressing modes  in computer architecture
addressing modes in computer architecture
ShahidSultan24
 

Recently uploaded (20)

ethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.pptethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.ppt
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
 
Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwood
 
LIGA(E)11111111111111111111111111111111111111111.ppt
LIGA(E)11111111111111111111111111111111111111111.pptLIGA(E)11111111111111111111111111111111111111111.ppt
LIGA(E)11111111111111111111111111111111111111111.ppt
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
 
power quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptxpower quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptx
 
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang,  ICLR 2024, MLILAB, KAIST AI.pdfJ.Yang,  ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
 
Halogenation process of chemical process industries
Halogenation process of chemical process industriesHalogenation process of chemical process industries
Halogenation process of chemical process industries
 
Democratizing Fuzzing at Scale by Abhishek Arya
Democratizing Fuzzing at Scale by Abhishek AryaDemocratizing Fuzzing at Scale by Abhishek Arya
Democratizing Fuzzing at Scale by Abhishek Arya
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
 
Forklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella PartsForklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella Parts
 
WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
 
Event Management System Vb Net Project Report.pdf
Event Management System Vb Net  Project Report.pdfEvent Management System Vb Net  Project Report.pdf
Event Management System Vb Net Project Report.pdf
 
DESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docxDESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docx
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
 
addressing modes in computer architecture
addressing modes  in computer architectureaddressing modes  in computer architecture
addressing modes in computer architecture
 

1.game

  • 1. Game Playing in Artificial Intelligence
  • 2. 1. Games are fun 2. They have well-defined rules 3. They provide advanced, existing test-beds for developing several ideas. 4. It’s a good reasoning problem, formal and nontrivial. 5. Direct comparison with humans and other computer programs is easy Artificial Intelligence - CMT310 2
  • 3. 1. Sequence of moves to play 2. Rules that specify possible moves 3. Rules that specify a payment for each move 4. Objective is to maximize your payment 02.02.16Artificial Intelligence 3
  • 4. 4  Unpredictable opponent  specifying a move for every possible opponent reply  Time limits  unlikely to find goal, must approximate
  • 5. 5 Opponent’s Move Generate New Position Generate Successors Game Over? Evaluate Successors Move to Highest-Valued Successor Game Over? no no yes yes Two-Player Game
  • 7.  The term "game" means a sort of conflict in which n individuals or groups (known as players) participate.  A list of "rules" stipulates the conditions under which the game begins.  A game is said to have "perfect information" if all moves are known to each of the players involved.  A "strategy" is a list of the optimal choices for each player at every stage of a given game.  A "move" is the way in which game progresses from one stage to another, beginning with an initial state of the game to the final state. The total number of moves constitute the completeness of the game.  The payoff or outcome, refers to what happens at the end of a game.  Minimax - good outcomes.  Maximin - bad outcomes.  The primary game theory is the Mini-Max Theorem says: "If a Minimax of one player corresponds to a Maximin of the other player, then that outcome is the best both players can hope for."
  • 8.  Two players: A and B  A moves first and they take turns until the game is over. Winner gets award, loser gets penalty.  Games as search: ◦ Initial state: e.g. board configuration of chess ◦ Successor function: list of (move, state) pairs specifying legal moves. ◦ Terminal test: Is the game finished? ◦ Utility function: Gives numerical value of terminal states. E.g. win (+1), lose (-1) and draw (0)  A uses search tree to determine next move. 23-Mar-2009Artificial Intelligence - CMT310 8
  • 9. 23-Mar-2009Artificial Intelligence - CMT310 9  MiniMax rule: Decision Making in Multi-agent Systems  Perfect play for deterministic, perfect-information games. • Idea: make the move for player MAX which has the most benefit assuming that MIN makes the best move for MIN in response • This is computed by a recursive process • The backed-up value of each node in the tree is determined by the values of its children • For a MAX node, the backed-up value is the maximum of the values of its children (i.e. the best for MAX) • For a MIN node, the backed-up value is the minimum of the values of its children (i.e. the best for MIN)
  • 10. 10 The computer is Max. The opponent is Min. At the leaf nodes, the utility function is employed. Big value means good, small is bad. computer’s turn opponent’s turn computer’s turn opponent’s turn leaf nodes are evaluated
  • 11. 11  utility function: the function applied to leaf nodes  backed-up value ◦ of a max-position: the value of its largest successor ◦ of a min-position: the value of its smallest successor  minimax procedure: search down several levels; at the bottom level apply the utility function, back-up values all the way up to the root node, and that node selects the move.
  • 12. 23-Mar-2009Artificial Intelligence - CMT310 12 Consider a 2-ply (two step) game: Max want’s largest outcome --- Min want’s smallest. 1. Start with the current position as a MAX node. 2. Expand the game tree a fixed number of ply (half-moves). 3. Apply the evaluation function to the leaf positions. 4. Calculate back-up up values bottom-up. 5. Pick the move which was chosen to give the MAX value at the root.
  • 13. 13
  • 14.  Complete? Yes (if tree is finite)  Optimal? Yes (against an optimal opponent)  Time complexity? O(bm)  Space complexity? O(bm) (depth-first exploration) 23-Mar-2009Artificial Intelligence - CMT310 14
  • 15.  Eliminating a branch without consideration is called pruning ◦ Want to visit as many board states as possible (Can be used for entire search or cutoff search)  Want to avoid whole branches (prune them)  Because they can’t possibly lead to a good score  A way to improve the performance of the Minimax Procedure  Basic idea: “If you have an idea which is surely bad, don’t take the time to see how truly awful it is” 23-Mar-2009Artificial Intelligence - CMT310 15 2 7 1 =2 >=2 <=1 ? • We don’t need to compute the value at this node.
  • 16. 23-Mar-2009Artificial Intelligence - CMT310 16  3MAX MIN =3 3 12 8 2 X X  2 14  14 5  5 2 =2 =3
  • 17.  Traverse the search tree in depth-first order  For each MAX node n, α(n)=maximum child value found so far ◦ Starts with – ◦ Increases if a child returns a value greater than the current α(n) ◦ Lower-bound on the final value  For each MIN node n, β(n)=minimum child value found so far ◦ Starts with + ◦ Decreases if a child returns a value less than the current β(n) ◦ Upper-bound on the final value  MAX cutoff rule: At a MAX node n, cut off search if α(n)>=β(n)  MIN cutoff rule: At a MIN node n, cut off search if β(n)<=α(n) 23-Mar-2009Artificial Intelligence - CMT310 17
  • 18. 23-Mar-2009Artificial Intelligence - CMT310 18 function ALPHA-BETA-SEARCH(state) returns an action inputs: state, current state in game vMAX-VALUE(state, - ∞ , +∞) return the action in SUCCESSORS(state) with value v function MAX-VALUE(state, , ) returns a utility value if TERMINAL-TEST(state) then return UTILITY(state) v  - ∞ for a,s in SUCCESSORS(state) do v  MAX(v,MIN-VALUE(s,  , )) if v ≥  then return v   MAX( ,v) return v
  • 19. 23-Mar-2009Artificial Intelligence - CMT310 19 function MIN-VALUE(state,  , ) returns a utility value if TERMINAL-TEST(state) then return UTILITY(state) v  + ∞ for a,s in SUCCESSORS(state) do v  MIN(v,MAX-VALUE(s,  , )) if v ≤  then return v   MIN( ,v) return v
  • 20.  Properties  Pruning does not affect final result   Good move ordering improves effectiveness of pruning   With "perfect ordering," time complexity = O(bm/2)  doubles depth of search  A simple example of the value of reasoning about which computations are relevant (a form of metareasoning)   Effectiveness  Guaranteed to compute same root value as Minimax  Worst case: no pruning, same as Minimax (O(bd))  Best case: when each player’s best move is the first option examined, you examine only O(bd/2) nodes, allowing you to search twice as deep!  For Deep Blue, alpha-beta pruning reduced the average branching factor from 35-40 to 6. 23-Mar-2009Artificial Intelligence - CMT310 20
  • 21. 23-Mar-2009Artificial Intelligence - CMT310 21 APPLICATIONS  Training Simulators  Military simulations  Management simulations  Economic simulations  Education  Entertainment  Virtual Environments Movies