7 views

Uploaded by Pushpender Singh

- 464-15p
- Evolution of Complexes from LEGO™ Bricks in a washing machine
- DECISION MAKING.pptx
- Assignment_3ECX6240_2012-ver3(1).docx
- Campus Map
- Hr Decision Making
- Attacking the Spanish Excerpt
- 02F_lecture11_12
- Rational Protocol Design: Cryptography Against Incentive-driven Adversaries
- Jeremy Spinard - 8
- Taimanov variation.docx
- Assignment No 2
- Sam_Shankland_Small_Steps_to_Giant_Improvement.pdf
- Experimental results on UG
- The Subtle Art of Not Giving a F*ck: A Counterintuitive Approach to Living a Good Life
- Sapiens: A Brief History of Humankind
- The Unwinding: An Inner History of the New America
- Hidden Figures: The American Dream and the Untold Story of the Black Women Mathematicians Who Helped Win the Space Race
- The Library Book
- Elon Musk: Tesla, SpaceX, and the Quest for a Fantastic Future

You are on page 1of 57

CS 461 Artificial Intelligence Pinar Duygulu Bilkent University, Spring 2008

Slides are mostly adapted from AIMA and MIT Open Courseware

Spring 2008

Outline

Games Optimal decisions Minimax algorithm - pruning Imperfect, real-time decisions

Spring 2008

Games

Multi agent environments : any given agent will need to consider the actions of other agents and how they affect its own welfare. The unpredictability of these other agents can introduce many possible contingencies There could be competitive or cooperative environments Competitive environments, in which the agents goals are in conflict require adversarial search these problems are called as games

Spring 2008

Games

In game theory (economics), any multiagent environment (either cooperative or competitive) is a game provided that the impact of each agent on the other is significant AI games are a specialized kind - deterministic, turn taking, two-player, zero sum games of perfect information In our terminology deterministic, fully observable environments with two agents whose actions alternate and the utility values at the end of the game are always equal and opposite (+1 and 1)

Spring 2008

1949 Shannon paper originated the ideas 1951 Turing paper hand simulation 1958 Bernstein program 1955-1960 Simon-Newell program 1961 Soviet program 1966 1967 MacHack 6 defeated a good player 1970s NW chess 4.5 1980s Cray Bitz 1990s Belle, Hitech, Deep Thought, 1997 - Deep Blue - defeated Garry Kasparov

Spring 2008

Spring 2008

Spring 2008

Spring 2008

Optimal strategies

In a normal search problem, the optimal solution would be a sequence of moves leading to a goal state - a terminal state that is a win In a game, MIN has something to say about it and therefore MAX must find a contingent strategy, which specifies

MAXs move in the initial state, then MAXs moves in the states resulting from every possible response by MIN, then MAXs moves in the states resulting from every possible response by MIN to those moves

An optimal strategy leads to outcomes at least as good as any other strategy when one is playing an infallible opponent

CS461 Artificial Intelligence Pinar Duygulu Spring 2008

10

Minimax

Perfect play for deterministic games Idea: choose move to position with highest minimax value = best achievable payoff against best play E.g., 2-ply game:

Spring 2008

11

Minimax value

Given a game tree, the optimal strategy can be determined by examining the minimax value of each node (MINIMAX-VALUE(n)) The minimax value of a node is the utility of being in the corresponding state, assuming that both players play optimally from there to the end of the game Given a choice, MAX prefer to move to a state of maximum value, whereas MIN prefers a state of minimum value

Spring 2008

12

Minimax algorithm

Spring 2008

13

Minimax

MINIMAX-VALUE(root) = max(min(3,12,8), min(2,4,6), min(14,5,2)) = max(3,2,2) =3

Spring 2008

14

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

Spring 2008

15

(+1 +2 +3)

(+1 +2 +3)

(-1 +5 +2)

(+1 +2 +3)

(+6 +1 +2)

(-1 +5 +2)

(+5 +4 +5)

Spring 2008

16

- pruning

It is possible to compute the correct minimax decision without looking at every node in the game tree

MINIMAX-VALUE(root) = max(min(3,12,8), min(2,x,y), min(14,5,2)) = max(3,min(2,x,y),2) = max(3,z,2) =3 where z <=2

Spring 2008

17

- pruning example

Spring 2008

