SlideShare a Scribd company logo
1 of 46
Game playing
Outline
• Optimal decisions
• α-β pruning
• Imperfect, real-time decisions
Games vs. search problems
• "Unpredictable" opponent  specifying a
move for every possible opponent reply
• Time limits  unlikely to find goal, must
approximate
Game tree (2-player,
deterministic, turns)
Optimal strategy
• Perfect play for deterministic games
• Minimax Value for a node n
• This definition is used recursively
• Idea: minimax value is the best achievable payoff
against best play
Minimax example
• Perfect play for deterministic games
• Minimax Decision at root: choose the action a that
lead to a maximal minimax value
• MAX is guaranteed for a utility which is at least the
minimax value – if he plays rationally.
Minimax algorithm
Properties of minimax
• Complete? Yes (if tree is finite)
• Optimal? Yes (against an optimal opponent)
• Time complexity? O(bm)
• Space complexity? O(bm) (depth-first exploration)
• For chess, b ≈ 35, m ≈100 for "reasonable" games
 exact solution completely infeasible
Multiplayer games
• Each node must hold a vector of values
• For example, for three players A, B, C (vA, vB, vC)
• The backed up vector at node n will always be the one
that maximizes the payoff of the player choosing at n
α-β pruning example
α-β pruning example
α-β pruning example
α-β pruning example
α-β pruning example
Properties of α-β
• 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)
The α-β algorithm
The α-β algorithm
Why is it called α-β?
•  is the value of the best
(i.e., highest-value) choice
found so far for MAX at
any choice point along the
path to the root.
• If v is worse than , MAX
will avoid it
 prune that branch
•  is the value of the best
(i.e., lowest-value) choice
found so far for MIN at any
choice point along the path
for to the root.
Another example
5 7 10 3 1 2 9 9 8 2 9 3
How much do we gain?
 Assume a game tree of uniform branching factor b
 Minimax examines O(bh) nodes, so does alpha-beta in
the worst-case
 The gain for alpha-beta is maximum when:
• The MIN children of a MAX node are ordered in decreasing
backed up values
• The MAX children of a MIN node are ordered in increasing
backed up values
 Then alpha-beta examines O(bh/2) nodes [Knuth and Moore, 1975]
 But this requires an oracle (if we knew how to order nodes
perfectly, we would not need to search the game tree)
 If nodes are ordered at random, then the average
number of nodes examined by alpha-beta is ~O(b3h/4)
Heuristic Ordering of Nodes
 Order the nodes below the root according to
the values backed-up at the previous iteration
 Order MAX (resp. MIN) nodes in decreasing
