Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
History of Games
• Play Chess: Analytical Engine [Babbage, 1846)
• Tic-tac-toe [Bowden 1953]
• Mechanism to play chess by machine [Claude
Shanon, 1950]
• Describe chess playing program [Turing, 1951)
• First significant, operational game-playing program
[Samuel, 1952-57]
Checkers: learning from its mistakes & improve
evaluation accuracy
Games: A good domain to explore machine
intelligence
• Two reasons:
1. They provide a structured task in which it is very easy to
measures success or failure
2. They did not obviously require large amount of knowledge.
They were thought to be solvable by straightforward search
from the starting state to a winning state.
-First reason remains valid
-2nd is not true for any simplest game (Chess)
Average branching factor: 35
In an average game: 50 moves/player
Complete game tree, need to examine: 35100 positions
Games vs. Search Problems
• Thus, it is clear that a program that simply does
a straightforward search of the game tree will
not be able to select even its first move during
the lifetime of its opponent.
• Some kind of heuristic search procedure is
necessary
Generate-and-test
• In order to improve the effectiveness of a
search based problem solving program 02
things can be done:
1. Improve the generate procedure so that only
good moves (paths) are generated
2. Improve the test procedure so that the best
moves (paths) will be recognized & explore
first
Games vs. Search Problems
• By incorporating heuristic knowledge into both the
generator & the tester, the performance of the
overall system can be improved.
• A good static evaluation function
• What Search strategy should we use?
A*: okay for one player game. Inadequate for 02-
person games
• Minimax Procedure
• B* Algorithm
Games
• A game can be formally defined as a kind of search problem with 04
components:
1. The initial state, which includes the board position & identifies the
player to move
2. A successor function, which returns a list of (move, state) pairs,
each indicating a legal move & resulting state
3. A terminal test, which determines when the game is over. States
where the game has ended are called terminal states
4. A utility function, which gives a numeric values for the terminal
states.
- In chess, the outcome is a win, loss, or draw, with values +1, -1, or 0.
-Backgammon (+192~-192)
PLY and MINIMAX
• The possible moves for MAX at the root node are
labeled (a1, a2, a3). The possible replies to a1 for MIN
(b1, b2 , b3), and so on.
• This particular game ends after one move each by
MAX and MIN
• In game parlance, this tree is one move deep,
consisting of two half-moves, each of which is called
a ply
• The utilities of the terminal states in this game: 2~14
PLY and MINIMAX
• 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 (for MAX) of being in
the corresponding state, assuming that both players play
optimally from there to the end of the game
• Minimax value of a terminal state: utility
• MAX will prefer to move to a state of maximum value
• MIN prefers a state of minimum value
MINIMAX VALUE(n)
UTILITY(n) if n is a terminal state