18

- pruning example

Spring 2008

19

- pruning example

Spring 2008

20

- pruning example

Spring 2008

21

- pruning example

Spring 2008

22

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)

Spring 2008

23

Why is it called -?

is the value of the best (i.e., highestvalue) choice found so far at any choice point along the path for max If v is worse than , max will avoid it

prune that branch

Spring 2008

24

The - algorithm

Spring 2008

25

The - algorithm

Spring 2008

26

The - algorithm

Spring 2008

27

- pruning

Spring 2008

28

- pruning example

Spring 2008

29

- pruning example

Spring 2008

30

- pruning example

Spring 2008

31

- pruning example

Spring 2008

32

- pruning example

Spring 2008

33

- pruning example

Spring 2008

34

- pruning example

Spring 2008

35

- pruning example

Spring 2008

36

- pruning example

Spring 2008

37

- pruning example

Spring 2008

38

- pruning example

Spring 2008

39

- pruning example

Spring 2008

40

- pruning example

Spring 2008

41

MAX

MIN

<=6

MAX

>=8

MINH

6

I

5

J

8

= agent

= opponent

42

MAX

>=6

MIN

<=2

MAX

>=8

MINH

6

I

5

J

8

= agent

L

2

M

1

= opponent

43

MAX

>=6

MIN

MAX

>=8

MINH

6

I

5

J

8

= agent

L

2

M

1

= opponent

Alpha-beta Pruning

MAX

6

44

MIN

beta cutoff

MAX

>=8

alpha cutoff

MINH

6

I

5

J

8

= agent

L

2

M

1

= opponent

45

Move generation

Spring 2008

46

Resource limits

Suppose we have 100 secs, explore 104 nodes/sec 106 nodes per move Standard approach: cutoff test:

e.g., depth limit (perhaps add quiescence search)

evaluation function

= estimated desirability of position

Spring 2008

47

Evaluation function

Spring 2008

48

Min-Max

Spring 2008

49

Evaluation functions

A typical evaluation function is a linear function in which some set of coefficients is used to weight a number of "features" of the board position. For chess, typically linear weighted sum of features Eval(s) = w1 f1(s) + w2 f2(s) + + wn fn(s) e.g., w1 = 9 with f1(s) = (number of white queens) (number of black queens), etc.

Spring 2008

50

Evaluation function

"material", : some measure of which pieces one has on the board. A typical weighting for each type of chess piece is shown Other types of features try to encode something about the distribution of the pieces on the board.

CS461 Artificial Intelligence Pinar Duygulu Spring 2008

51

MinimaxCutoff is identical to MinimaxValue except

1. 2. Terminal? is replaced by Cutoff? Utility is replaced by Eval

Does it work in practice? bm = 106, b=35 m=4 4-ply lookahead is a hopeless chess player!

4-ply human novice 8-ply typical PC, human master 12-ply Deep Blue, Kasparov

Spring 2008

52

The key idea is that the more lookahead we can do, that is, the deeper in the tree we can look, the better our evaluation of a position will be, even with a simple evaluation function. In some sense, if we could look all the way to the end of the game, all we would need is an evaluation function that was 1 when we won and -1 when the opponent won.

CS461 Artificial Intelligence Pinar Duygulu Spring 2008

53

it seems to suggest that brute-force search is all that matters. And Deep Blue is brute indeed... It had 256 specialized chess processors coupled into a 32 node supercomputer. It examined around 30 billion moves per minute. The typical search depth was 13ply, but in some dynamic situations it could go as deep as 30.

Spring 2008

54

Practical issues

Spring 2008

55

Other games

Spring 2008

56

Checkers: Chinook ended 40-year-reign of human world champion Marion Tinsley in 1994. Used a precomputed endgame database defining perfect play for all positions involving 8 or fewer pieces on the board, a total of 444 billion positions. Chess: Deep Blue defeated human world champion Garry Kasparov in a sixgame match in 1997. Deep Blue searches 200 million positions per second, uses very sophisticated evaluation, and undisclosed methods for extending some lines of search up to 40 ply. Othello: human champions refuse to compete against computers, who are too good. Go: human champions refuse to compete against computers, who are too bad. In go, b > 300, so most programs use pattern knowledge bases to suggest plausible moves.

Spring 2008

57

Summary