(increasing) values of the evaluation function
computed at these nodes
Games of imperfect information
• Minimax and alpha-beta pruning require
too much leaf-node evaluations.
• May be impractical within a reasonable
amount of time.
• SHANNON (1950):
– Cut off search earlier (replace TERMINAL-
TEST by CUTOFF-TEST)
– Apply heuristic evaluation function EVAL
(replacing utility function of alpha-beta)
Cutting off search
• Change:
– if TERMINAL-TEST(state) then return
UTILITY(state)
into
– if CUTOFF-TEST(state,depth) then return EVAL(state)
• Introduces a fixed-depth limit depth
– Is selected so that the amount of time will not exceed what
the rules of the game allow.
• When cutoff occurs, the evaluation is
performed.
Heuristic EVAL
• Idea: produce an estimate of the expected
utility of the game from a given position.
• Performance depends on quality of EVAL.
• Requirements:
– EVAL should order terminal-nodes in the same way
as UTILITY.
– Computation may not take too long.
– For non-terminal states the EVAL should be
strongly correlated with the actual chance of
winning.
• Only useful for quiescent (no wild swings in
value in near future) states
Heuristic EVAL example
Eval(s) = w1 f1(s) + w2 f2(s) + … + wnfn(s)
Heuristic EVAL example
Eval(s) = w1 f1(s) + w2 f2(s) + … + wnfn(s)
Addition assumes
independence
Heuristic difficulties
Heuristic counts pieces won
Horizon effect
Fixed depth search
Makes black think
it can avoid the
queening move of
White pawn
Games that include chance
• Possible moves (5-10,5-11), (5-11,19-24),(5-
10,10-16) and (5-11,11-16)
Games that include chance
• Possible moves (5-10,5-11), (5-11,19-24),(5-10,10-16)
and (5-11,11-16)
• [1,1], [6,6] chance 1/36, all other chance 1/18
chance nodes
Games that include chance
• [1,1], [6,6] chance 1/36, all other chance 1/18
• Can not calculate definite minimax value, only
expected value
Expected minimax value
EXPECTED-MINIMAX-VALUE(n)=
UTILITY(n) if n is a terminal
maxs  successors(n) MINIMAX-VALUE(s) if n is a max node
mins  successors(n) MINIMAX-VALUE(s) if n is a max node
s  successors(n) P(s) . EXPECTEDMINIMAX(s) if n is a chance
node
These equations can be backed-up
recursively all the way to the root of the
game tree.
Position evaluation with chance
nodes
• Left, A1 wins
• Right A2 wins
• Outcome of evaluation function may not change when
values are scaled differently.
• Behavior is preserved only by a positive linear
transformation of EVAL.
State-of-the-Art
Checkers: Tinsley vs. Chinook
Name: Marion Tinsley
Profession: Teach mathematics
Hobby: Checkers
Record: Over 42 years
loses only 3 games
of checkers
World champion for over 40
years
Mr. Tinsley suffered his 4th and 5th losses against Chinook
Chinook
First computer to become official world champion of Checkers!
Has all endgame table for 10 pieces or less: over 39 trillion
entries.
Chess: Kasparov vs. Deep Blue
Kasparov
5’10”
176 lbs
34 years
50 billion neurons
2 pos/sec
Extensive
Electrical/chemical
Enormous
Height
Weight
Age
Computers
Speed
Knowledge
Power Source
Ego
Deep Blue
6’ 5”
2,400 lbs
4 years
32 RISC processors
+ 256 VLSI chess engines
200,000,000 pos/sec
Primitive
Electrical
None
1997: Deep Blue wins by 3 wins, 1 loss, and 2 draws
Chess: Kasparov vs. Deep Junior
August 2, 2003: Match ends in a 3/3 tie!
Deep Junior
8 CPU, 8 GB RAM, Win 2000
2,000,000 pos/sec
Available at $100
Othello: Murakami vs. Logistello
Takeshi Murakami
World Othello Champion
1997: The Logistello software crushed Murakami
by 6 games to 0
Backgammon
• 1995 TD-Gammon by Gerald Thesauro
won world championship on 1995
• BGBlitz won 2008 computer backgammon
olympiad
Go: Goemate vs. ??
Name: Chen Zhixing
Profession: Retired
Computer skills:
self-taught programmer
Author of Goemate (arguably the
best Go program available today)
Gave Goemate a 9 stone
handicap and still easily
beat the program,
thereby winning $15,000
Go: Goemate vs. ??
Name: Chen Zhixing
Profession: Retired
Computer skills:
self-taught programmer
Author of Goemate (arguably the
strongest Go programs)
Gave Goemate a 9 stone
handicap and still easily
beat the program,
thereby winning $15,000
Jonathan Schaeffer
Go has too high a branching factor
for existing search techniques
Current and future software must
rely on huge databases and pattern-
recognition techniques
– March 2016
• Developed by Google DeepMind in London to
play the board game Go.
• Plays full 19x19 games
• October 2015: the distributed version of
AlphaGo defeated the European Go champion
Fan Hui - five to zero
• March 2016 AlphaGo played South Korean
professional Go player Lee Sedol, ranked 9-dan,
one of the best Go players – four to one.
• A significant breakthrough in AI research!!!
Secrets
 Many game programs are based on alpha-beta +
iterative deepening + extended/singular search +
transposition tables + huge databases + ...
 For instance, Chinook searched all checkers
configurations with 8 pieces or less and created an
endgame database of 444 billion board
configurations
 The methods are general, but their implementation
is dramatically improved by many specifically
tuned-up enhancements (e.g., the evaluation
functions)
Perspective on Games: Con and Pro
Chess is the Drosophila of
artificial intelligence. However,
computer chess has developed
much as genetics might have if
the geneticists had concentrated
their efforts starting in 1910 on
breeding racing Drosophila. We
would have some science, but
mainly we would have very fast
fruit flies.
John McCarthy
Saying Deep Blue doesn’t
really think about chess
is like saying an airplane
doesn't really fly because
it doesn't flap its wings.
Drew McDermott
Other Types of Games
 Multi-player games, with alliances or not
 Games with randomness in successor
function (e.g., rolling a dice)
 Expectminimax algorithm
 Games with partially observable states
(e.g., card games)
 Search of belief state spaces
See R&N p. 175-180

More Related Content

Similar to GamePlaying.ppt

Topic - 6 (Game Playing).ppt
Topic - 6 (Game Playing).pptTopic - 6 (Game Playing).ppt
Topic - 6 (Game Playing).pptSabrinaShanta2
 
Adversarial search with Game Playing
Adversarial search with Game PlayingAdversarial search with Game Playing
Adversarial search with Game PlayingAman Patel
 
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
 
Adversarial search
Adversarial searchAdversarial search
Adversarial searchNilu Desai
 
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.pptSamiksha880257
 
Minmax and alpha beta pruning.pptx
Minmax and alpha beta pruning.pptxMinmax and alpha beta pruning.pptx
Minmax and alpha beta pruning.pptxPriyadharshiniG41
 
Adversarial search
Adversarial searchAdversarial search
Adversarial searchDheerendra k
 
CptS 440/ 540 AI.pptx
CptS 440/ 540 AI.pptxCptS 440/ 540 AI.pptx
CptS 440/ 540 AI.pptxDrDejaVu2
 
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
 
12 adversal search
12 adversal search12 adversal search
12 adversal searchTianlu Wang
 
AI3391 Artificial Intelligence Session 17 imperfect real time decisions.pptx
AI3391 Artificial Intelligence Session 17 imperfect real time decisions.pptxAI3391 Artificial Intelligence Session 17 imperfect real time decisions.pptx
AI3391 Artificial Intelligence Session 17 imperfect real time decisions.pptxAsst.prof M.Gokilavani
 
Badiya haihn
Badiya haihnBadiya haihn
Badiya haihnamitp26
 
21CSC206T_UNIT3.pptx.pdf ARITIFICIAL INTELLIGENCE
21CSC206T_UNIT3.pptx.pdf ARITIFICIAL INTELLIGENCE21CSC206T_UNIT3.pptx.pdf ARITIFICIAL INTELLIGENCE
21CSC206T_UNIT3.pptx.pdf ARITIFICIAL INTELLIGENCEudayvanand
 

Similar to GamePlaying.ppt (20)

Two player games
Two player gamesTwo player games
Two player games
 
Topic - 6 (Game Playing).ppt
Topic - 6 (Game Playing).pptTopic - 6 (Game Playing).ppt
Topic - 6 (Game Playing).ppt
 
Capgemini 1
Capgemini 1Capgemini 1
Capgemini 1
 
Adversarial search with Game Playing
Adversarial search with Game PlayingAdversarial search with Game Playing
Adversarial search with Game Playing
 
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
 
Adversarial search
Adversarial searchAdversarial search
Adversarial search
 
Adversarial search
Adversarial searchAdversarial search
Adversarial search
 
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
 
484-7.ppt
484-7.ppt484-7.ppt
484-7.ppt
 
Minmax and alpha beta pruning.pptx
Minmax and alpha beta pruning.pptxMinmax and alpha beta pruning.pptx
Minmax and alpha beta pruning.pptx
 
Adversarial search
Adversarial searchAdversarial search
Adversarial search
 
CptS 440/ 540 AI.pptx
CptS 440/ 540 AI.pptxCptS 440/ 540 AI.pptx
CptS 440/ 540 AI.pptx
 
l3.pptx
l3.pptxl3.pptx
l3.pptx
 
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
 
12 adversal search
12 adversal search12 adversal search
12 adversal search
 
AI3391 Artificial Intelligence Session 17 imperfect real time decisions.pptx
AI3391 Artificial Intelligence Session 17 imperfect real time decisions.pptxAI3391 Artificial Intelligence Session 17 imperfect real time decisions.pptx
AI3391 Artificial Intelligence Session 17 imperfect real time decisions.pptx
 
AI_unit3.pptx
AI_unit3.pptxAI_unit3.pptx
AI_unit3.pptx
 
Badiya haihn
Badiya haihnBadiya haihn
Badiya haihn
 
AI-08 Game Playing.pptx
AI-08 Game Playing.pptxAI-08 Game Playing.pptx
AI-08 Game Playing.pptx
 
21CSC206T_UNIT3.pptx.pdf ARITIFICIAL INTELLIGENCE
21CSC206T_UNIT3.pptx.pdf ARITIFICIAL INTELLIGENCE21CSC206T_UNIT3.pptx.pdf ARITIFICIAL INTELLIGENCE
21CSC206T_UNIT3.pptx.pdf ARITIFICIAL INTELLIGENCE
 