Games are fun to work on! They illustrate several important points about AI perfection is unattainable must approximate good idea to think about what to think about

Spring 2008

- 464-15pUploaded byRosiana Rahma
- Evolution of Complexes from LEGO™ Bricks in a washing machineUploaded bydagush
- DECISION MAKING.pptxUploaded byFrances Irah Daniot Sayson
- Assignment_3ECX6240_2012-ver3(1).docxUploaded byK.W.Malith Jothipala
- Campus MapUploaded bygerher
- Hr Decision MakingUploaded byemmanuel Johny
- Attacking the Spanish ExcerptUploaded bydelamun23
- 02F_lecture11_12Uploaded bygd3000
- Rational Protocol Design: Cryptography Against Incentive-driven AdversariesUploaded byWarren Smith QC (Quantum Cryptanalyst)
- Jeremy Spinard - 8Uploaded byAnonymous oSJiBvxt
- Taimanov variation.docxUploaded byAnonymous IpFc1EE
- Assignment No 2Uploaded byMuthukumar
- Sam_Shankland_Small_Steps_to_Giant_Improvement.pdfUploaded byLeo Solán
- Experimental results on UGUploaded byJane

- Mt 261 Several VariablesUploaded byBURTON
- Ratio and Proportion SumsUploaded bySudhir Narang
- Kerala- Maths Sample Paper-1- SOLUTION-Class 11th Question PaperUploaded byFirdosh Khan
- Arg02_Quantitative Tools and ExcelUploaded bywelcomeoly
- ConfTokyo2014Mini PDEUploaded by159amin159
- Improving Your MemoryUploaded byvarun2313676
- Fitting hyperelastic models to experimental data"http://www.w3.org/TR/html4/loose.dtd"> <HTML><HEAD><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"> <TITLE>ERROR: The requested URL could not be retrieved</TITLE> <STYLE type="text/css"><!--BODY{background-color:#ffffff;font-family:verdana,sans-serif}PRE{font-family:sans-serif}--></STYLE> </HEAD><BODY> <H1>ERROR</H1> <H2>The requested URL could not be retrieved</H2> <HR noshade size="1px"> <P> While trying to process the request: <PRE> TEXT http://www.scribd.com/titlecleaner?title=Fitting+hyperelastic+models+to+experimental+data.pdf HTTP/1.1 Host: www.scribd.com Proxy-Connection: keep-alive Referer: http://www.scribd.com/upload-document?archive_doc=123752599&metadata=%7B%22platform%22%3A%22web%22%2C%22page%22%3A%22read%22%2C%22action%22%3A%22download_promo%22%2C%22logged_in%22%3Afalse%2C%22context%22%3A%22archive_view_restricted%22%7D Origin: http://www.scribd.com X-CSRF-Token: 17f6aa10b990325eUploaded bykrish
- CASSY QSUploaded byTancho Indra
- Decision Making CanUploaded byAhmed Helmy
- npsD49EUploaded byneversaynever99
- Modeling problems of steeply inclined cableway subjected to moving loadUploaded byfont89
- eigenval.pdfUploaded byAmmar Abdullah
- Risk_Analysis_Z540-3.pdfUploaded bySomsak Navayon
- Assignment on Operations ResearchUploaded bydiplococcous
- model in RUploaded bysarvesh_mishra
- Airy Stress FunctionUploaded bythoitrung76
- vtu cs 3rd semester new syllabusUploaded byanser_pasha123
- The Wonders of Mathematics Ambassador Subir Kumar Bhattacharyya John Keats’Uploaded byapi-15379927
- Lagrange_Multipliers.pdfUploaded byQarsam Ilyas
- Combinations Imp Tut2Uploaded byAngelique Thakur
- The fafUploaded byTrushit Vaishnav
- Curriculum TablesUploaded byJake Frumkin
- contourlet transformUploaded bySiddharth Purohit
- CINRUploaded bySawsan Saad
- Geant4 GPS Users ManualUploaded byRaj
- ACJC Promo PaperUploaded byMathathlete
- Lab Assignment 2Uploaded bybiebs039
- NEW NM QBUploaded byJag Parvesh Dahiya
- activity 2-1 3 1 combining like terms with algebra tilesUploaded byapi-288922072
- Acc Sample MathsUploaded bySimiYadav