Recently uploaded

High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...Call Girls in Nagpur High Profile
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxDeepakSakkari2
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLDeelipZope
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerAnamika Sarkar
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSCAESB
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝soniya singh
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZTE
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineeringmalavadedarshan25
 

Recently uploaded (20)

High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptx
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCL
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentation
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineering
 

GamePlaying.ppt

  • 2. Outline • Optimal decisions • α-β pruning • Imperfect, real-time decisions
  • 3. Games vs. search problems • "Unpredictable" opponent  specifying a move for every possible opponent reply • Time limits  unlikely to find goal, must approximate
  • 5. Optimal strategy • Perfect play for deterministic games • Minimax Value for a node n • This definition is used recursively • Idea: minimax value is the best achievable payoff against best play
  • 6. Minimax example • Perfect play for deterministic games • Minimax Decision at root: choose the action a that lead to a maximal minimax value • MAX is guaranteed for a utility which is at least the minimax value – if he plays rationally.
  • 8. Properties of minimax • Complete? Yes (if tree is finite) • Optimal? Yes (against an optimal opponent) • Time complexity? O(bm) • Space complexity? O(bm) (depth-first exploration) • For chess, b ≈ 35, m ≈100 for "reasonable" games  exact solution completely infeasible
  • 9. Multiplayer games • Each node must hold a vector of values • For example, for three players A, B, C (vA, vB, vC) • The backed up vector at node n will always be the one that maximizes the payoff of the player choosing at n
  • 15. Properties of α-β • 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)
  • 18. Why is it called α-β? •  is the value of the best (i.e., highest-value) choice found so far for MAX at any choice point along the path to the root. • If v is worse than , MAX will avoid it  prune that branch •  is the value of the best (i.e., lowest-value) choice found so far for MIN at any choice point along the path for to the root.
  • 19. Another example 5 7 10 3 1 2 9 9 8 2 9 3
  • 20. How much do we gain?  Assume a game tree of uniform branching factor b  Minimax examines O(bh) nodes, so does alpha-beta in the worst-case  The gain for alpha-beta is maximum when: • The MIN children of a MAX node are ordered in decreasing backed up values • The MAX children of a MIN node are ordered in increasing backed up values  Then alpha-beta examines O(bh/2) nodes [Knuth and Moore, 1975]  But this requires an oracle (if we knew how to order nodes perfectly, we would not need to search the game tree)  If nodes are ordered at random, then the average number of nodes examined by alpha-beta is ~O(b3h/4)
  • 21. Heuristic Ordering of Nodes  Order the nodes below the root according to the values backed-up at the previous iteration  Order MAX (resp. MIN) nodes in decreasing (increasing) values of the evaluation function computed at these nodes
  • 22. Games of imperfect information • Minimax and alpha-beta pruning require too much leaf-node evaluations. • May be impractical within a reasonable amount of time. • SHANNON (1950): – Cut off search earlier (replace TERMINAL- TEST by CUTOFF-TEST) – Apply heuristic evaluation function EVAL (replacing utility function of alpha-beta)
  • 23. Cutting off search • Change: – if TERMINAL-TEST(state) then return UTILITY(state) into – if CUTOFF-TEST(state,depth) then return EVAL(state) • Introduces a fixed-depth limit depth – Is selected so that the amount of time will not exceed what the rules of the game allow. • When cutoff occurs, the evaluation is performed.
  • 24. Heuristic EVAL • Idea: produce an estimate of the expected utility of the game from a given position. • Performance depends on quality of EVAL. • Requirements: – EVAL should order terminal-nodes in the same way as UTILITY. – Computation may not take too long. – For non-terminal states the EVAL should be strongly correlated with the actual chance of winning. • Only useful for quiescent (no wild swings in value in near future) states
  • 25. Heuristic EVAL example Eval(s) = w1 f1(s) + w2 f2(s) + … + wnfn(s)
  • 26. Heuristic EVAL example Eval(s) = w1 f1(s) + w2 f2(s) + … + wnfn(s) Addition assumes independence
  • 28. Horizon effect Fixed depth search Makes black think it can avoid the queening move of White pawn
  • 29. Games that include chance • Possible moves (5-10,5-11), (5-11,19-24),(5- 10,10-16) and (5-11,11-16)
  • 30. Games that include chance • Possible moves (5-10,5-11), (5-11,19-24),(5-10,10-16) and (5-11,11-16) • [1,1], [6,6] chance 1/36, all other chance 1/18 chance nodes
  • 31. Games that include chance • [1,1], [6,6] chance 1/36, all other chance 1/18 • Can not calculate definite minimax value, only expected value
  • 32. Expected minimax value EXPECTED-MINIMAX-VALUE(n)= UTILITY(n) if n is a terminal maxs  successors(n) MINIMAX-VALUE(s) if n is a max node mins  successors(n) MINIMAX-VALUE(s) if n is a max node s  successors(n) P(s) . EXPECTEDMINIMAX(s) if n is a chance node These equations can be backed-up recursively all the way to the root of the game tree.
  • 33. Position evaluation with chance nodes • Left, A1 wins • Right A2 wins • Outcome of evaluation function may not change when values are scaled differently. • Behavior is preserved only by a positive linear transformation of EVAL.
  • 35. Checkers: Tinsley vs. Chinook Name: Marion Tinsley Profession: Teach mathematics Hobby: Checkers Record: Over 42 years loses only 3 games of checkers World champion for over 40 years Mr. Tinsley suffered his 4th and 5th losses against Chinook
  • 36. Chinook First computer to become official world champion of Checkers! Has all endgame table for 10 pieces or less: over 39 trillion entries.
  • 37. Chess: Kasparov vs. Deep Blue Kasparov 5’10” 176 lbs 34 years 50 billion neurons 2 pos/sec Extensive Electrical/chemical Enormous Height Weight Age Computers Speed Knowledge Power Source Ego Deep Blue 6’ 5” 2,400 lbs 4 years 32 RISC processors + 256 VLSI chess engines 200,000,000 pos/sec Primitive Electrical None 1997: Deep Blue wins by 3 wins, 1 loss, and 2 draws
  • 38. Chess: Kasparov vs. Deep Junior August 2, 2003: Match ends in a 3/3 tie! Deep Junior 8 CPU, 8 GB RAM, Win 2000 2,000,000 pos/sec Available at $100
  • 39. Othello: Murakami vs. Logistello Takeshi Murakami World Othello Champion 1997: The Logistello software crushed Murakami by 6 games to 0
  • 40. Backgammon • 1995 TD-Gammon by Gerald Thesauro won world championship on 1995 • BGBlitz won 2008 computer backgammon olympiad
  • 41. Go: Goemate vs. ?? Name: Chen Zhixing Profession: Retired Computer skills: self-taught programmer Author of Goemate (arguably the best Go program available today) Gave Goemate a 9 stone handicap and still easily beat the program, thereby winning $15,000
  • 42. Go: Goemate vs. ?? Name: Chen Zhixing Profession: Retired Computer skills: self-taught programmer Author of Goemate (arguably the strongest Go programs) Gave Goemate a 9 stone handicap and still easily beat the program, thereby winning $15,000 Jonathan Schaeffer Go has too high a branching factor for existing search techniques Current and future software must rely on huge databases and pattern- recognition techniques
  • 43. – March 2016 • Developed by Google DeepMind in London to play the board game Go. • Plays full 19x19 games • October 2015: the distributed version of AlphaGo defeated the European Go champion Fan Hui - five to zero • March 2016 AlphaGo played South Korean professional Go player Lee Sedol, ranked 9-dan, one of the best Go players – four to one. • A significant breakthrough in AI research!!!
  • 44. Secrets  Many game programs are based on alpha-beta + iterative deepening + extended/singular search + transposition tables + huge databases + ...  For instance, Chinook searched all checkers configurations with 8 pieces or less and created an endgame database of 444 billion board configurations  The methods are general, but their implementation is dramatically improved by many specifically tuned-up enhancements (e.g., the evaluation functions)
  • 45. Perspective on Games: Con and Pro Chess is the Drosophila of artificial intelligence. However, computer chess has developed much as genetics might have if the geneticists had concentrated their efforts starting in 1910 on breeding racing Drosophila. We would have some science, but mainly we would have very fast fruit flies. John McCarthy Saying Deep Blue doesn’t really think about chess is like saying an airplane doesn't really fly because it doesn't flap its wings. Drew McDermott
  • 46. Other Types of Games  Multi-player games, with alliances or not  Games with randomness in successor function (e.g., rolling a dice)  Expectminimax algorithm  Games with partially observable states (e.g., card games)  Search of belief state spaces See R&N p. 175-180